-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
123 feat/일기 조회 페이지-메인 및 서브 감정 위젯 (#127)
* feat : 일기상세 페이지 감정 위젯 * fix : 마진 높이 수정
- Loading branch information
1 parent
a05bb9a
commit 2d0d50e
Showing
10 changed files
with
179 additions
and
0 deletions.
There are no files selected for viewing
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 @@ | ||
export { ShowMainEmotionContainer } from './ui/ShowMainEmotionContainer'; |
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,5 @@ | ||
import { Emotions } from '@/shared/model/EmotionEnum'; | ||
|
||
export interface ShowMainEmotionContainerProps { | ||
emotion: Emotions; | ||
} |
18 changes: 18 additions & 0 deletions
18
src/widgets/show-main-emotion/ui/ShowMainEmotionContainer.stories.ts
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,18 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { ShowMainEmotionContainer } from './ShowMainEmotionContainer'; | ||
import { Emotions } from '@/shared/model/EmotionEnum'; | ||
|
||
const meta: Meta<typeof ShowMainEmotionContainer> = { | ||
title: 'Widgets/UI/ShowMainEmotionContainer', | ||
component: ShowMainEmotionContainer, | ||
tags: ['autodocs'] | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof ShowMainEmotionContainer>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
emotion: Emotions.Happy | ||
} | ||
}; |
35 changes: 35 additions & 0 deletions
35
src/widgets/show-main-emotion/ui/ShowMainEmotionContainer.styles.ts
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,35 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const Container = styled.div` | ||
// position: absolute; | ||
// width: 100%; | ||
height: 250px; | ||
background-color: #ffffff; | ||
border-radius: 10px; | ||
padding: 30px; | ||
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.13); | ||
font-size: 16px; | ||
font-weight: bold; | ||
font-family: 'Pretendard', sans-serif; | ||
`; | ||
|
||
export const EmotionContainer = styled.div` | ||
position: absolute; | ||
display: flex; | ||
height: 100px; | ||
width: 70px; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
background-color: #ffffff; | ||
border-radius: 10px; | ||
border: 1px solid rgba(0, 0, 0, 0.1); | ||
padding: 20px; | ||
left: 50%; | ||
transform: translateX(-50%); | ||
margin-top: 60px; | ||
gap: 10px; | ||
font-weight: normal; | ||
`; |
19 changes: 19 additions & 0 deletions
19
src/widgets/show-main-emotion/ui/ShowMainEmotionContainer.tsx
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,19 @@ | ||
import React from 'react'; | ||
import { Container, EmotionContainer } from './ShowMainEmotionContainer.styles'; | ||
import { ShowMainEmotionContainerProps } from '../model/type'; | ||
import { EmotionIcon } from '@/shared/EmotionIcon/ui/EmotionIcon'; | ||
import { getEmotionInfo } from '@/shared/model/EmotionEnum'; | ||
|
||
export const ShowMainEmotionContainer = ({ | ||
emotion | ||
}: ShowMainEmotionContainerProps) => { | ||
return ( | ||
<Container> | ||
메인 감정 키워드 | ||
<EmotionContainer> | ||
<EmotionIcon emotion={emotion} width="50px" height="50px" /> | ||
{getEmotionInfo(emotion).description} | ||
</EmotionContainer> | ||
</Container> | ||
); | ||
}; |
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 @@ | ||
export { ShowSubEmotionContainer } from './ui/ShowSubEmotionContainer'; |
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,5 @@ | ||
import { Emotions } from '@/shared/model/EmotionEnum'; | ||
|
||
export interface ShowSubEmotionContainerProps { | ||
subEmotions: Emotions[]; | ||
} |
23 changes: 23 additions & 0 deletions
23
src/widgets/show-sub-emotion/ui/ShowSubEmotionContainer.stories.ts
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 type { Meta, StoryObj } from '@storybook/react'; | ||
import { ShowSubEmotionContainer } from './ShowSubEmotionContainer'; | ||
import { Emotions } from '@/shared/model/EmotionEnum'; | ||
|
||
const meta: Meta<typeof ShowSubEmotionContainer> = { | ||
title: 'Widgets/UI/ShowSubEmotionContainer', | ||
component: ShowSubEmotionContainer, | ||
tags: ['autodocs'] | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof ShowSubEmotionContainer>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
subEmotions: [ | ||
Emotions.Angry, | ||
Emotions.Sad, | ||
Emotions.Blank, | ||
Emotions.Excited | ||
] | ||
} | ||
}; |
39 changes: 39 additions & 0 deletions
39
src/widgets/show-sub-emotion/ui/ShowSubEmotionContainer.styled.ts
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,39 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const Container = styled.div` | ||
// position: absolute; | ||
// width: 100%; | ||
height: 250px; | ||
background-color: #ffffff; | ||
border-radius: 10px; | ||
padding: 30px; | ||
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.13); | ||
font-size: 16px; | ||
font-weight: bold; | ||
font-family: 'Pretendard', sans-serif; | ||
`; | ||
export const EmotionsContainer = styled.div` | ||
margin-top: 60px; | ||
display: flex; | ||
flex-wrap: wrap; | ||
align-items: center; | ||
gap: 10px; | ||
`; | ||
|
||
export const EmotionContainer = styled.div` | ||
display: flex; | ||
height: 30px; | ||
// width: 100px; | ||
align-items: center; | ||
justify-content: center; | ||
background-color: #ffffff; | ||
border-radius: 10px; | ||
border: 1px solid rgba(0, 0, 0, 0.1); | ||
padding: 10px 20px; | ||
gap: 10px; | ||
font-weight: normal; | ||
font-size: 14px; | ||
`; |
33 changes: 33 additions & 0 deletions
33
src/widgets/show-sub-emotion/ui/ShowSubEmotionContainer.tsx
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 React from 'react'; | ||
import { | ||
Container, | ||
EmotionContainer, | ||
EmotionsContainer | ||
} from './ShowSubEmotionContainer.styled'; | ||
import { ShowSubEmotionContainerProps } from '../model/type'; | ||
import { EmotionIcon } from '@/shared/EmotionIcon/ui/EmotionIcon'; | ||
import { getEmotionInfo } from '@/shared/model/EmotionEnum'; | ||
|
||
export const ShowSubEmotionContainer = ({ | ||
subEmotions | ||
}: ShowSubEmotionContainerProps) => { | ||
return ( | ||
<Container> | ||
서브 감정 키워드 | ||
<EmotionsContainer> | ||
{subEmotions.map((emotion) => { | ||
return ( | ||
<EmotionContainer> | ||
<EmotionIcon | ||
emotion={emotion} | ||
width="25px" | ||
height="25px" | ||
/> | ||
{getEmotionInfo(emotion).description} | ||
</EmotionContainer> | ||
); | ||
})} | ||
</EmotionsContainer> | ||
</Container> | ||
); | ||
}; |