[ToyProject-Todomate] ํˆฌ๋‘๋ฉ”์ดํŠธ ํด๋ก  ํ”„๋กœ์ ํŠธ 16

2021. 12. 26. 13:46ใ†WEB Dev/ToyProject

728x90


๐Ÿ”ท CloneTodo โ˜‘ - Todomate Clone Project  |  Team CloneMate

 

CloneTodo : ๋งŽ์€ ์‚ฌ๋žŒ๋“ค์ด ์‚ฌ๋ž‘ํ•˜๋Š” ํˆฌ๋‘๋ฉ”์ดํŠธ๋ฅผ ํด๋ก ํ•˜์—ฌ ์›น ์„œ๋น„์Šค๋ฅผ ๋ฐฐํฌํ•ด๋ณด๋Š” ํ”„๋กœ์ ํŠธ

 


์–ด์ œ ๋ฌธ์ œ๊ฐ€ ์žˆ๋˜ ๋ถ€๋ถ„์€ CSS flex์™€ min-width ์ ์šฉํ•˜๊ณ  ์บ˜๋ฆฐ๋”๋ฅผ Explore ์ปดํฌ๋„ŒํŠธ ์•ˆ์— ๋„ฃ์–ด์„œ ํ•ด๊ฒฐํ–ˆ๋‹ค.

 

 

//Content.js

import React from 'react';
import Calendar from './Calendar';
import Explore from './Explore';
import Feed from './Feed';
import Box from '@mui/material/Box';


export default function Content() {

    return (
        <Box className='content-wrap' backgroundColor='#23fa4350' sx={{ position: 'relative', display: 'flex', width: '100vw', height: '100vh' }}>
        <Explore />
        <Feed />

        </Box>
    );
}

 

 

//Explore.js
import React from 'react';
import Box from '@mui/material/Box';
import Calendar from './Calendar';

export default function Explore() {

    return (
        <Box className='explore-wrap' backgroundColor='#2a5dc950' sx={{ position: 'relative', width: '25vw', height: '15vh', minWidth: '300px', top: 0 }} >        
        <p>explore</p> 
        <Calendar />       
        </Box>
    );
}

 

 

//Calender.js
import React from 'react';
import Box from '@mui/material/Box';

export default function Calendar() {

    return (
        <Box className='calendar-wrap' backgroundColor="#9f4cd650" sx={{ position: 'absolute', width: '25vw', height: '80vh', minWidth: '300px', top: '15vh', border: '4px solid #ddd', boxSizing: 'border-box'}}>
            <p>calendar</p>
        </Box>
    );
}

 

 

์˜ค๋Š˜์€ NavBar ์œ„์˜ ํ–„๋ฒ„๊ฑฐ ๋ฒ„ํŠผ ํด๋ฆญํ•˜๋ฉด Drawer ๋ฉ”๋‰ด๊ฐ€ ๋‚˜์˜ฌ ์ˆ˜ ์žˆ๋„๋ก ์ž‘์—…ํ•ด๋ณธ๋‹ค.

 

 

 

1. DrawerMenu.js ๋งŒ๋“ค๊ธฐ

 

์šฐ์„  Drawer ๋„ ๋ณ„๋„์˜ ์ปดํฌ๋„ŒํŠธ์ด๊ธฐ ๋•Œ๋ฌธ์— (๋‚ด๋ถ€์— ๋ฉ”๋‰ด๋กœ ๊ฐ€์ ธ์•ผ ํ•  ์ปดํฌ๋„ŒํŠธ๋„ ๋งŽ์Œ) ํŒŒ์ผ์„ ํ•˜๋‚˜ ๋งŒ๋“ค์–ด ์ค€๋‹ค.

 

import React from 'react';

export default function DrawerMenu () {

return (
<>


</>
);

}

 

 

Drawer๋„ import๋ฅผ ํ•ด์ค˜์•ผ ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์•„๋ž˜์™€ ๊ฐ™์ด import ํ•ด์ค€๋‹ค.

 

import Drawer from '@mui/material/Drawer';
// or
import { Drawer } from '@mui/material';

 

 

๊ณต์‹ ๋ฌธ์„œ์—์„œ ๋ณด์ด๋Š” ๊ฒƒ ์ฒ˜๋Ÿผ ๋‚ด๊ฐ€ ํ•„์š”ํ•œ ์ปดํฌ๋„ŒํŠธ๋Š” Temporary Drawer๋กœ ์•„๋ž˜ ์ฝ”๋“œ๋ฅผ ํ™•์ธํ•ด๋ณธ๋‹ค.

 

 

Todomate ์ฒ˜๋Ÿผ ๋งŒ๋“ค๋ ค๋ฉด ์˜ค๋ฅธ์ชฝ์—์„œ ๋‚˜ํƒ€๋‚˜๋Š” ๊ฒƒ์„ ์„ ํƒํ•ด์•ผ ํ•˜๋Š”๋ฐ ์ƒ์„ธํ•œ ์ฝ”๋“œ๋Š” ์•„๋ž˜ codesandbox ๋‚˜ stackblitz์—์„œ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

 

์ด ํ™”๋ฉด์€ main ํ™”๋ฉด์—์„œ ๋ณผ ์ˆ˜ ์žˆ๊ธฐ ๋•Œ๋ฌธ์— Main ์ปดํฌ๋„ŒํŠธ์— ๋„ฃ์–ด์ค€๋‹ค.

 

 

import React from 'react';
import Content from './Content';
import Box from '@mui/material/Box';
import DrawerMenu from './DrawerMenu';

export default function Main() {

    return (
        <Box className='main-wrap' backgroundColor='#e4f2b4' sx={{ position: 'relative', width: '100vw', height: '100vh' }}>
        <DrawerMenu />

        <Content />
        </Box>
    );
}

 

 

 

์—ฌ๊ธฐ๊นŒ์ง€ ํ–ˆ๋Š”๋ฐ(12/23) ๋‚ด๋ถ€์— ์ปดํฌ๋„ŒํŠธ ๋ฐฐ์น˜๊ฐ€ ์–ด๋ ค์›Œ์„œ ๋‹ค์‹œ ๊ฐ•์˜๋“ฃ๊ณ  ํ•ด๋ณด๋ ค๊ณ  ํ•œ๋‹ค ใ… ใ… 

728x90