Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update: custom modal inner #135

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/layouts/mainLayout/atom/MainCustomModalBody.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
'use client';
import { Box } from '@mui/material';
import { MainCustomModalTextArea } from './MainCustomModalTextArea';
import { useBreakPoint } from '@/hooks';

export const MainCustomModalBody = () => {
const breakpoint = useBreakPoint();

return (
<Box
display="flex"
justifyContent="center"
alignItems={['xs', 'sm'].includes(breakpoint) ? 'center' : 'end'}
flexDirection="column"
gap="25px"
width="100%"
height="calc(100% - 50px)"
padding="0 50px"
sx={{
overflowY: 'overlay',
}}
>
<MainCustomModalTextArea />
</Box>
);
};
32 changes: 32 additions & 0 deletions src/layouts/mainLayout/atom/MainCustomModalHeader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
'use client';
import { useLayout, usePalette } from '@/hooks';
import { Close } from '@mui/icons-material';
import { Box, Typography } from '@mui/material';

export const MainCustomModalHeader = () => {
const palette = usePalette();
const { setIsCustomModal } = useLayout();

return (
<Box
display="flex"
justifyContent="space-between"
alignItems="center"
width="100%"
height="50px"
padding="0 25px"
bgcolor={palette.layout.mainLayout.leftBar.bg}
>
<Typography variant="body2" color={palette.text.secondary}>
キャラクターカスタマイズ
</Typography>
<Close
onClick={() => setIsCustomModal(false)}
sx={{
color: palette.error.dark,
cursor: 'pointer',
}}
/>
</Box>
);
};
18 changes: 18 additions & 0 deletions src/layouts/mainLayout/atom/MainCustomModalTextArea.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use client';
import { Switch, TextField } from '@mui/material';

export const MainCustomModalTextArea = () => {
return (
<>
<TextField
fullWidth
multiline
variant="outlined"
rows={10}
label="キャラクターのカスタマイズ設定を入力"
inputProps={{ maxLength: 200 }}
/>
<Switch />
</>
);
};
3 changes: 3 additions & 0 deletions src/layouts/mainLayout/atom/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ export * from './MainHeaderCommandsRight';
export * from './MainLeftDrawerSelection';
export * from './MainFooterCredit';
export * from './MainLeftBarListItemLog';
export * from './MainCustomModalHeader';
export * from './MainCustomModalBody';
export * from './MainCustomModalTextArea';
8 changes: 6 additions & 2 deletions src/layouts/mainLayout/block/MainCustomModal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client';
import { useBreakPoint, useLayout, usePalette } from '@/hooks';
import { Grow, Modal, Paper } from '@mui/material';
import { MainCustomModalBody, MainCustomModalHeader } from '../atom';

export const MainCustomModal = () => {
const breakpoint = useBreakPoint();
Expand Down Expand Up @@ -28,10 +29,13 @@ export const MainCustomModal = () => {
: 'calc(100vh - 90px)',
maxHeight: '800px',
marginTop: ['xs', 'sm'].includes(breakpoint) ? '0px' : '60px',
borderRadius: ['xs', 'sm'].includes(breakpoint) ? '0px' : '0px',
borderRadius: ['xs', 'sm'].includes(breakpoint) ? '0px' : '10px',
overflow: 'hidden',
}}
></Paper>
>
<MainCustomModalHeader />
<MainCustomModalBody />
</Paper>
</Grow>
</Modal>
);
Expand Down
Loading