등둝화면은 μ™„λ£Œλ˜μ—ˆμœΌλ‹ˆ, 이젠 νŽΈμ§‘ν™”λ©΄μ„ κ°œλ°œν•΄ 보자.

#13. λ“±λ‘ν™”λ©΄μ—μ„œ λ‚΄μš© μ €μž₯ 및 이미지 μ €μž₯ κΈ°λŠ₯ κ΅¬ν˜„

 

#13. λ“±λ‘ν™”λ©΄μ—μ„œ λ‚΄μš© μ €μž₯ 및 이미지 μ €μž₯ κΈ°λŠ₯ κ΅¬ν˜„

#12. Reactμ—μ„œ Drag & Drop을 μ΄μš©ν•œ 이미지 μ—…λ‘œλ“œ #12. Reactμ—μ„œ Drag & Drop을 μ΄μš©ν•œ 이미지 μ—…λ‘œλ“œ λ§ν¬μ„œλΉ„μŠ€ λ“±λ‘ν™”λ©΄μ—μ„œ Input Value을 κ°€μ Έμ˜€λŠ” 방법을 μ•Œμ•˜λ‹€. 그럼 이미지 등둝을 μœ„ν•œ Drag&Drop 이

firstvalue.tistory.com

 

 

νŽΈμ§‘ν™”λ©΄μ„ κ°œλ°œν•˜κΈ°μ „μ— 개개 별 화면을 μ œμž‘ν•˜λ‹€ λ³΄λ‹ˆ, ν™”λ©΄ 흐름이 λ˜λ„λ‘ κ°œλ°œμ„ μΆ”κ°€ ν•œλ‹€.

ν™”λ©΄ 흐름은 λŒ€λž΅μ μœΌλ‘œ μ•„λž˜ μ‹μœΌλ‘œ κ΅¬ν˜„μ„ ν•œλ‹€.

 

κ΄€λ¦¬μžλͺ¨λ“œ 화면을 λ§Œλ“€μ–΄ 등둝/νŽΈμ§‘/μ‚­μ œ/μˆœμ„œλ³€κ²½μ΄ κ°€λŠ₯ν•˜κ²Œ Prototype UI을 ꡬ성해 보자.

 

⎟⎜초 ν™”λ©΄ ν•˜λ‹¨μ— 메뉴 μ œμž‘

 

⌘ menu.jsx ( μœ„μΉ˜: linkservice/client/src/component/menu.jsx )

---------------------------------------------------------------------------------------------------

Reactμ—μ„œ 많이 μ‚¬μš©ν•˜λŠ” Material UI Icon 을 μ‚¬μš©ν•˜μ—¬ 메뉴듀을 생성해 보자.

 

터미널을 μ—΄μ–΄ 라이브러리λ₯Ό μ„€μΉ˜ν•œλ‹€.

〉〉 yarn add @mui/icons-material @mui/material @emotion/styled @emotion/react

 

μ•„μ΄μ½˜μ€ https://mui.com/material-ui/material-icons/ μ—¬κΈ°μ„œ μ°Ύμ•„ μ μš©ν•œλ‹€.

μš°μ„  HOME κ³Ό κ΄€λ¦¬μž(SETTING) μ•„μ΄μ½˜μ„ μ°Ύμ•„ λ§˜μ— λ“œλŠ” μ•„μ΄μ½˜μ„ ν΄λ¦­ν•˜λ©΄ import λ‚΄μš©μ΄ λ‚˜μ˜¨λ‹€. λ³΅μ‚¬ν•˜μ—¬ 뢙인닀.

 

material-icons

import HomeIcon from '@mui/icons-material/Home';
import SettingsIcon from '@mui/icons-material/Settings';

export default function MenuIcon(props) {

    return (
<>
      <div className='menu-wrap'>
        <div className='menu-box'>
            <HomeIcon fontSize='large'  color="secondary"/>
            <SettingsIcon fontSize='large'  color="secondary" /> 
        </div>
      </div>      
</>
    )

CSS 을 μΆ”κ°€ν•œλ‹€. ( links.css νŒŒμΌμ— μΆ”κ°€ )

.menu-wrap {
    display: flex;    
    margin: 0 auto;
    justify-content: center;
}
.menu-box {
    padding: 20px;
    text-align: center;
}

Material Icon에 색상과 크기λ₯Ό 적용 ν–ˆλ‹€.

Icon 클릭 μ‹œ ν•΄λ‹Ή νŽ˜μ΄μ§€λ‘œ μ΄λ™ν•˜λŠ” onClick()의 HandleIcon() ν•¨μˆ˜λ₯Ό μ œμž‘ν•œλ‹€.

import HomeIcon from '@mui/icons-material/Home';
import SettingsIcon from '@mui/icons-material/Settings';
import { useNavigate } from 'react-router-dom';

export default function MenuIcon(props) {
    const navigator = useNavigate()
    const handleIcon = (e) => {
        switch (e) {
            case 'A' : return navigator('/manager')
            case 'M' : return navigator('/')
            default : return navigator('/')
        }
    }
    return (
<>
      <div className='menu-wrap'>
        <div className='menu-box'>
            <HomeIcon fontSize='large' color="secondary"
                onClick={() => handleIcon('M')} 
            />
            <SettingsIcon fontSize='large' color="secondary"
                onClick={() => handleIcon('A')} 
            /> 
        </div>
      </div>      
</>
    )
}

λͺ¨λ“  νŽ˜μ΄μ§€μ— 메뉴가 보이도둝 App.js을 μˆ˜μ •ν•œλ‹€.

App.js

 

 

+ Recent posts