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,8 @@
import * as React from 'react';
import { DemoPicker } from './DemoPicker';
export default {
title: 'Molecules/Role Demos',
};
export const Picker = () => <DemoPicker />;

View file

@ -0,0 +1,46 @@
import { Role } from '@roleypoly/design-system/atoms/role';
import * as React from 'react';
import styled from 'styled-components';
import { Role as RPCRole } from '../../../../src/common/types';
import { demoData } from '../../../../src/common/types/demoData';
const Container = styled.div`
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
align-content: center;
height: 95px;
`;
const RoleWrap = styled.div`
padding: 2.5px;
display: inline-block;
`;
export const DemoPicker = () => {
const [selectedStates, setSelectedStates] = React.useState<
{
[key in RPCRole['id']]: boolean;
}
>(demoData.reduce((acc, role) => ({ ...acc, [role.id]: false }), {}));
return (
<Container>
{demoData.map((role) => (
<RoleWrap key={`role${role.id}`}>
<Role
role={role}
selected={selectedStates[role.id]}
onClick={() => {
setSelectedStates({
...selectedStates,
[role.id]: !selectedStates[role.id],
});
}}
/>
</RoleWrap>
))}
</Container>
);
};

View file

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