mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-25 03:49:11 +00:00
feat(design-system): add editor skeletons
This commit is contained in:
parent
a37d481b18
commit
9e4bcfa79b
9 changed files with 53 additions and 30 deletions
|
@ -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;
|
||||
}
|
||||
`;
|
||||
|
|
|
@ -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} />;
|
|
@ -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>
|
||||
);
|
|
@ -0,0 +1 @@
|
|||
export * from './EditorCategoriesTab';
|
|
@ -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>
|
||||
);
|
|
@ -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>
|
||||
);
|
Loading…
Add table
Reference in a new issue