Skip to content

Commit 2c46ca5

Browse files
committed
feat(#27):보드기능구현(중)
:
1 parent 537f3ae commit 2c46ca5

File tree

11 files changed

+1036
-315
lines changed

11 files changed

+1036
-315
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ yarn-debug.log*
2626
yarn-error.log*
2727

2828
# local env files
29+
.env*
2930
.env*.local
3031
.env
3132
.env.mock
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import styled, { css } from 'styled-components';
2+
3+
interface TextType {
4+
color?: string;
5+
size?: number;
6+
}
7+
8+
/**
9+
* 텍스트 상자의 색깔과 size 지정을 위한 style
10+
* @param color [string]
11+
* color='#fff'
12+
* @param size [number]
13+
* size={20}
14+
* @return color -> color : #fff
15+
* @return color -> size : 20px
16+
*/
17+
export const TextBox = styled.div<TextType>`
18+
color: ${({ color }) => color};
19+
font-size: ${({ size }) => size}px;
20+
`;
21+
22+
interface FlexType {
23+
type?: string;
24+
direction?: string;
25+
col?: string;
26+
row?: string;
27+
}
28+
29+
/** display속성을 위한 style
30+
* @param type [string]
31+
* type='flex' || 'block' || 'grid
32+
* @param direction [string]
33+
* direction='column' || 'row'
34+
* @param col [string]
35+
* col='left' || 'center' || 'rigth'
36+
* @param row [string]
37+
* row='start' || 'center' || 'left'
38+
* @return type -> display: flex
39+
* @return direction -> flex-direction: column
40+
* @return col -> justify-content : center
41+
* @return row -> align-items: center
42+
*/
43+
export const FlexBox = styled.div<FlexType>`
44+
${({ type, direction, col, row }) => {
45+
return css`
46+
display: ${type};
47+
flex-direction: ${direction};
48+
justify-content: ${col};
49+
align-items: ${row};
50+
`;
51+
}}
52+
`;

src/components/organisms/help-board/HelpCategory.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const CategoryContainer = styled.div`
2626
justify-content: left;
2727
border: 1px solid #9ff;
2828
min-width: 500px;
29-
width: 1512px;
29+
width: 1532px;
3030
`;
3131

3232
const CategoryBox = styled.div`
Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import MentorCard from '@/components/molecules/mentor-board-elements/MentorCard';
22
import axios from 'axios';
3-
import { useEffect, useState } from 'react';
4-
import styled from 'styled-components';
3+
import { useEffect, useRef, useState } from 'react';
4+
import * as S from './styled';
55

66
type MentorListType = {
77
id: number;
@@ -16,9 +16,9 @@ interface SlideType {
1616
}
1717

1818
const MentoBoardList = ({ slide }: SlideType) => {
19-
//api요청
2019
const [getMockingData, setMockingData] = useState<MentorListType[]>([]);
2120

21+
//api요청
2222
const getMockingDataApi = async () => {
2323
const res = await axios.get('/api/mento');
2424
setMockingData(res.data);
@@ -29,7 +29,7 @@ const MentoBoardList = ({ slide }: SlideType) => {
2929
}, []);
3030

3131
return (
32-
<MentoCardContainer>
32+
<S.MentoCardContainer>
3333
{getMockingData.map((data: any) => {
3434
const temp = {
3535
id: data.id,
@@ -39,43 +39,13 @@ const MentoBoardList = ({ slide }: SlideType) => {
3939
mainField: data.mainField,
4040
};
4141
return (
42-
<MentorCardWarpper onClick={slide} key={data.id}>
42+
<S.MentorCardWarpper onClick={slide} key={data.id}>
4343
<MentorCard {...temp} />
44-
</MentorCardWarpper>
44+
</S.MentorCardWarpper>
4545
);
4646
})}
47-
</MentoCardContainer>
47+
</S.MentoCardContainer>
4848
);
4949
};
5050

5151
export default MentoBoardList;
52-
53-
const MentoCardContainer = styled.div`
54-
border: 2px solid #c12;
55-
display: flex;
56-
justify-content: left;
57-
min-height: 500px;
58-
width: 1512px;
59-
flex-wrap: wrap;
60-
`;
61-
62-
const MentorCardWarpper = styled.div`
63-
& > * {
64-
&:nth-of-type(1n),
65-
&:nth-of-type(1) {
66-
margin: 0px 14px 118px 0px;
67-
}
68-
&:nth-of-type(5n),
69-
:nth-of-type(5) {
70-
margin: 0px 0px 118px 14px;
71-
}
72-
&:not(
73-
:nth-of-type(1n),
74-
:nth-of-type(5n),
75-
:nth-of-type(1),
76-
:nth-of-type(5)
77-
) {
78-
margin: 0px 14px 118px 14px;
79-
}
80-
}
81-
`;

src/components/organisms/mentor-board/MentorBoardUnit.tsx

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/components/organisms/mentor-board/MentorSideViewer.tsx

Lines changed: 55 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import { SideViewerAtom } from '@/recoil/atoms/SideViewerAtom';
22
import axios from 'axios';
33
import { useEffect, useState } from 'react';
44
import { useRecoilState } from 'recoil';
5-
import styled, { css } from 'styled-components';
5+
import * as S from './styled';
6+
import { TextBox } from '@/components/common/globalStyled/styled';
67

78
interface SlideType {
8-
next: () => void;
9-
prev: () => void;
9+
slide: () => void;
1010
}
1111

12-
const MentorSideViewer = ({ next, prev }: SlideType) => {
12+
const MentorSideViewer = ({ slide }: SlideType) => {
1313
const [getMentoUnit, setMentoUnit] = useState<any>(null);
1414
const [sideViewer, setSideViewer] = useRecoilState(SideViewerAtom);
1515

@@ -28,43 +28,65 @@ const MentorSideViewer = ({ next, prev }: SlideType) => {
2828
sideViewer && getMentoUserApi();
2929
}, [sideViewer]);
3030

31-
useEffect(() => {
32-
console.log(getMentoUnit);
33-
});
34-
3531
return (
36-
<SideViewerWarpper>
37-
<div onClick={prev}>이전</div>
38-
<div onClick={next}>다음</div>
32+
<S.SideViewerWarpper>
3933
{getMentoUnit && (
4034
<div>
41-
<TextBox color="#C63D2F" size={30}>
35+
<TextBox color="#C63D2F" size={40}>
4236
{getMentoUnit.name}
4337
</TextBox>
44-
<div>
45-
<div>{getMentoUnit.image}</div>
46-
<div></div>
47-
</div>
38+
<S.SideProfileContainer>
39+
<div>
40+
<S.ImageBox>이미지 들어올자리</S.ImageBox>
41+
<TextBox onClick={slide} color="#FFBB5C">
42+
이전
43+
</TextBox>
44+
</div>
45+
<div>
46+
<S.ProfileViewBox>
47+
<div>
48+
<TextBox
49+
color="#FFBB5C"
50+
size={20}
51+
style={{ padding: '28px' }}>
52+
주요경력
53+
</TextBox>
54+
<TextBox
55+
color="#fff"
56+
size={15}
57+
style={{
58+
display: 'flex',
59+
padding: '28px',
60+
width: 280,
61+
flexWrap: 'wrap',
62+
}}>
63+
{getMentoUnit.career}
64+
</TextBox>
65+
</div>
66+
<div>
67+
<TextBox
68+
color="#FFBB5C"
69+
size={20}
70+
style={{ padding: '28px' }}>
71+
멘토링분야
72+
</TextBox>
73+
<TextBox color="#fff" size={15} style={{ padding: '28px' }}>
74+
{getMentoUnit.mainField}
75+
</TextBox>
76+
</div>
77+
</S.ProfileViewBox>
78+
<TextBox color="#FFBB5C" size={20} style={{ padding: '28px' }}>
79+
소개
80+
</TextBox>
81+
<TextBox color="#fff" size={15} style={{ padding: '28px' }}>
82+
{getMentoUnit.introduct}
83+
</TextBox>
84+
</div>
85+
</S.SideProfileContainer>
4886
</div>
4987
)}
50-
</SideViewerWarpper>
88+
</S.SideViewerWarpper>
5189
);
5290
};
5391

5492
export default MentorSideViewer;
55-
56-
const SideViewerWarpper = styled.div`
57-
min-width: 1100px;
58-
width: 1512px;
59-
border: 4px solid #fe9;
60-
`;
61-
62-
interface BoxType {
63-
color?: string;
64-
size?: number;
65-
}
66-
67-
const TextBox = styled.div<BoxType>`
68-
color: ${({ color }) => color};
69-
font-size: ${({ size }) => size}px;
70-
`;
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import styled from 'styled-components';
2+
3+
/**MentorBoardCard.tsx */
4+
5+
export const MentoCardContainer = styled.div`
6+
border: 2px solid #c12;
7+
display: flex;
8+
width: 1560px;
9+
min-height: 500px;
10+
flex-wrap: wrap;
11+
`;
12+
13+
export const MentorCardWarpper = styled.div`
14+
margin: 0px 14px 118px 14px;
15+
`;
16+
17+
/**MentorSideViewer */
18+
19+
export const SideViewerWarpper = styled.div`
20+
display: flex;
21+
justify-content: left;
22+
height: 100%;
23+
padding: 130px;
24+
min-width: 1100px;
25+
width: 650px;
26+
border: 4px solid #fe9;
27+
`;
28+
29+
export const SideProfileContainer = styled.div`
30+
display: flex;
31+
`;
32+
33+
export const ProfileViewBox = styled.div`
34+
display: flex;
35+
`;
36+
37+
export const ImageBox = styled.div`
38+
width: 280px;
39+
height: 337px;
40+
background-color: #999;
41+
`;

0 commit comments

Comments
 (0)