feat(AppShell): add option to disable my guilds popover

This commit is contained in:
41666 2020-12-19 20:10:57 -05:00
parent e758c09fbf
commit d61f5ae59e
2 changed files with 7 additions and 2 deletions

View file

@ -13,6 +13,7 @@ export type AppShellProps = {
small?: boolean;
activeGuildId?: string | null;
guilds?: GuildSlug[];
disableGuildPicker?: boolean;
};
export const AppShell = (props: AppShellProps) => (
@ -21,6 +22,7 @@ export const AppShell = (props: AppShellProps) => (
<GlobalStyleColors />
{props.user ? (
<Masthead.Authed
disableGuildPicker={props.disableGuildPicker}
guilds={props.guilds || []}
activeGuildId={props.activeGuildId || null}
user={props.user}

View file

@ -22,6 +22,7 @@ type Props = {
user?: DiscordUser;
activeGuildId: string | null;
guilds: GuildSlug[];
disableGuildPicker?: boolean;
};
export const Authed = (props: Props) => {
@ -39,8 +40,10 @@ export const Authed = (props: Props) => {
</Link>
<InteractionBase
onClick={() => {
setServerPopoverState(true);
setUserPopoverState(false);
if (!props.disableGuildPicker) {
setServerPopoverState(true);
setUserPopoverState(false);
}
}}
hide={!serverPopoverState}
>