-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
마지막 Develop
- Loading branch information
Showing
135 changed files
with
18,329 additions
and
16,172 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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,45 @@ | ||
import React from 'react'; | ||
import * as S from './styles'; | ||
import { getTimeSimple } from '../../../utils'; | ||
import { ISender, IRef } from '../../../modules/notification'; | ||
|
||
interface NotificationItemProp { | ||
sender: ISender; | ||
type: string; | ||
createdAt: number; | ||
refPost: IRef; | ||
} | ||
|
||
const NotificationItem: React.FC<NotificationItemProp> = ({ | ||
sender, type, createdAt, refPost, | ||
}) => { | ||
const getRefAddr = () => { | ||
if (type === 'works' || type === 'wallpapers') { | ||
return `/home/detail-image/${refPost._id}`; | ||
} | ||
return `/home/detail-music/${refPost._id}`; | ||
}; | ||
|
||
return ( | ||
<S.Container> | ||
<S.Thumbnail src={sender.thumbnailUrl} /> | ||
<S.ContentWrapper> | ||
<S.Content> | ||
<S.Strong to={`/creator/${sender._id}`}> | ||
{sender.name} | ||
</S.Strong> | ||
님이 새로운 | ||
<S.Strong to={getRefAddr()}> | ||
{type} | ||
</S.Strong> | ||
을 업로드 하였습니다. 지금 감상해보세요! | ||
</S.Content> | ||
<S.Time> | ||
{getTimeSimple(createdAt)} | ||
</S.Time> | ||
</S.ContentWrapper> | ||
</S.Container> | ||
); | ||
}; | ||
|
||
export default NotificationItem; |
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,36 @@ | ||
import styled from 'styled-components'; | ||
import { Link } from 'react-router-dom'; | ||
import { theme } from '../../../style/theme'; | ||
|
||
export const Container = styled.div` | ||
display: flex; | ||
padding: 1rem; | ||
border-top: 1px solid ${theme.BORDER_GRAY}; | ||
`; | ||
|
||
export const Thumbnail = styled.img` | ||
width: 2rem; | ||
border-radius: 3rem; | ||
margin: auto 1rem; | ||
margin-left: 0; | ||
`; | ||
|
||
export const ContentWrapper = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
`; | ||
|
||
export const Content = styled.div` | ||
`; | ||
|
||
export const Time = styled.span` | ||
color: ${theme.AMERICAN_RIVER}; | ||
margin: .5rem 0; | ||
`; | ||
|
||
export const Strong = styled(Link)` | ||
font-weight: ${theme.WEIGHT.STRONG}; | ||
color: black; | ||
text-decoration: none; | ||
`; |
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,32 @@ | ||
import React from 'react'; | ||
import * as S from './styles'; | ||
import { getShortId } from '../../../utils'; | ||
import { INoti } from '../../../modules/notification'; | ||
import NotificationItem from '../NotificationItem'; | ||
|
||
|
||
interface NotificationsProp{ | ||
notifications: INoti[]; | ||
} | ||
|
||
const Notifications: React.FC<NotificationsProp> = ({ | ||
notifications, | ||
}) => ( | ||
<S.Container> | ||
<S.Header> | ||
새로운 작품 | ||
</S.Header> | ||
{ | ||
notifications.map((noti:INoti) => ( | ||
<NotificationItem | ||
key={getShortId()} | ||
sender={noti.sender} | ||
type={noti.type} | ||
createdAt={noti.createdAt} | ||
refPost={noti.ref} | ||
/> | ||
)) | ||
} | ||
</S.Container> | ||
); | ||
export default Notifications; |
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,24 @@ | ||
import styled from 'styled-components'; | ||
import { theme } from '../../../style/theme'; | ||
import TextWithImg from '../../../commons/TextWithImg'; | ||
|
||
export const Container = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
width: 30rem; | ||
height: 20rem; | ||
align-items: center; | ||
`; | ||
|
||
export const Header = styled.div` | ||
display: flex; | ||
height: 3rem; | ||
width: 100%; | ||
justify-content: center; | ||
align-items: center; | ||
font-weight: ${theme.WEIGHT.STRONG}; | ||
border-bottom: 1px solid ${theme.BORDER_GRAY}; | ||
padding: 1rem 0; | ||
`; | ||
|
||
export { TextWithImg }; |
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
Oops, something went wrong.