-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from whatever-mentoring/feature/Mypage-components
feat: ๋ง์ดํ์ด์ง ์ปดํฌ๋ํธ (๋๊ธ, ์คํฌ๋ฉ, ๊ฒ์๋ฌผ ๋ฐ์ค, ๋ต๋ณ์๋ฃ ํญ) ์์ฑ
- Loading branch information
Showing
15 changed files
with
505 additions
and
79 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,25 @@ | ||
import React from "react"; | ||
import { CommentListBox } from 'components/Mypage/CommentListBox'; | ||
import { MyQnaListBox } from 'components/Mypage/MyQnaListBox'; | ||
import { ScrapListBox } from 'components/Mypage/ScrapListBox'; | ||
import { Waitingtab } from 'components/Mypage/WaitingTab'; | ||
import React from 'react'; | ||
|
||
function App() { | ||
return <div></div>; | ||
return ( | ||
<div | ||
style={{ | ||
padding: '20px', | ||
display: 'flex', | ||
flexDirection: 'column', | ||
gap: 30, | ||
}} | ||
> | ||
<Waitingtab /> | ||
<CommentListBox /> | ||
<ScrapListBox /> | ||
<MyQnaListBox /> | ||
</div> | ||
); | ||
} | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { styled } from 'styled-components'; | ||
import { Palette } from 'styles/Palette'; | ||
|
||
export const Row = styled.div<{ | ||
gap?: number; | ||
justifyContent?: string; | ||
alignItems?: string; | ||
}>` | ||
display: flex; | ||
gap: ${({ gap }) => (gap ? gap : 0)}px; | ||
align-items: ${({ alignItems }) => (alignItems ? alignItems : 'initial')}; | ||
justify-content: ${({ justifyContent }) => | ||
justifyContent ? justifyContent : 'initial'}; | ||
`; | ||
|
||
export const MyPageBoxContainer = styled.div<{ | ||
height?: string; | ||
padding?: string; | ||
}>` | ||
display: flex; | ||
width: 100%; | ||
height: ${({ height }) => (height ? height : 'fit-content')}; | ||
border-radius: 5px; | ||
padding: ${({ padding }) => (padding ? padding : 0)}; | ||
background: ${Palette.White}; | ||
box-shadow: 1px 1px 4px 0px rgba(0, 0, 0, 0.1); | ||
`; | ||
|
||
export const TextContainer = styled.div<{ gap?: number }>` | ||
display: flex; | ||
flex-direction: column; | ||
gap: ${({ gap }) => (gap ? gap : 0)}px; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { styled } from 'styled-components'; | ||
import { Palette } from 'styles/Palette'; | ||
import Typo from 'styles/Typo'; | ||
|
||
export const CategoryLabel = ({ children }: { children: React.ReactNode }) => { | ||
return ( | ||
<Container> | ||
<Typo.s2>{children}</Typo.s2> | ||
</Container> | ||
); | ||
}; | ||
|
||
const Container = styled.div<{ role?: string }>` | ||
display: flex; | ||
width: fit-content; | ||
height: 19px; | ||
padding: 10px 7px; | ||
justify-content: center; | ||
align-items: center; | ||
border-radius: 10px; | ||
background: ${Palette.Main15}; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { MyPageBoxContainer, Row, TextContainer } from 'assets/common'; | ||
import { Palette } from 'styles/Palette'; | ||
import Typo from 'styles/Typo'; | ||
|
||
export const CommentListBox = () => { | ||
let userType = 1; | ||
let icon = 'juni_commentSubIcon'; | ||
if (userType == 0) icon = 'juni_commentSubIcon'; | ||
else if (userType == 1) icon = 'cyni_commentSubIcon'; | ||
|
||
return ( | ||
<MyPageBoxContainer padding="14px" height="79px"> | ||
<TextContainer> | ||
<Typo.b4>๋๊ธ์ ๋๋ค๋๊ธ์ ๋๋ค.๋๊ธ์ ๋๋ค๋๊ธ์ ๋๋ค.</Typo.b4> | ||
<Row gap={5}> | ||
<img src={`img/${icon}.svg`} /> | ||
<Typo.b4 color={Palette.Gray4}>๊ธ ์ ๋ชฉ</Typo.b4> | ||
</Row> | ||
<Typo.s2 color={Palette.Gray4}>2023.09.09</Typo.s2> | ||
</TextContainer> | ||
</MyPageBoxContainer> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { styled } from 'styled-components'; | ||
import { Palette } from 'styles/Palette'; | ||
import Typo from 'styles/Typo'; | ||
import { CategoryLabel } from './CategoryLabel'; | ||
import { MyPageBoxContainer, Row } from 'assets/common'; | ||
|
||
export const MyQnaListBox = () => { | ||
let ansCount = 2; | ||
let userType = 1; // userType ์์๋ณ์ | ||
|
||
return ( | ||
<MyPageBoxContainer height="72px"> | ||
<CountStick ansCount={ansCount} userType={userType} /> | ||
<SubContainer> | ||
<Row gap={3}> | ||
<Typo.b3>{userType === 0 ? 'Q.' : 'A.'}</Typo.b3> | ||
<Typo.b4>๋ด ์ง๋ฌธ์ ๋๋ค.</Typo.b4> | ||
</Row> | ||
<Row justifyContent="space-between" alignItems="center"> | ||
<Row gap={10} alignItems="center"> | ||
<CategoryLabel>์ผ์</CategoryLabel> | ||
<Typo.s2 color={Palette.Gray4}>2023.09.09</Typo.s2> | ||
</Row> | ||
<Typo.s1 color={Palette.Main}>D-6</Typo.s1> | ||
</Row> | ||
</SubContainer> | ||
</MyPageBoxContainer> | ||
); | ||
}; | ||
|
||
const CountStick = styled.div<{ ansCount?: number; userType?: number }>` | ||
width: 7px; | ||
height: 100%; | ||
background: ${({ ansCount, userType }) => | ||
ansCount == 0 | ||
? Palette.Gray2 | ||
: ansCount == 1 | ||
? `linear-gradient(to top, ${Palette.Main50} 33.3%, ${Palette.Gray2} 33.3%)` | ||
: ansCount == 2 | ||
? `linear-gradient(to top, ${Palette.Main50} 33.3%, ${Palette.Main50} 33.3%, ${Palette.Main80} 33.3%, ${Palette.Main80} 66.6%, ${Palette.Gray2} 66.6%)` | ||
: ansCount == 3 | ||
? Palette.Main | ||
: Palette.Black}; | ||
border-radius: 5px 0 0 5px; | ||
`; | ||
const SubContainer = styled.div` | ||
width: 100%; | ||
height: 100%; | ||
padding: 14px 18px; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 5px; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Palette } from 'styles/Palette'; | ||
import Typo from 'styles/Typo'; | ||
import { CategoryLabel } from './CategoryLabel'; | ||
import { MyPageBoxContainer, Row, TextContainer } from 'assets/common'; | ||
|
||
export const ScrapListBox = () => { | ||
return ( | ||
<MyPageBoxContainer padding="14px 15px"> | ||
<TextContainer gap={4}> | ||
<CategoryLabel>์ธ๊ฐ๊ด๊ณ</CategoryLabel> | ||
<Typo.b1>๊ธ ์ ๋ชฉ์ ๋๋ค</Typo.b1> | ||
<Typo.b3 color={Palette.Gray4}> | ||
๊ธ ๋ด์ฉ์ ๋๋ค ๊ธ ๋ด์ฉ์ ๋๋ค ๊ธ ๋ด์ฉ์ ๋๋ค ๊ธ ๋ด์ฉ์ ๋๋ค ๊ธ ๋ด์ฉ์ ๋๋ค | ||
๊ธ ๋ด์ฉ์ ๋๋ค ๊ธ ๋ด์ฉ์ ๋๋ค ๊ธ ๋ด์ฉ์ ๋๋ค ๊ธ๋ด์ฉ | ||
</Typo.b3> | ||
<Row gap={7}> | ||
<Row gap={4}> | ||
<img src="img/comment.svg" /> | ||
<Typo.s2 color={Palette.Gray4}>12</Typo.s2> | ||
</Row> | ||
<Row gap={4}> | ||
<img src="img/scrap.svg" /> | ||
<Typo.s2 color={Palette.Gray4}>123</Typo.s2> | ||
</Row> | ||
<Typo.s2 color={Palette.Gray4}>2023.09.09</Typo.s2> | ||
</Row> | ||
</TextContainer> | ||
</MyPageBoxContainer> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { useState } from 'react'; | ||
import { styled } from 'styled-components'; | ||
import { Palette } from 'styles/Palette'; | ||
import Typo from 'styles/Typo'; | ||
|
||
interface tabInterface { | ||
label: string; | ||
status: string; | ||
} | ||
|
||
export const Waitingtab = () => { | ||
const [clickNum, setClickNum] = useState(0); | ||
let role = 'juni'; | ||
|
||
const tabs: tabInterface[] = [ | ||
{ label: role === 'juni' ? '๋ต๋ณ' : '์ฃผ์จ', status: '์๋ฃ' }, | ||
{ label: role === 'juni' ? '๋ต๋ณ' : '์ฃผ์จ', status: '๋๊ธฐ' }, | ||
]; | ||
|
||
return ( | ||
<Container> | ||
{tabs.map((tab: tabInterface, index: number) => ( | ||
<SubContainer | ||
key={index} | ||
onClick={() => setClickNum(index)} | ||
borderHeight={index === clickNum ? 3 : 0} | ||
> | ||
<Typo.h4>{`${tab.label} ${tab.status}`}</Typo.h4> | ||
</SubContainer> | ||
))} | ||
</Container> | ||
); | ||
}; | ||
|
||
const Container = styled.div` | ||
display: flex; | ||
justify-content: center; | ||
gap: 15px; | ||
width: 100%; | ||
height: 41px; | ||
padding: 0 25px; | ||
border-bottom: ${Palette.Gray3} 1px solid; | ||
`; | ||
const SubContainer = styled.div<{ borderHeight?: number }>` | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
width: 100%; | ||
border-bottom: ${({ borderHeight }) => | ||
borderHeight ? `${Palette.Black} ${borderHeight}px solid` : 0}; | ||
`; |
Oops, something went wrong.