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

Dict 레이아웃 리펙토링 #6

Merged
merged 1 commit into from
Oct 31, 2023
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
27 changes: 2 additions & 25 deletions src/assets/search.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 3 additions & 6 deletions src/pages/Dict/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function Dict() {
id: 1,
pos: "명사",
beforeWord: "미망인",
similarWord: ["과부", "wkflaf", "wdijad"],
similarWord: ["과부"],
mean: "남편이 죽고 배우자 없이 홀로 사는 여자",
},
{
Expand All @@ -22,29 +22,26 @@ function Dict() {
id: 3,
pos: "명사",
beforeWord: "나흘",
similarWord: ["4일", "wkflaf", "wdijad"],
similarWord: ["4일", "배고파"],
mean: "하루가 네 번 있는 시간의 길이. 곧, 네 날",
},
];
return (
<S.DictMain>
<S.SearchBox>
<S.SearchImg src={search} />
<S.SearchBoxInput />
<S.SearchBoxInput placeholder="Search" />
</S.SearchBox>
<S.WordArea>
{data.map((item) => (
<S.WordBox>
<S.Example />
<S.WordBoxBwSw>
{item.beforeWord}
{" "}
{item.similarWord.map((word) => (
<S.SimilarWord>{word}</S.SimilarWord>
))}
</S.WordBoxBwSw>
<S.WordBoxMean>
{"1. "}
<S.Blue>{item.pos}</S.Blue> {item.mean}
</S.WordBoxMean>
</S.WordBox>
Expand Down
35 changes: 12 additions & 23 deletions src/pages/Dict/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,33 @@ export const DictMain = styled.div`
justify-content: center;
gap: 5rem;
width: 100%;
height: 100vh;
margin-top: 5rem;
`;

export const SearchBox = styled.div`
display: flex;
align-items: center;
width: 35%;
height: 5vh;
border: 1px solid #ececec;
border-radius: 25px;
background-color: #fbfbfb42;
gap: 0.5rem;
padding: 1rem 1rem;
padding: 0.75rem 1rem;
`;

export const SearchBoxInput = styled.input`
width: 100%;
height: 4.5vh;
font-size: 1.2rem;
border: none;
outline: none;
/* margin-left: 10px; */
`;

export const SearchImg = styled.img`
width: 4%;
height: 4vh;
/* margin-left: 10px; */
`;

export const WordArea = styled.div`
width: 70%;
height: 50vh;
width: 50%;
display: flex;
flex-direction: column;
justify-content: center;
Expand All @@ -47,10 +42,10 @@ export const WordArea = styled.div`
`;

export const WordBox = styled.div`
width: 70%;
height: 25%;
width: 100%;
padding: 1% 0;
background: #ccc;
border-radius: 10px;
border-radius: 15px;
display: flex;
flex-direction: column;
border: 1px solid #e6e6e6;
Expand All @@ -59,33 +54,27 @@ export const WordBox = styled.div`

export const WordBoxBwSw = styled.div`
display: flex;
align-items: center;
padding: 1rem 1rem;
font-size: 21px;
font-size: 1.3rem;
font-weight: bold;
gap: 0.5rem;
`;

export const Blue = styled.span`
color: #3084f2;
font-weight: bold;
`;

export const SimilarWord = styled.span`
color: #3084f2;
background-color: #e6e6e6;
padding: 0.25rem;
padding: 0.25rem 0.5rem;
border-radius: 5px;
font-size: 18px;
font-size: 1.1rem;
font-weight: 400;
`;

export const WordBoxMean = styled.div`
padding-bottom: 1rem;
padding-left: 1rem;
font-size: 15px;
font-weight: lighter;
`;

export const Example = styled.div`
color: #55f;
font-size: 10px;
`;