feat: learn poc

This commit is contained in:
tzhangchi
2023-01-04 21:49:56 +08:00
parent c6657e7a9b
commit 5f729464a2
2 changed files with 15 additions and 9 deletions

View File

@@ -27,7 +27,7 @@ export const WorkspaceModal = ({ open, onClose }: LoginModalProps) => {
<Modal open={open} onClose={onClose}> <Modal open={open} onClose={onClose}>
<ModalWrapper width={620} height={334} style={{ padding: '10px' }}> <ModalWrapper width={620} height={334} style={{ padding: '10px' }}>
<Header> <Header>
<ContentTitle>My workspace</ContentTitle> <ContentTitle>My Workspace List</ContentTitle>
<ModalCloseButton <ModalCloseButton
top={6} top={6}
right={6} right={6}
@@ -42,16 +42,17 @@ export const WorkspaceModal = ({ open, onClose }: LoginModalProps) => {
return ( return (
<WorkspaceItem key={item.id}> <WorkspaceItem key={item.id}>
<span></span> <span></span>
<span>{item.name}</span> <span>{item.name}</span>/
{item.type === 'local' && <span>local</span>} {item.type === 'local' && <b>local</b>}
{item.type === 'share' && <span>share</span>} {item.type === 'share' && <b>share</b>}/
{item.isPublish ? 'public' : 'private'} {item.isPublish ? 'isPublish' : 'isPrivate'}/
{item.isLocal ? 'local' : 'local'} {item.isLocal ? 'isLocal' : ''}/
</WorkspaceItem> </WorkspaceItem>
); );
})} })}
<li> <li>
<Button <Button
type="primary"
onClick={() => { onClick={() => {
setCreateWorkspaceOpen(true); setCreateWorkspaceOpen(true);
}} }}
@@ -114,4 +115,9 @@ const WorkspaceList = styled('div')({
const WorkspaceItem = styled('div')({ const WorkspaceItem = styled('div')({
border: '1px solid #e5e5e5', border: '1px solid #e5e5e5',
padding: '10px',
cursor: 'pointer',
':hover': {
background: '#eee',
},
}); });

View File

@@ -5,7 +5,7 @@ import { styled } from '@/styles';
import Button from '@/ui/button/Button'; import Button from '@/ui/button/Button';
const Page = () => { const Page = () => {
const [open, setOpen] = useState<boolean>(false); const [open, setOpen] = useState<boolean>(true);
useEffect(() => { useEffect(() => {
const data = getWorkspaceList(); const data = getWorkspaceList();
@@ -15,14 +15,14 @@ const Page = () => {
}, []); }, []);
return ( return (
<Workspace> <Workspace>
<div>workspace</div> <h1>workspace</h1>
<div> <div>
<Button <Button
onClick={() => { onClick={() => {
setOpen(true); setOpen(true);
}} }}
> >
workspaceList View Workspace List
</Button> </Button>
</div> </div>
<WorkspaceModal <WorkspaceModal