feat(design-system): add editor skeletons

This commit is contained in:
41666 2021-03-24 00:02:39 -04:00
parent 9ee7fb4878
commit 600aa3e075
9 changed files with 53 additions and 30 deletions

View file

@ -3,4 +3,11 @@ import styled from 'styled-components';
export const RoleContainer = styled.div`
display: flex;
margin: 10px;
flex-wrap: wrap;
& > div {
/* This should be a Role element */
border: 1px solid rgba(0, 0, 0, 0.15);
margin: 1px;
}
`;

View file

@ -0,0 +1,12 @@
import { guildEnum } from '@roleypoly/design-system/fixtures/storyData';
import { EditorCategoriesTab } from './EditorCategoriesTab';
export default {
title: 'Organisms/Editor/Categories Tab',
component: EditorCategoriesTab,
args: {
guild: guildEnum.guilds[0],
},
};
export const categoriesTab = (args) => <EditorCategoriesTab {...args} />;

View file

@ -0,0 +1,18 @@
import { EditorCategory } from '@roleypoly/design-system/molecules/editor-category';
import { EditorShellProps } from '@roleypoly/design-system/organisms/editor-shell';
import { CategoryContainer } from './EditorCategoriesTab.styled';
export const EditorCategoriesTab = (props: EditorShellProps) => (
<div>
{props.guild.data.categories.map((category, idx) => (
<CategoryContainer key={idx}>
<EditorCategory
category={category}
uncategorizedRoles={[]}
guildRoles={props.guild.roles}
onChange={(x) => console.log(x)}
/>
</CategoryContainer>
))}
</div>
);

View file

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

View file

@ -0,0 +1,15 @@
import { Tab, TabView } from '@roleypoly/design-system/atoms/tab-view';
import { EditorCategoriesTab } from '@roleypoly/design-system/organisms/editor-categories-tab';
import { PresentableGuild } from '@roleypoly/types';
export type EditorShellProps = {
guild: PresentableGuild;
};
export const EditorShell = (props: EditorShellProps) => (
<TabView initialTab={0}>
<Tab title="Guild Details">{() => <div>hi2!</div>}</Tab>
<Tab title="Categories & Roles">{() => <EditorCategoriesTab {...props} />}</Tab>
<Tab title="Utilities">{() => <div>hi2!</div>}</Tab>
</TabView>
);

View file

@ -1,30 +0,0 @@
import { Tab, TabView } from '@roleypoly/design-system/atoms/tab-view';
import { EditorCategory } from '@roleypoly/design-system/molecules/editor-category';
import { PresentableGuild } from '@roleypoly/types';
import { CategoryContainer } from './EditorShell.styled';
type Props = {
guild: PresentableGuild;
};
export const EditorShell = (props: Props) => (
<TabView initialTab={0}>
<Tab title="Roles">{() => <RolesTab {...props} />}</Tab>
<Tab title="Server Details">{() => <div>hi2!</div>}</Tab>
</TabView>
);
const RolesTab = (props: Props) => (
<div>
{props.guild.data.categories.map((category, idx) => (
<CategoryContainer key={idx}>
<EditorCategory
category={category}
uncategorizedRoles={[]}
guildRoles={props.guild.roles}
onChange={(x) => console.log(x)}
/>
</CategoryContainer>
))}
</div>
);