Skip to content

Commit

Permalink
๐Ÿ› ๏ธ ์œ ์ € ์ด๋ฆ„ / ๋‹‰๋„ค์ž„ ๋ถ„๋ฆฌ (#91)
Browse files Browse the repository at this point in the history
* feat: User interface์— username ์ถ”๊ฐ€
* feat: feed์—์„œ username ์‚ฌ์šฉํ•˜๋„๋ก ์ˆ˜์ •
* feat: Profile์—์„œ username ์‚ฌ์šฉํ•˜๋„๋ก ์ˆ˜์ •

Closes #91
  • Loading branch information
Legitgoons authored Jun 5, 2024
1 parent 9c5d149 commit 915f9ed
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 39 deletions.
25 changes: 15 additions & 10 deletions src/app/mocks/consts/likeUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,49 +7,54 @@ interface Users {
export const likeUsers: Users = {
1: {
id: 2,
profileImage: 'https://picsum.photos/200/200',
profileImage: '',
name: '์ด์˜์ฐฌ',
content: 'Legitgoons',
username: 'Legitgoons',
content: '์ทจ์—…ํ•˜๊ณ ์‹ถ๋‹น',
locked: false,
feedCount: 124,
followingCount: 2,
followerCount: 5341,
},
2: {
id: 3,
profileImage: 'https://picsum.photos/200/200',
profileImage: '',
name: '์–‘์žฌ์„œ',
content: 'psychology50',
username: 'psychology50',
content: 'IMPM',
locked: true,
feedCount: 6,
followingCount: 35,
followerCount: 423,
},
3: {
id: 5,
profileImage: 'https://picsum.photos/200/200',
profileImage: 'https://picsum.photos/32/32',
name: '์‹ ์–€',
content: 'yanni13',
username: 'yanni13',
content: 'imiOSDev',
locked: true,
feedCount: 51,
followingCount: 7897,
followerCount: 7890,
},
4: {
id: 4,
profileImage: 'https://picsum.photos/200/200',
profileImage: 'https://picsum.photos/32/32',
name: '์ด์ˆ˜๋ฏผ',
content: 'SSXXMM22',
username: 'SSXXMM22',
content: 'imdesigner',
locked: true,
feedCount: 24,
followingCount: 42,
followerCount: 53251,
},
5: {
id: 7,
profileImage: 'https://picsum.photos/200/200',
profileImage: 'https://picsum.photos/32/32',
name: '์•ˆ์„ฑ์œค',
content: 'asn6878',
username: 'asn6878',
content: 'imbackend',
locked: true,
feedCount: 87,
followingCount: 67,
Expand Down
27 changes: 18 additions & 9 deletions src/app/mocks/consts/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export const users: Users = {
id: 1,
profileImage: '',
name: '๊ฐ•๋ณ‘์ค€',
content: 'bangdori',
username: 'bangdori',
content: '์Šคํƒ€ํŠธ์—…์œผ๋กœ ๊ฐ‘๋‹ˆ๋‹น',
locked: false,
feedCount: 100,
followingCount: 347,
Expand All @@ -19,7 +20,8 @@ export const users: Users = {
id: 2,
profileImage: '',
name: '์ด์˜์ฐฌ',
content: 'Legitgoons',
username: 'Legitgoons',
content: '์ทจ์—…ํ•˜๊ณ ์‹ถ๋‹น',
locked: false,
feedCount: 124,
followingCount: 2,
Expand All @@ -29,7 +31,8 @@ export const users: Users = {
id: 3,
profileImage: '',
name: '์–‘์žฌ์„œ',
content: 'psychology50',
username: '์˜ค๋Š˜๋„๋ฐค์ƒ˜',
content: 'IMPM',
locked: true,
feedCount: 6,
followingCount: 35,
Expand All @@ -39,7 +42,8 @@ export const users: Users = {
id: 4,
profileImage: 'https://picsum.photos/32/32',
name: '์ด์ˆ˜๋ฏผ',
content: 'SSXXMM22',
username: 'SSXXMM22',
content: 'imdesigner',
locked: true,
feedCount: 24,
followingCount: 42,
Expand All @@ -49,7 +53,8 @@ export const users: Users = {
id: 5,
profileImage: 'https://picsum.photos/32/32',
name: '์‹ ์–€',
content: 'yanni13',
username: 'yanni13',
content: 'imiOSDev',
locked: true,
feedCount: 51,
followingCount: 7897,
Expand All @@ -59,7 +64,8 @@ export const users: Users = {
id: 6,
profileImage: 'https://picsum.photos/32/32',
name: '์ด์ฃผ์›',
content: '2weeksone',
username: '2weeksone',
content: 'imdesignertoo',
locked: false,
feedCount: 97,
followingCount: 98,
Expand All @@ -69,7 +75,8 @@ export const users: Users = {
id: 7,
profileImage: 'https://picsum.photos/32/32',
name: '์•ˆ์„ฑ์œค',
content: 'asn6878',
username: 'asn6878',
content: 'imbackend',
locked: true,
feedCount: 87,
followingCount: 67,
Expand All @@ -79,7 +86,8 @@ export const users: Users = {
id: 8,
profileImage: 'https://picsum.photos/32/32',
name: '์ด์ง„์šฐ',
content: 'jinlee1703',
username: '๋„ค์ด๋ฒ„๋งจ',
content: 'imbackendtoo',
locked: false,
feedCount: 32,
followingCount: 24,
Expand All @@ -89,7 +97,8 @@ export const users: Users = {
id: 9,
profileImage: 'https://picsum.photos/32/32',
name: '์ตœํฌ์ง„',
content: 'heejinnn',
username: '๋ถ€์ž๊ฐ€๋ ๊ฑฐ์•ผ',
content: 'iLoveNewjeans',
locked: false,
feedCount: 66,
followingCount: 1,
Expand Down
2 changes: 1 addition & 1 deletion src/shared/consts/types/feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface FetchFeeds {

export interface Feed {
id: number;
user: Pick<User, 'id' | 'profileImage' | 'name'>;
user: Pick<User, 'id' | 'profileImage' | 'username'>;

content: string;
images: Image[];
Expand Down
13 changes: 2 additions & 11 deletions src/shared/consts/types/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export interface User {
id: number;
profileImage: string;
name: string;
username: string;
content: string;
locked: boolean;

Expand All @@ -13,17 +14,7 @@ export interface User {
export interface FetchUser {
code: string;
data: {
user: {
id: number;
profileImage: string;
name: string;
content: string;
locked: boolean;

feedCount: number;
followingCount: number;
followerCount: number;
};
user: User;
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/widgets/feed-main-list/ui/Feed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const Feed: React.FC<{ isLink: boolean; feed: FeedProps }> = ({
<header className='feed-header'>
<Profile
profileImage={user.profileImage}
name={user.name}
name={user.username}
content={calculateElapsedTime(updatedAt)}
userId={user.id}
isLink={isLink}
Expand Down
6 changes: 3 additions & 3 deletions src/widgets/profile-feed-list/ui/ProfileFeedList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const dummyFeeds: FeedProps[] = [
id: 1,
user: {
id: 1,
name: '๊น€๋ถ•์–ด๋นต',
username: '๊น€๋ถ•์–ด๋นต',
profileImage: '',
},
createdAt: '1๋ถ„ ์ „',
Expand All @@ -24,7 +24,7 @@ const dummyFeeds: FeedProps[] = [
id: 2,
user: {
id: 1,
name: '๊น€๋ถ•์–ด๋นต',
username: '๊น€๋ถ•์–ด๋นต',
profileImage: '',
},
createdAt: '1๋ถ„ ์ „',
Expand All @@ -40,7 +40,7 @@ const dummyFeeds: FeedProps[] = [
id: 3,
user: {
id: 1,
name: '๊น€๋ถ•์–ด๋นต',
username: '๊น€๋ถ•์–ด๋นต',
profileImage: '',
},
createdAt: '1๋ถ„ ์ „',
Expand Down
14 changes: 10 additions & 4 deletions src/widgets/profile-user/ui/ProfileUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@ export const ProfileUser = ({ userId, isOwner }: ProfileUserProps) => {
return <NetworkError refetch={refetchUser} />;
}

const { profileImage, name, feedCount, followerCount, followingCount } =
data.data.user;
const {
profileImage,
name,
username,
feedCount,
followerCount,
followingCount,
} = data.data.user;

return (
<>
Expand All @@ -38,10 +44,10 @@ export const ProfileUser = ({ userId, isOwner }: ProfileUserProps) => {
<section className='profile-top-container'>
<ProfileUserImage
profileImage={profileImage}
name={name}
name={username}
isOwner={isOwner}
/>
<h3 className='user-name h3semi'>{name}</h3>
<h3 className='user-name h3semi'>{username}</h3>
{isOwner ? (
<button className='nickname-change-btn b2md'>๋‹‰๋„ค์ž„ ์ˆ˜์ •</button>
) : (
Expand Down

0 comments on commit 915f9ed

Please sign in to comment.