Skip to content

Commit

Permalink
fix: avatar ui issue and store
Browse files Browse the repository at this point in the history
  • Loading branch information
SeungJL committed Aug 13, 2024
1 parent d4fe517 commit 55d3356
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 10 deletions.
3 changes: 2 additions & 1 deletion components/atoms/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,12 @@ function AvatarComponent({
};

function AvatarComponent() {

return (
<AvatarContainer size={size} sizeLength={sizeLength}>
<ImageContainer
bg={
bgImage ||
(!shadowAvatar && bgImage) ||
(shadowAvatar
? "var(--gray-500)"
: hasAvatar && avatar.bg !== null && COLOR_TABLE_LIGHT[avatar.bg])
Expand Down
2 changes: 1 addition & 1 deletion components/molecules/ContentHeartBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ function ContentHeartBar({ feedId, likeUsers, likeCnt, comments, refetch }: Cont
{commentArr.length}
</Button>
<Button size="sm" variant="ghost" mb="2px" onClick={() => handleDrawerBtn("like")}>
<AvatarGroupsOverwrap userAvatarArr={userAvatarArr} size="sm" />
<AvatarGroupsOverwrap userAvatarArr={userAvatarArr} userLength={heartProps.cnt} />
</Button>
</Flex>
{modalType === "like" && (
Expand Down
2 changes: 1 addition & 1 deletion components/molecules/UserCommentInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function UserCommentInput({
onSubmit(text);
setText("");
};
console.log("user", user);

return (
<Flex align="center" flex={1}>
{user && (
Expand Down
2 changes: 1 addition & 1 deletion components/molecules/cards/PostThumbnailCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function PostThumbnailCard({
<Subtitle>{subtitle}</Subtitle>
{participants ? (
<StatusContainer>
<AvatarGroupsOverwrap userAvatarArr={userAvatarArr} size="sm" />
<AvatarGroupsOverwrap userAvatarArr={userAvatarArr} />
<div className="statusText">
<Box fontSize="14px" color="var(--color-mint)" fontWeight={600} mr="8px" mt="4px">
{statusText}
Expand Down
10 changes: 6 additions & 4 deletions components/molecules/groups/AvatarGroupsOverwrap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import styled from "styled-components";

import { IAvatar } from "../../../types/models/userTypes/userInfoTypes";
import Avatar from "../../atoms/Avatar";
type Size = "sm";

interface IUserAvatar {
image: string;
Expand All @@ -11,11 +10,11 @@ interface IUserAvatar {

interface IAvatarGroupsOverwrap {
userAvatarArr: IUserAvatar[];
size: Size;
userLength?: number;
}
const VOTER_SHOW_MAX = 6;

export default function AvatarGroupsOverwrap({ userAvatarArr }: IAvatarGroupsOverwrap) {
export default function AvatarGroupsOverwrap({ userAvatarArr, userLength }: IAvatarGroupsOverwrap) {
return (
<Participants>
{userAvatarArr.map((att, idx) => {
Expand All @@ -27,7 +26,10 @@ export default function AvatarGroupsOverwrap({ userAvatarArr }: IAvatarGroupsOve
avatar={att.avatar}
size="sm"
isLink={false}
shadowAvatar={idx === VOTER_SHOW_MAX - 1 && userAvatarArr.length - idx}
shadowAvatar={
idx === VOTER_SHOW_MAX - 1 &&
(userLength ? userLength - VOTER_SHOW_MAX : userAvatarArr.length - idx)
}
/>
)
);
Expand Down
1 change: 1 addition & 0 deletions components/molecules/layouts/ImageTitleGridLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export default function ImageTileGridLayout({
fill={true}
alt="reviewThumbnailImage"
priority={isPriority}
style={{ objectPosition: "center", objectFit: "cover" }}
/>
</ImageContainer>
<TextContainer>{text}</TextContainer>
Expand Down
4 changes: 2 additions & 2 deletions modals/store/StoreApplyGiftModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function StoreApplyGiftModal({ setIsModal, giftInfo }: IStoreApplyGiftModal) {

const { data: userInfo } = useUserInfoQuery();
const { data: myPoint, isLoading } = usePointSystemQuery("point");
const { mutate: applyGift } = useStoreMutation({
const { mutate: applyGift, isLoading: isLoading2 } = useStoreMutation({
onSuccess() {
getPoint({ value: -totalCost, message: `${giftInfo.name} 응모` });
completeToast("free", "응모에 성공했어요! 당첨 발표일을 기다려주세요!");
Expand Down Expand Up @@ -90,10 +90,10 @@ function StoreApplyGiftModal({ setIsModal, giftInfo }: IStoreApplyGiftModal) {
main: {
text: "응모하기",
func: onApply,
isLoading: isLoading2,
},
};


return (
<ModalLayout title="상품 응모" footerOptions={footerOptions} setIsModal={setIsModal}>
<Box h="130px">
Expand Down

0 comments on commit 55d3356

Please sign in to comment.