Skip to content

Commit

Permalink
✨ 게시물 숨기기 UI (#68)
Browse files Browse the repository at this point in the history
* feat: 민트색 체크 아이콘 추가
* feat: 피드 숨김처리 UI
* feat: 메시지 props로 수정
* feat: 구분선 표시
* feat: React import 제거

Closes #PW-327
  • Loading branch information
BangDori authored May 16, 2024
1 parent 7932529 commit 2ae83e8
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 4 deletions.
10 changes: 10 additions & 0 deletions public/assets/sprites/common.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/shared/ui/icon/consts/sprite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ export type IconName =
| 'checkbox-circle_off'
| 'checkbox-circle_on'
| 'checkbox-square_on'
| 'checkbox-square_off';
| 'checkbox-square_off'
| 'check_mint';
13 changes: 10 additions & 3 deletions src/widgets/feed-main-list/ui/FeedMainList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ import { NetworkError, Observer } from '@/shared/ui';
import { useInfinityFeeds } from '../api';

import { Feed } from './Feed';
import HiddenFeed from './HiddenFeed';
import { SkeletonFeedMainList } from './SkeletonFeedMainList';
import './FeedMainList.scss';

const hiddenFeedId = 2;

export const FeedMainList = () => {
const {
feeds,
Expand All @@ -30,9 +33,13 @@ export const FeedMainList = () => {
<section className='feed-list-section'>
<div className='feed-list'>
{feeds?.pages.map((pageData) => {
return pageData.data.feeds.map((feed) => (
<Feed key={feed.id} feed={feed} />
));
return pageData.data.feeds.map((feed) =>
hiddenFeedId === feed.id ? (
<HiddenFeed message='게시물이 숨겨졌어요' />
) : (
<Feed key={feed.id} feed={feed} />
),
);
})}
{!isFetching && (
<Observer
Expand Down
33 changes: 33 additions & 0 deletions src/widgets/feed-main-list/ui/HiddenFeed.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.feed-hidden-wrapper {
margin-top: 30px;

.feed-hidden-container {
display: flex;
flex-direction: column;
align-items: center;

.hidden-reason-msg {
margin-top: 8px;
color: $gray4;
}

.hidden-cancel-btn {
margin-top: 16px;
width: 39px;
height: 24px;

border-radius: 30px;

background-color: $gray2;
color: $gray4;
}
}

&::after {
content: '';
display: block;
height: 0.5px;
background-color: $gray2;
margin: 36px 0 14px;
}
}
16 changes: 16 additions & 0 deletions src/widgets/feed-main-list/ui/HiddenFeed.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Icon } from '@/shared/ui';
import './HiddenFeed.scss';

const HiddenFeed: React.FC<{ message: string }> = ({ message }) => {
return (
<div className='feed-hidden-wrapper'>
<div className='feed-hidden-container'>
<Icon name='check_mint' width='24' height='24' />
<p className='hidden-reason-msg b2md'>{message}</p>
<button className='hidden-cancel-btn b2md'>취소</button>
</div>
</div>
);
};

export default HiddenFeed;

0 comments on commit 2ae83e8

Please sign in to comment.