chore: restructure project into yarn workspaces, remove next

This commit is contained in:
41666 2021-03-09 23:25:16 -05:00
parent 49e308507e
commit 8d06327c03
266 changed files with 16466 additions and 3350 deletions

View file

@ -0,0 +1,20 @@
import * as React from 'react';
import { mastheadSlugs, user } from '../../fixtures/storyData';
import { AppShell } from './AppShell';
export default {
title: 'Organisms/App Shell',
component: AppShell,
};
export const Guest = () => (
<AppShell showFooter user={null}>
<h1>Hello World</h1>
</AppShell>
);
export const LoggedIn = () => (
<AppShell user={user} guilds={mastheadSlugs}>
<h1>Hello World</h1>
</AppShell>
);

View file

@ -0,0 +1,24 @@
import { palette } from '@roleypoly/design-system/atoms/colors';
import { fontCSS } from '@roleypoly/design-system/atoms/fonts';
import styled, { createGlobalStyle } from 'styled-components';
export const Content = styled.div<{ small?: boolean }>`
margin: 0 auto;
margin-top: 50px;
width: ${(props) => (props.small ? '960px' : '1024px')};
max-width: 98vw;
max-height: calc(100vh - 50px);
`;
export const GlobalStyles = createGlobalStyle`
body {
background-color: ${palette.taupe200};
color: ${palette.grey600};
overflow-y: hidden;
scroll-behavior: smooth;
${fontCSS}
}
* {
box-sizing: border-box;
}
`;

View file

@ -0,0 +1,42 @@
import { GlobalStyleColors } from '@roleypoly/design-system/atoms/colors';
import { Footer } from '@roleypoly/design-system/molecules/footer';
import * as Masthead from '@roleypoly/design-system/organisms/masthead';
import * as React from 'react';
import { Scrollbars } from 'react-custom-scrollbars';
import { DiscordUser, GuildSlug } from '../../../../src/common/types';
import { Content, GlobalStyles } from './AppShell.styled';
export type AppShellProps = {
children: React.ReactNode;
user?: DiscordUser;
showFooter?: boolean;
small?: boolean;
activeGuildId?: string | null;
guilds?: GuildSlug[];
disableGuildPicker?: boolean;
};
export const AppShell = (props: AppShellProps) => (
<>
<GlobalStyles />
<GlobalStyleColors />
{props.user ? (
<Masthead.Authed
disableGuildPicker={props.disableGuildPicker}
guilds={props.guilds || []}
activeGuildId={props.activeGuildId || null}
user={props.user}
/>
) : (
<Masthead.Guest />
)}
<Scrollbars
style={{ height: 'calc(100vh - 25px)', margin: 0, padding: 0 }}
autoHide
universal
>
<Content small={props.small}>{props.children}</Content>
{props.showFooter && <Footer />}
</Scrollbars>
</>
);

View file

@ -0,0 +1 @@
export * from './AppShell';