mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-25 03:49:11 +00:00
fix code quality issues
This commit is contained in:
parent
4dc0eeaee3
commit
9310dc31f9
4 changed files with 8 additions and 25 deletions
|
@ -1,11 +1,10 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { EditorCategory } from './EditorCategory';
|
|
||||||
import {
|
import {
|
||||||
mockCategory,
|
mockCategory,
|
||||||
roleCategory2,
|
|
||||||
roleCategory,
|
roleCategory,
|
||||||
guildRoles,
|
roleCategory2,
|
||||||
} from 'roleypoly/src/design-system/shared-types/storyData';
|
} from 'roleypoly/common/types/storyData';
|
||||||
|
import { EditorCategory } from './EditorCategory';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Molecules/Editor/Category',
|
title: 'Molecules/Editor/Category',
|
||||||
|
|
|
@ -1,14 +1,7 @@
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { GoOrganization } from 'react-icons/go';
|
import { GoOrganization } from 'react-icons/go';
|
||||||
import { Guilds } from 'roleypoly/backend-worker/utils/kv';
|
import { DiscordUser, GuildSlug } from 'roleypoly/common/types';
|
||||||
import {
|
|
||||||
DiscordUser,
|
|
||||||
GuildEnumeration,
|
|
||||||
GuildSlug,
|
|
||||||
RoleypolyUser,
|
|
||||||
} from 'roleypoly/common/types';
|
|
||||||
import { guildEnum } from 'roleypoly/common/types/storyData';
|
|
||||||
import { DynamicLogomark } from 'roleypoly/design-system/atoms/branding';
|
import { DynamicLogomark } from 'roleypoly/design-system/atoms/branding';
|
||||||
import { Popover } from 'roleypoly/design-system/atoms/popover';
|
import { Popover } from 'roleypoly/design-system/atoms/popover';
|
||||||
import { GuildNav } from 'roleypoly/design-system/molecules/guild-nav';
|
import { GuildNav } from 'roleypoly/design-system/molecules/guild-nav';
|
||||||
|
@ -71,7 +64,7 @@ export const Authed = (props: Props) => {
|
||||||
active={serverPopoverState}
|
active={serverPopoverState}
|
||||||
onExit={() => setServerPopoverState(false)}
|
onExit={() => setServerPopoverState(false)}
|
||||||
>
|
>
|
||||||
<GuildNav guilds={props.guilds} />
|
{() => <GuildNav guilds={props.guilds} />}
|
||||||
</Popover>
|
</Popover>
|
||||||
</MastheadLeft>
|
</MastheadLeft>
|
||||||
<MastheadRight>
|
<MastheadRight>
|
||||||
|
@ -91,7 +84,7 @@ export const Authed = (props: Props) => {
|
||||||
active={userPopoverState}
|
active={userPopoverState}
|
||||||
onExit={() => setUserPopoverState(false)}
|
onExit={() => setUserPopoverState(false)}
|
||||||
>
|
>
|
||||||
{props.user && <UserPopover user={props.user} />}
|
{() => props.user && <UserPopover user={props.user} />}
|
||||||
</Popover>
|
</Popover>
|
||||||
</MastheadRight>
|
</MastheadRight>
|
||||||
</MastheadAlignment>
|
</MastheadAlignment>
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { GuildEnumeration, RoleypolyUser } from 'roleypoly/common/types';
|
|
||||||
import { AppShell, AppShellProps } from 'roleypoly/design-system/organisms/app-shell';
|
import { AppShell, AppShellProps } from 'roleypoly/design-system/organisms/app-shell';
|
||||||
import {
|
import {
|
||||||
RolePicker,
|
RolePicker,
|
||||||
|
@ -9,15 +8,9 @@ import {
|
||||||
export type RolePickerTemplateProps = RolePickerProps & AppShellProps;
|
export type RolePickerTemplateProps = RolePickerProps & AppShellProps;
|
||||||
|
|
||||||
export const RolePickerTemplate = (props: RolePickerTemplateProps) => {
|
export const RolePickerTemplate = (props: RolePickerTemplateProps) => {
|
||||||
const { user, ...pickerProps } = props;
|
const { user, guilds, activeGuildId, ...pickerProps } = props;
|
||||||
return (
|
return (
|
||||||
<AppShell
|
<AppShell activeGuildId={activeGuildId} user={user} guilds={guilds} small>
|
||||||
guildEnumeration={props.guildEnumeration}
|
|
||||||
activeGuildId={props.activeGuildId}
|
|
||||||
user={user.discorduser}
|
|
||||||
guilds={user.guilds}
|
|
||||||
small
|
|
||||||
>
|
|
||||||
<RolePicker {...pickerProps} />
|
<RolePicker {...pickerProps} />
|
||||||
</AppShell>
|
</AppShell>
|
||||||
);
|
);
|
||||||
|
|
|
@ -38,5 +38,3 @@ export const isAuthenticated = () => {
|
||||||
const authCtx = useAuth();
|
const authCtx = useAuth();
|
||||||
return authCtx.sessionKey !== null;
|
return authCtx.sessionKey !== null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const;
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue