-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4745b55
commit 5f5d8b0
Showing
10 changed files
with
235 additions
and
15 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
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,43 @@ | ||
import dynamic from 'next/dynamic'; | ||
|
||
import { LeftArrowIcon } from '@/components/atoms'; | ||
import { HeaderBar } from '@/components/molecules'; | ||
import { css } from '@/styled-system/css'; | ||
|
||
const DynamicBackButton = dynamic( | ||
() => import('@/components/molecules').then(({ BackButton }) => BackButton), | ||
{ | ||
ssr: false, | ||
loading: () => <LeftArrowIcon />, | ||
}, | ||
); | ||
|
||
const DynamicBlockedListSection = dynamic( | ||
() => | ||
import('@/features/setting-blocked').then( | ||
({ BlockedListSection }) => BlockedListSection, | ||
), | ||
{ | ||
ssr: false, | ||
}, | ||
); | ||
|
||
export default function Blocked() { | ||
return ( | ||
<> | ||
<HeaderBar> | ||
<HeaderBar.LeftContent> | ||
<DynamicBackButton /> | ||
</HeaderBar.LeftContent> | ||
<HeaderBar.Title>์ฐจ๋จํ ๊ณ์ </HeaderBar.Title> | ||
</HeaderBar> | ||
<article className={containerStyle}> | ||
<DynamicBlockedListSection /> | ||
</article> | ||
</> | ||
); | ||
} | ||
|
||
const containerStyle = css({ | ||
pb: 'calc(70px + env(safe-area-inset-bottom))', | ||
}); |
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
106 changes: 106 additions & 0 deletions
106
components/molecules/profile-list/profile-blocked-list-item.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,106 @@ | ||
import Link from 'next/link'; | ||
|
||
import { Button } from '@/components/atoms'; | ||
import { css } from '@/styled-system/css'; | ||
import { flex } from '@/styled-system/patterns'; | ||
import { MemberProfile } from '@/types'; | ||
|
||
import { ProfileImage } from '../profile-image'; | ||
|
||
type FollowListItem = { | ||
isMyProfile?: boolean; | ||
onClick?: () => void; | ||
} & MemberProfile; | ||
export const ProfileBlockedListItem = ({ | ||
memberId, | ||
nickname, | ||
introduction, | ||
profileImageUrl, | ||
}: FollowListItem) => { | ||
const handleClickBlockedItem = () => { | ||
// TODO: api ์ฐ๋ | ||
console.log('toggle blocked!'); | ||
}; | ||
|
||
return ( | ||
<div className={containerStyle}> | ||
<Link href={`/profile/${memberId}`} className={linkStyle}> | ||
<div className={profileImageStyle}> | ||
<ProfileImage | ||
src={profileImageUrl ?? ''} | ||
alt="profile image" | ||
sizes="30vw" | ||
fill | ||
style={{ objectFit: 'cover' }} | ||
/> | ||
</div> | ||
<div className={text.wrapperStyle}> | ||
<h1 className={text.nicknameStyle}>{nickname}</h1> | ||
{introduction && <p className={text.summaryStyle}>{introduction}</p>} | ||
</div> | ||
</Link> | ||
|
||
<Button | ||
size="small" | ||
label="์ฐจ๋จ ํด์ " | ||
variant="outlined" | ||
buttonType="assistive" | ||
className={blockedButtonStyle} | ||
onClick={handleClickBlockedItem} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
const containerStyle = flex({ | ||
py: '8px', | ||
align: 'center', | ||
maxWidth: '100%', | ||
justify: 'space-between', | ||
}); | ||
|
||
const profileImageStyle = flex({ | ||
position: 'relative', | ||
width: '40px', | ||
height: '40px', | ||
align: 'center', | ||
rounded: 'full', | ||
overflow: 'hidden', | ||
flexShrink: 0, | ||
}); | ||
|
||
const linkStyle = flex({ | ||
// button, gap | ||
maxWidth: 'calc(100% - 70px - 16px)', | ||
gap: '16px', | ||
align: 'center', | ||
mr: '16px', | ||
}); | ||
|
||
const blockedButtonStyle = css({ | ||
flexShrink: 0, | ||
}); | ||
|
||
const text = { | ||
wrapperStyle: flex({ | ||
gap: '2px', | ||
direction: 'column', | ||
flexGrow: 1, | ||
overflow: 'hidden', | ||
}), | ||
|
||
nicknameStyle: css({ | ||
textStyle: 'heading6', | ||
fontWeight: 'bold', | ||
}), | ||
|
||
summaryStyle: css({ | ||
width: '100%', | ||
textStyle: 'body2.normal', | ||
fontWeight: 'regular', | ||
color: 'text.alternative', | ||
overflow: 'hidden', | ||
whiteSpace: 'nowrap', | ||
textOverflow: 'ellipsis', | ||
}), | ||
}; |
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
12 changes: 12 additions & 0 deletions
12
features/setting-blocked/components/empty-blocked-list.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,12 @@ | ||
import { css } from '@/styled-system/css'; | ||
|
||
export const EmptyBlockedList = () => { | ||
return <div className={containerStyle}>์ฐจ๋จํ ๊ณ์ ์ด ์์ด์.</div>; | ||
}; | ||
|
||
const containerStyle = css({ | ||
m: '80px auto 0px', | ||
textStyle: 'body2.normal', | ||
color: 'text.alternative', | ||
textAlign: 'center', | ||
}); |
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 * from './empty-blocked-list'; |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './sections'; | ||
export * from './types'; |
42 changes: 42 additions & 0 deletions
42
features/setting-blocked/sections/blocked-list-section.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,42 @@ | ||
'use client'; | ||
|
||
import { ProfileList } from '@/components/molecules'; | ||
import { flex } from '@/styled-system/patterns'; | ||
|
||
import { useBlockedList } from '../apis'; | ||
import { EmptyBlockedList } from '../components'; | ||
|
||
export const BlockedListSection = () => { | ||
const { | ||
flattenData, | ||
hasNextPage, | ||
isFetchingNextPage, | ||
fetchNextPage, | ||
isLoading, | ||
} = useBlockedList(); | ||
|
||
const fetchNextData = () => { | ||
if (hasNextPage && !isFetchingNextPage) { | ||
void fetchNextPage(); | ||
} | ||
}; | ||
|
||
if (flattenData.length === 0 && !isLoading) return <EmptyBlockedList />; | ||
return ( | ||
<div className={containerStyle}> | ||
<ProfileList | ||
data={flattenData} | ||
fetchNextData={fetchNextData} | ||
isLoading={isLoading} | ||
isFetchingNextPage={isFetchingNextPage} | ||
isBlockedList={true} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
const containerStyle = flex({ | ||
direction: 'column', | ||
gap: '12px', | ||
p: '16px 20px', | ||
}); |
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 * from './blocked-list-section'; |