feat: restyle create workspace button

This commit is contained in:
MingLiang Wang
2022-12-19 14:20:04 +08:00
parent abbe1dc014
commit 1afdd3bf16
2 changed files with 12 additions and 4 deletions
@@ -1,4 +1,5 @@
import { styled } from '@/styles'; import { styled } from '@/styles';
import { Button } from '@/ui/button';
export const StyledModalWrapper = styled('div')(({ theme }) => { export const StyledModalWrapper = styled('div')(({ theme }) => {
return { return {
@@ -53,3 +54,10 @@ export const StyledButtonContent = styled('div')(({ theme }) => {
margin: '0px 0 32px 0', margin: '0px 0 32px 0',
}; };
}); });
export const StyledButton = styled(Button)(({ theme }) => {
return {
width: '260px',
justifyContent: 'center',
};
});
@@ -8,6 +8,7 @@ import {
StyledModalWrapper, StyledModalWrapper,
StyledInputContent, StyledInputContent,
StyledButtonContent, StyledButtonContent,
StyledButton,
} from './style'; } from './style';
import { useState } from 'react'; import { useState } from 'react';
import { ModalCloseButton } from '@/ui/modal'; import { ModalCloseButton } from '@/ui/modal';
@@ -26,7 +27,7 @@ export const WorkspaceCreate = ({ open, onClose }: WorkspaceCreateProps) => {
return ( return (
<Modal open={open} onClose={onClose}> <Modal open={open} onClose={onClose}>
<StyledModalWrapper> <StyledModalWrapper>
<ModalCloseButton /> <ModalCloseButton onClick={onClose} />
<StyledModalHeader>Create new Workspace</StyledModalHeader> <StyledModalHeader>Create new Workspace</StyledModalHeader>
<StyledTextContent> <StyledTextContent>
Workspaces are shared environments where teams can collaborate. After Workspaces are shared environments where teams can collaborate. After
@@ -40,15 +41,14 @@ export const WorkspaceCreate = ({ open, onClose }: WorkspaceCreateProps) => {
></Input> ></Input>
</StyledInputContent> </StyledInputContent>
<StyledButtonContent> <StyledButtonContent>
<Button <StyledButton
disabled={!workspaceName.length} disabled={!workspaceName.length}
style={{ width: '260px' }}
onClick={() => { onClick={() => {
createWorkspace({ name: workspaceName, avatar: '' }); createWorkspace({ name: workspaceName, avatar: '' });
}} }}
> >
Create Create
</Button> </StyledButton>
</StyledButtonContent> </StyledButtonContent>
</StyledModalWrapper> </StyledModalWrapper>
</Modal> </Modal>