Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cloud_mode #1567

Merged
merged 2 commits into from
Oct 13, 2022
Merged

add cloud_mode #1567

merged 2 commits into from
Oct 13, 2022

Conversation

briancao
Copy link
Collaborator

hide app functionality based on cloud_mode

@briancao briancao requested a review from mikecao October 12, 2022 22:37
@vercel
Copy link

vercel bot commented Oct 12, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
umami ✅ Ready (Inspect) Visit Preview Oct 12, 2022 at 11:33PM (UTC)

@netlify
Copy link

netlify bot commented Oct 12, 2022

Deploy Preview for heartfelt-souffle-72e1df failed.

Name Link
🔨 Latest commit 9e8748e
🔍 Latest deploy log https://app.netlify.com/sites/heartfelt-souffle-72e1df/deploys/63474e618c47fe0008b77f4c

Copy link
Collaborator

@mikecao mikecao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like the idea of passing settingsDisabled down the chain. It's hard to follow. Just create a build time env var and check that where needed.

Also if you hit a restricted page in should just stop. It doesn't need to render anything. No need to pass anything.

</div>
)}
<div className={styles.buttons}>
<ThemeButton />
<LanguageButton menuAlign="right" />
{user && <UserButton />}
{user && <UserButton settingsDisabled={settingsDisabled} />}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes no sense to pass this prop. Just check and don't show the button.

@@ -9,7 +9,7 @@ import styles from './UserButton.module.css';
import { AUTH_TOKEN } from 'lib/constants';
import useUser from 'hooks/useUser';

export default function UserButton() {
export default function UserButton({ settingsDisabled }) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entire button should be hidden.

@mikecao mikecao merged commit 6147c35 into dev Oct 13, 2022
@mikecao mikecao deleted the feat/um-69-nice branch October 13, 2022 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants