mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-25 11:59:11 +00:00
more storybook fixes due to slugs
This commit is contained in:
parent
0e2c981560
commit
b37e3de378
9 changed files with 46 additions and 22 deletions
|
@ -1,6 +1,6 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { GuildNav } from './GuildNav';
|
import { GuildNav } from './GuildNav';
|
||||||
import { guildEnum } from 'roleypoly/common/types/storyData';
|
import { mastheadSlugs } from 'roleypoly/common/types/storyData';
|
||||||
import { PopoverBase } from 'roleypoly/design-system/atoms/popover/Popover.styled';
|
import { PopoverBase } from 'roleypoly/design-system/atoms/popover/Popover.styled';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -10,12 +10,12 @@ export default {
|
||||||
|
|
||||||
export const HasGuilds = () => (
|
export const HasGuilds = () => (
|
||||||
<PopoverBase active>
|
<PopoverBase active>
|
||||||
<GuildNav guildEnumeration={guildEnum} />
|
<GuildNav guilds={mastheadSlugs} />
|
||||||
</PopoverBase>
|
</PopoverBase>
|
||||||
);
|
);
|
||||||
|
|
||||||
export const NoGuilds = () => (
|
export const NoGuilds = () => (
|
||||||
<PopoverBase active>
|
<PopoverBase active>
|
||||||
<GuildNav guildEnumeration={{ guildsList: [] }} />
|
<GuildNav guilds={[]} />
|
||||||
</PopoverBase>
|
</PopoverBase>
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
import { mastheadSlugs } from 'roleypoly/common/types/storyData';
|
||||||
import { PreauthGreeting } from './PreauthGreeting';
|
import { PreauthGreeting } from './PreauthGreeting';
|
||||||
import { guild } from 'roleypoly/common/types/storyData';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Molecules/Preauth/Greeting',
|
title: 'Molecules/Preauth/Greeting',
|
||||||
component: PreauthGreeting,
|
component: PreauthGreeting,
|
||||||
args: {
|
args: {
|
||||||
guildSlug: guild,
|
guildSlug: mastheadSlugs[0],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
import { GuildSlug } from 'roleypoly/common/types';
|
||||||
import { Avatar, utils as avatarUtils } from 'roleypoly/design-system/atoms/avatar';
|
import { Avatar, utils as avatarUtils } from 'roleypoly/design-system/atoms/avatar';
|
||||||
import { Guild } from 'roleypoly/common/types';
|
|
||||||
import { AccentTitle } from 'roleypoly/design-system/atoms/typography';
|
|
||||||
import { Space } from 'roleypoly/design-system/atoms/space';
|
import { Space } from 'roleypoly/design-system/atoms/space';
|
||||||
|
import { AccentTitle } from 'roleypoly/design-system/atoms/typography';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
|
||||||
type GreetingProps = {
|
type GreetingProps = {
|
||||||
guildSlug: Guild;
|
guildSlug: GuildSlug;
|
||||||
};
|
};
|
||||||
|
|
||||||
const Center = styled.div`
|
const Center = styled.div`
|
||||||
|
@ -19,7 +19,15 @@ const Center = styled.div`
|
||||||
|
|
||||||
export const PreauthGreeting = (props: GreetingProps) => (
|
export const PreauthGreeting = (props: GreetingProps) => (
|
||||||
<Center>
|
<Center>
|
||||||
<Avatar size={64} src={props.guildSlug.icon}>
|
<Avatar
|
||||||
|
size={64}
|
||||||
|
src={avatarUtils.avatarHash(
|
||||||
|
props.guildSlug.id,
|
||||||
|
props.guildSlug.icon,
|
||||||
|
'icons',
|
||||||
|
512
|
||||||
|
)}
|
||||||
|
>
|
||||||
{avatarUtils.initialsFromName(props.guildSlug.name)}
|
{avatarUtils.initialsFromName(props.guildSlug.name)}
|
||||||
</Avatar>
|
</Avatar>
|
||||||
<AccentTitle>
|
<AccentTitle>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { AppShell } from './AppShell';
|
import { AppShell } from './AppShell';
|
||||||
import { rpUser, guildEnum } from 'roleypoly/common/types/storyData';
|
import { user, mastheadSlugs } from 'roleypoly/common/types/storyData';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Organisms/App Shell',
|
title: 'Organisms/App Shell',
|
||||||
|
@ -14,7 +14,7 @@ export const Guest = () => (
|
||||||
);
|
);
|
||||||
|
|
||||||
export const LoggedIn = () => (
|
export const LoggedIn = () => (
|
||||||
<AppShell user={rpUser} guildEnumeration={guildEnum}>
|
<AppShell user={user} guilds={mastheadSlugs}>
|
||||||
<h1>Hello World</h1>
|
<h1>Hello World</h1>
|
||||||
</AppShell>
|
</AppShell>
|
||||||
);
|
);
|
||||||
|
|
|
@ -8,7 +8,7 @@ export const DiscordBase = styled.div`
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
width: 175px;
|
width: 250px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const hover = (roleColor: string) => css`
|
const hover = (roleColor: string) => css`
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { rpUser, guild, guildEnum } from 'roleypoly/common/types/storyData';
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
import { guild, mastheadSlugs, user } from 'roleypoly/common/types/storyData';
|
||||||
import { Authed } from './Authed';
|
import { Authed } from './Authed';
|
||||||
import { Guest } from './Guest';
|
import { Guest } from './Guest';
|
||||||
|
|
||||||
|
@ -8,11 +8,9 @@ export default {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const HasGuilds = () => (
|
export const HasGuilds = () => (
|
||||||
<Authed guildEnumeration={guildEnum} activeGuildId={guild.id} user={rpUser} />
|
<Authed guilds={mastheadSlugs} activeGuildId={guild.id} user={user} />
|
||||||
);
|
);
|
||||||
|
|
||||||
export const NoGuilds = () => (
|
export const NoGuilds = () => <Authed guilds={[]} activeGuildId={null} user={user} />;
|
||||||
<Authed guildEnumeration={{ guildsList: [] }} activeGuildId={null} user={rpUser} />
|
|
||||||
);
|
|
||||||
|
|
||||||
export const Guest_ = () => <Guest />;
|
export const Guest_ = () => <Guest />;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { HelpPageTemplate } from './HelpPage';
|
import { HelpPageTemplate } from './HelpPage';
|
||||||
|
import { WhyNoRoles } from '../../organisms/help-why-no-roles';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Templates/Help Page',
|
title: 'Templates/Help Page',
|
||||||
|
@ -11,3 +12,9 @@ export const Base = () => (
|
||||||
<p>Vibrations that synchronize and tie it together, running free forever.</p>
|
<p>Vibrations that synchronize and tie it together, running free forever.</p>
|
||||||
</HelpPageTemplate>
|
</HelpPageTemplate>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
export const WhyNoRoles_ = () => (
|
||||||
|
<HelpPageTemplate>
|
||||||
|
<WhyNoRoles></WhyNoRoles>
|
||||||
|
</HelpPageTemplate>
|
||||||
|
);
|
||||||
|
|
|
@ -1,15 +1,13 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { AppShell } from 'roleypoly/design-system/organisms/app-shell';
|
import { AppShell, AppShellProps } from 'roleypoly/design-system/organisms/app-shell';
|
||||||
import { HelpPageBase } from 'roleypoly/design-system/molecules/help-page-base';
|
import { HelpPageBase } from 'roleypoly/design-system/molecules/help-page-base';
|
||||||
import { DiscordUser } from 'roleypoly/common/types';
|
|
||||||
|
|
||||||
type HelpPageProps = {
|
export type HelpPageProps = AppShellProps & {
|
||||||
user: DiscordUser | null;
|
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const HelpPageTemplate = (props: HelpPageProps) => (
|
export const HelpPageTemplate = (props: HelpPageProps) => (
|
||||||
<AppShell user={props.user || undefined}>
|
<AppShell guilds={props.guilds} user={props.user || undefined}>
|
||||||
<HelpPageBase>{props.children}</HelpPageBase>
|
<HelpPageBase>{props.children}</HelpPageBase>
|
||||||
</AppShell>
|
</AppShell>
|
||||||
);
|
);
|
||||||
|
|
13
src/pages/help/why-no-roles.tsx
Normal file
13
src/pages/help/why-no-roles.tsx
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
import { WhyNoRoles } from 'roleypoly/design-system/organisms/help-why-no-roles';
|
||||||
|
import {
|
||||||
|
HelpPageTemplate,
|
||||||
|
HelpPageProps,
|
||||||
|
} from 'roleypoly/design-system/templates/help-page';
|
||||||
|
|
||||||
|
const WhyNoRolesPage = (props: HelpPageProps) => (
|
||||||
|
<HelpPageTemplate {...props}>
|
||||||
|
<WhyNoRoles></WhyNoRoles>
|
||||||
|
</HelpPageTemplate>
|
||||||
|
);
|
||||||
|
|
||||||
|
export default WhyNoRolesPages;
|
Loading…
Add table
Reference in a new issue