Skip to content

Commit

Permalink
perf
Browse files Browse the repository at this point in the history
  • Loading branch information
SeungJL committed Nov 16, 2024
1 parent 6db94b6 commit c30e2f4
Show file tree
Hide file tree
Showing 36 changed files with 139 additions and 390 deletions.
6 changes: 4 additions & 2 deletions components/atoms/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ interface IAvatar {
sizeLength?: number;
avatar?: IAvatarProp;
uid?: string;
userId?: string;
isPriority?: boolean;
shadowAvatar?: number;
isLink?: boolean;
Expand All @@ -28,6 +29,7 @@ function AvatarComponent({
avatar,
uid,
isPriority,
userId,
shadowAvatar,
isLink = true,
}: IAvatar) {
Expand Down Expand Up @@ -128,12 +130,12 @@ function AvatarComponent({

return (
<>
{!isLink ? (
{!isLink || !userId ? (
<Box>
<AvatarComponent />
</Box>
) : (
<Link href={`/profile/${uid}`} style={{ outline: "none" }}>
<Link href={`/profile/${userId}`} style={{ outline: "none" }}>
<AvatarComponent />
</Link>
)}
Expand Down
2 changes: 1 addition & 1 deletion components/atoms/BasicAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function BasicAvatar() {

return (
<Box onClick={onClick}>
<Avatar image="" avatar={{ type: 0, bg: 9 }} size="md" isLink={false} />
<Avatar image="" avatar={{ type: 0, bg: 9 }} size="md" isLink={false} />
</Box>
);
}
Expand Down
2 changes: 1 addition & 1 deletion components/atoms/InfoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function InfoCard({
return (
<CardContainer>
{leftComponent && <Box mr="16px">{leftComponent}</Box>}
<Avatar image={image} size="md" isLink={isLink} />
<Avatar image={image} size="md" isLink={isLink} />
<UserInfoContainer>
<UserNameBadgeContainer>
<span>{name}</span>
Expand Down
1 change: 1 addition & 0 deletions components/molecules/OrganizerBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ function OrganizerBar({ organizer, createdAt, children, isAdminOpen }: Organizer
<AboutIcon size="md" />
) : (
<Avatar
userId={organizer._id}
avatar={organizer.avatar}
uid={organizer.uid}
image={organizer.profileImage}
Expand Down
8 changes: 7 additions & 1 deletion components/molecules/ProfileDetailBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,13 @@ function ProfileDetailBlock({ user, attendInfo }: ProfileDetailBlockProps) {
pr={2}
borderRight="var(--border-main)"
>
<Avatar uid={user.uid} avatar={user?.avatar} image={user.profileImage} size="md" />
<Avatar
userId={user._id}
uid={user.uid}
avatar={user?.avatar}
image={user.profileImage}
size="md"
/>
<Box>{user.name}</Box>
</Flex>
<Flex direction="column" flex={1}>
Expand Down
1 change: 1 addition & 0 deletions components/molecules/UserComment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ function UserComment({
<Flex justify="center" alignSelf="flex-start" mr={2}>
<Avatar
size="mds"
userId={user._id}
avatar={user.avatar}
image={user.profileImage}
uid={user.uid}
Expand Down
1 change: 1 addition & 0 deletions components/molecules/UserCommentInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ function UserCommentInput({
<Avatar
isLink={false}
size="mds"
userId={user._id}
uid={user.uid}
avatar={user.avatar}
image={user.profileImage}
Expand Down
8 changes: 7 additions & 1 deletion components/molecules/UserItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ export function UserItem({ user, children }: IUserItem) {
};
return (
<MemberItem key={user.uid} onClick={() => onClickProfile(user)}>
<Avatar image={user.profileImage} avatar={user.avatar} uid={user.uid} size="sm" />
<Avatar
userId={user._id}
image={user.profileImage}
avatar={user.avatar}
uid={user.uid}
size="sm"
/>
<UserOverview>
<span>{user?.name}</span>
<div>{user.comment}</div>
Expand Down
8 changes: 7 additions & 1 deletion components/molecules/cards/ProfileCommentCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ export default function ProfileCommentCard({
<Flex py={3} align="center" borderBottom="var(--border)">
{leftComponent && <Box mr="16px">{leftComponent}</Box>}
{user ? (
<Avatar image={user.profileImage} size="md" avatar={user.avatar} uid={user.uid} />
<Avatar
userId={user._id}
image={user.profileImage}
size="md"
avatar={user.avatar}
uid={user.uid}
/>
) : (
<BasicAvatar />
)}
Expand Down
8 changes: 7 additions & 1 deletion components/molecules/groups/InviteUserGroups.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ export default function InviteUserGroups({ users, inviteUser }: IInviteUserGroup
<Grid mt="20px" templateColumns="repeat(3,1fr)" gap="12px">
{users?.map((who, idx) => (
<Flex key={idx} justify="center" align="center">
<Avatar image={who.profileImage} avatar={who.avatar} uid={who.uid} size="md" />
<Avatar
userId={who._id}
image={who.profileImage}
avatar={who.avatar}
uid={who.uid}
size="md"
/>
<Flex direction="column" ml="8px">
<Box>{who.name}</Box>
<Button colorScheme="mint" size="xs" onClick={() => inviteUser(who)}>
Expand Down
8 changes: 7 additions & 1 deletion components/molecules/headers/FeedHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ function FeedHeader({ writer = ABOUT_USER_SUMMARY, date }: IFeedHeader) {
return (
<Layout>
<Profile>
<Avatar image={writer?.profileImage} avatar={writer?.avatar} uid={writer?.uid} size="smd" />
<Avatar
userId={writer._id}
image={writer?.profileImage}
avatar={writer?.avatar}
uid={writer?.uid}
size="smd"
/>
<div>
<Writer>{writer.name}</Writer>
<span>{date}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ function ImageSliderMember({ imageContainer }: IImageSliderMember) {
<SwiperSlide key={index}>
<MemberItem>
<ProfileWrapper onClick={() => onClickUser(user)}>
<Avatar image={user.profileImage} avatar={user.avatar} uid={user.uid} size="sm" />
<Avatar
userId={user._id}
image={user.profileImage}
avatar={user.avatar}
uid={user.uid}
size="sm"
/>
</ProfileWrapper>
<span>{user?.name}</span>
{isBirth && (
Expand Down
97 changes: 0 additions & 97 deletions design/attendance/AttendanceBar.tsx

This file was deleted.

Loading

0 comments on commit c30e2f4

Please sign in to comment.