1
0
Fork 0
forked from OpenNeo/impress
impress/src/app/WardrobePage/support/SupportOnly.js
Matchu cae2f1a977 Set up the special color mutation on the client?
Optimistic UI seems to just be like, not working… I'm seeing some Google results suggesting maybe just get to v3, which is a bit of upgrade work but might be worth it
2020-07-31 23:34:15 -07:00

19 lines
651 B
JavaScript

import useSupportSecret from "./useSupportSecret";
/**
* SupportOnly only shows its contents to Support users. For most users, the
* content will be hidden!
*
* To become a Support user, you visit /?supportSecret=..., which saves the
* secret to your device.
*
* Note that this component doesn't check that the secret is *correct*, so it's
* possible to view this UI by faking an invalid secret. That's okay, because
* the server checks the provided secret for each Support request.
*/
function SupportOnly({ children }) {
const supportSecret = useSupportSecret();
return supportSecret ? children : null;
}
export default SupportOnly;