fix code quality issues

This commit is contained in:
41666 2020-12-05 03:21:02 -05:00
parent 4dc0eeaee3
commit 9310dc31f9
4 changed files with 8 additions and 25 deletions

View file

@ -1,11 +1,10 @@
import * as React from 'react';
import { EditorCategory } from './EditorCategory';
import {
mockCategory,
roleCategory2,
roleCategory,
guildRoles,
} from 'roleypoly/src/design-system/shared-types/storyData';
roleCategory2,
} from 'roleypoly/common/types/storyData';
import { EditorCategory } from './EditorCategory';
export default {
title: 'Molecules/Editor/Category',

View file

@ -1,14 +1,7 @@
import Link from 'next/link';
import * as React from 'react';
import { GoOrganization } from 'react-icons/go';
import { Guilds } from 'roleypoly/backend-worker/utils/kv';
import {
DiscordUser,
GuildEnumeration,
GuildSlug,
RoleypolyUser,
} from 'roleypoly/common/types';
import { guildEnum } from 'roleypoly/common/types/storyData';
import { DiscordUser, GuildSlug } from 'roleypoly/common/types';
import { DynamicLogomark } from 'roleypoly/design-system/atoms/branding';
import { Popover } from 'roleypoly/design-system/atoms/popover';
import { GuildNav } from 'roleypoly/design-system/molecules/guild-nav';
@ -71,7 +64,7 @@ export const Authed = (props: Props) => {
active={serverPopoverState}
onExit={() => setServerPopoverState(false)}
>
<GuildNav guilds={props.guilds} />
{() => <GuildNav guilds={props.guilds} />}
</Popover>
</MastheadLeft>
<MastheadRight>
@ -91,7 +84,7 @@ export const Authed = (props: Props) => {
active={userPopoverState}
onExit={() => setUserPopoverState(false)}
>
{props.user && <UserPopover user={props.user} />}
{() => props.user && <UserPopover user={props.user} />}
</Popover>
</MastheadRight>
</MastheadAlignment>

View file

@ -1,5 +1,4 @@
import * as React from 'react';
import { GuildEnumeration, RoleypolyUser } from 'roleypoly/common/types';
import { AppShell, AppShellProps } from 'roleypoly/design-system/organisms/app-shell';
import {
RolePicker,
@ -9,15 +8,9 @@ import {
export type RolePickerTemplateProps = RolePickerProps & AppShellProps;
export const RolePickerTemplate = (props: RolePickerTemplateProps) => {
const { user, ...pickerProps } = props;
const { user, guilds, activeGuildId, ...pickerProps } = props;
return (
<AppShell
guildEnumeration={props.guildEnumeration}
activeGuildId={props.activeGuildId}
user={user.discorduser}
guilds={user.guilds}
small
>
<AppShell activeGuildId={activeGuildId} user={user} guilds={guilds} small>
<RolePicker {...pickerProps} />
</AppShell>
);

View file

@ -38,5 +38,3 @@ export const isAuthenticated = () => {
const authCtx = useAuth();
return authCtx.sessionKey !== null;
};
export const;