diff --git a/components/Icons/CircleIcons.tsx b/components/Icons/CircleIcons.tsx index 27f49f4b..53ce337e 100644 --- a/components/Icons/CircleIcons.tsx +++ b/components/Icons/CircleIcons.tsx @@ -21,7 +21,13 @@ export function CheckCircleIcon({ fillRule="evenodd" clipRule="evenodd" d="M8.6035 5.1075L5.812 7.8995C5.71796 7.9929 5.59079 8.04532 5.45825 8.04532C5.32571 8.04532 5.19854 7.9929 5.1045 7.8995L3.3965 6.1915C3.35008 6.14508 3.31325 6.08997 3.28813 6.02931C3.26301 5.96866 3.25008 5.90365 3.25008 5.838C3.25008 5.70541 3.30275 5.57825 3.3965 5.4845C3.49025 5.39075 3.61741 5.33808 3.75 5.33808C3.88259 5.33808 4.00975 5.39075 4.1035 5.4845L5.458 6.839L7.8965 4.4005C7.94292 4.35408 7.99803 4.31725 8.05869 4.29213C8.11934 4.26701 8.18435 4.25408 8.25 4.25408C8.31565 4.25408 8.38066 4.26701 8.44131 4.29213C8.50197 4.31725 8.55708 4.35408 8.6035 4.4005C8.64992 4.44692 8.68675 4.50203 8.71187 4.56269C8.73699 4.62334 8.74992 4.68835 8.74992 4.754C8.74992 4.81965 8.73699 4.88466 8.71187 4.94531C8.68675 5.00597 8.64992 5.06108 8.6035 5.1075ZM6 0.5C2.9625 0.5 0.5 2.9625 0.5 6C0.5 9.0375 2.9625 11.5 6 11.5C9.0375 11.5 11.5 9.0375 11.5 6C11.5 2.9625 9.0375 0.5 6 0.5Z" - fill="white" + fill={ + color === "mint" + ? "var(--color-mint)" + : color === "gray" + ? "var(--gray-300)" + : "white" + } /> diff --git a/components/Icons/MathIcons.tsx b/components/Icons/MathIcons.tsx index 95599251..19084502 100644 --- a/components/Icons/MathIcons.tsx +++ b/components/Icons/MathIcons.tsx @@ -1,11 +1,20 @@ -export function PlusIcon() { - return ( - +export function PlusIcon({ color, size }: { color: "white" | "mint"; size: "sm" | "md" }) { + return size === "sm" ? ( + + + ) : ( + + ); diff --git a/components/atoms/Select.tsx b/components/atoms/Select.tsx index 68b20b3b..19cd19ac 100644 --- a/components/atoms/Select.tsx +++ b/components/atoms/Select.tsx @@ -13,7 +13,7 @@ interface ISelect { setValue: DispatchType | DispatchType; isBorder?: boolean; type?: "location"; - size: "sm" | "md" | "lg"; + size: "xs" | "sm" | "md" | "lg"; isEllipse?: boolean; isFullSize?: boolean; isActive?: boolean; @@ -26,7 +26,7 @@ export default function Select({ setValue: setParentValue, isBorder = true, type, - size = "sm", + size, isFullSize, isEllipse = true, isActive = true, @@ -53,7 +53,7 @@ export default function Select({ const adjustWidth = () => { if (selectRef.current) { const textLength = selectRef.current.selectedOptions[0].text.length; - const addSize = size === "sm" ? 44 : size === "md" ? 60 : 0; + const addSize = size === "xs" ? 44 : size === "sm" ? 48 : size === "md" ? 60 : 0; selectRef.current.style.width = `${textLength * 6.5 + addSize}px`; } }; @@ -64,8 +64,9 @@ export default function Select({ @@ -75,34 +76,61 @@ export default function Select({ } ref={selectRef} focusBorderColor="#00c2b3" - size={size === "sm" ? "xs" : size === "md" ? "md" : "lg"} + size={size} color="primary" value={value} onChange={onChange} borderRadius={ - !isEllipse ? undefined : size === "sm" ? "9999px" : size === "md" ? "20px" : "12px" + !isEllipse + ? undefined + : size === "xs" + ? "9999px" + : size === "sm" + ? "8px" + : size === "md" + ? "20px" + : "12px" } border={!isBorder ? "none" : undefined} borderColor="var(--gray-200)" bgColor="white" fontSize={ - size === "sm" && !isBorder ? "12px" : size === "sm" || size === "md" ? "11px" : "13px" + size === "sm" + ? "12px" + : size === "xs" && !isBorder + ? "12px" + : size === "xs" || size === "md" + ? "11px" + : "13px" } outline={size === "md" ? "1px solid var(--gray-100)" : undefined} - fontWeight={size === "sm" ? 500 : isThick ? 600 : 500} + fontWeight={isThick ? 600 : 500} isDisabled={!isActive} - height={size === "sm" ? (isBorder ? "24px" : "16px") : size === "md" ? "32px" : "52px"} + height={ + size === "xs" + ? isBorder + ? "24px" + : "16px" + : size === "sm" + ? "28px" + : size === "md" + ? "32px" + : "52px" + } width={!isFullSize ? "max-content" : "100%"} - mr={size === "sm" && !isBorder && "-6px"} + mr={size === "xs" && !isBorder && "-6px"} sx={{ paddingInlineStart: !isEllipse ? "12px" - : size === "sm" + : size === "xs" ? "8px" + : size === "sm" + ? "12px" : size === "md" ? "16px" : "20px", // padding-left - paddingInlineEnd: !isEllipse ? "16px" : "20px", // padding-right (아이콘 오른쪽에 여유 공간) + paddingInlineEnd: size === "sm" ? "4px" : !isEllipse ? "16px" : "20px", // padding-right (아이콘 오른쪽에 여유 공간) + paddingBottom: 0, }} _focus={{ outline: isBorder ? "var(--border)" : "none", diff --git a/components/layouts/Header.tsx b/components/layouts/Header.tsx index eccf6eb7..86678af8 100644 --- a/components/layouts/Header.tsx +++ b/components/layouts/Header.tsx @@ -44,8 +44,11 @@ export default function Header({ )} - {isCenter && {title}} - {isCenter && !children && } + {isCenter && ( + + {title} + + )}
{children}
); @@ -82,10 +85,3 @@ const HeaderContainer = styled.header<{ max-width: var(--max-width); margin: 0 auto; `; - -const CenterTitle = styled.div` - flex: 1; - font-weight: "bold"; - color: var(--gray-800); /* text-gray-1 - 색상은 예시입니다 */ - text-align: center; -`; diff --git a/components/molecules/ButtonsRow.tsx b/components/molecules/ButtonsRow.tsx new file mode 100644 index 00000000..a9d05dba --- /dev/null +++ b/components/molecules/ButtonsRow.tsx @@ -0,0 +1,15 @@ + +interface ButtonsRowProps{ + +} + +function ButtonsRow({}:ButtonsRowProps){ + + return( + <> + + + ); +} + +export default ButtonsRow diff --git a/components/molecules/cards/GroupThumbnailCard.tsx b/components/molecules/cards/GroupThumbnailCard.tsx new file mode 100644 index 00000000..27b3dbeb --- /dev/null +++ b/components/molecules/cards/GroupThumbnailCard.tsx @@ -0,0 +1,174 @@ +import { Badge, Box, Flex } from "@chakra-ui/react"; +import Image from "next/image"; +import Link from "next/link"; +import { ComponentProps } from "react"; +import styled from "styled-components"; +import { ABOUT_USER_SUMMARY } from "../../../constants/serviceConstants/userConstants"; +import { SingleLineText } from "../../../styles/layout/components"; +import { + GroupParicipantProps, + GroupStatus, + IGroupWritingCategory, +} from "../../../types/models/groupTypes/group"; +import { IUserSummary } from "../../../types/models/userTypes/userInfoTypes"; + +import { UserIcon } from "../../Icons/UserIcons"; +import AvatarGroupsOverwrap from "../groups/AvatarGroupsOverwrap"; + +const VOTER_SHOW_MAX = 4; +export interface GroupThumbnailCardProps { + title: string; + text: string; + status: "pending" | "end"; + category: IGroupWritingCategory; + + participants: (GroupParicipantProps | IUserSummary)[]; + imageProps: { + image: string; + isPriority?: boolean; + }; + maxCnt: number; + id: number; +} + +const STATUS_TO_BADGE_PROPS: Record = { + open: { text: "모집 마감", colorScheme: "red" }, + close: { text: "취소", colorScheme: "gray" }, + pending: { text: "모집중", colorScheme: "mint" }, + end: { text: "종료", colorScheme: "gray" }, +}; + +export function GroupThumbnailCard({ + participants, + title, + status, + text, + category, + + imageProps, + id, + maxCnt, +}: GroupThumbnailCardProps) { + const userAvatarArr = participants + ?.filter((par) => par) + .map((par) => + par.user + ? { + image: par.user?.profileImage, + ...(par.user.avatar?.type !== null ? { avatar: par.user.avatar } : {}), + } + : { image: ABOUT_USER_SUMMARY.profileImage }, + ); + + return ( + + + + + + + {category.main} + + + ・ + + + {category.sub} + + + + + {STATUS_TO_BADGE_PROPS[status].text} + + + {title} + {text} + + + + + + + = maxCnt + ? "var(--color-red)" + : "var(--color-gray)" + } + > + {participants.length} + + + / + + + {maxCnt === 0 ? : maxCnt} + + + + + + + ); +} + +type PlaceImageProps = Omit, "alt" | "sizes" | "fill">; + +function PlaceImage(props: PlaceImageProps) { + return ( + + thumbnailImage + + ); +} + +const CardLink = styled(Link)` + height: fit-content; + display: flex; + + border-radius: 12px; + background-color: white; + justify-content: space-between; + + &:hover { + background-color: var(--gray-200); + } + + &:not(:last-of-type) { + margin-bottom: 16px; + } +`; + +const Title = styled(SingleLineText)` + font-weight: 700; + font-size: 16px; + margin-bottom: 4px; + line-height: 24px; + color: var(--gray-800); +`; + +const Subtitle = styled(SingleLineText)` + color: var(--gray-500); + font-size: 12px; + font-weight: regular; + line-height: 18px; + margin-bottom: 12px; +`; diff --git a/components/molecules/groups/ButtonGroups.tsx b/components/molecules/groups/ButtonGroups.tsx index f687a4a5..843aaeb2 100644 --- a/components/molecules/groups/ButtonGroups.tsx +++ b/components/molecules/groups/ButtonGroups.tsx @@ -37,14 +37,21 @@ export default function ButtonGroups({ + + 모임 만들기 + + + + {myGroups?.length ? ( - + ) : ( 가입중인 소모임이 없습니다. )} - + ); } diff --git a/pageTemplates/studyPage/studyPageDrawer/StudyPageDrawerFilterBar.tsx b/pageTemplates/studyPage/studyPageDrawer/StudyPageDrawerFilterBar.tsx index ca21908b..04c0edcf 100644 --- a/pageTemplates/studyPage/studyPageDrawer/StudyPageDrawerFilterBar.tsx +++ b/pageTemplates/studyPage/studyPageDrawer/StudyPageDrawerFilterBar.tsx @@ -25,7 +25,7 @@ function StudyPageDrawerFilterBar({ + + + + - - - - - + ({ + icon: ( + + ), + text: prop, + func: () => setCategory((old) => ({ ...old, sub: prop })), + }))} + currentValue={category.sub} + isEllipse + size="md" + /> + {/* setCategory((old) => ({ ...old, sub: value }))} - /> - + /> */} + + )} {!groupStudies.length && isLoading ? ( ) : ( - + {groupStudies ?.slice() ?.reverse() - ?.map((group) => ( - + ?.map((group, idx) => ( + + + group.isSecret ? ABOUT_USER_SUMMARY : user, + )} + imageProps={{ image: group.image, isPriority: idx < 4 }} + maxCnt={group.memberCnt.max} + id={group.id} + /> + ))} )} @@ -202,14 +242,13 @@ function GroupPage() { ) : undefined} - ); } const Layout = styled.div` min-height: 100vh; - background-color: var(--gray-100); + padding-bottom: 60px; `; diff --git a/theme.ts b/theme.ts index bfa01964..f92f08a3 100644 --- a/theme.ts +++ b/theme.ts @@ -253,8 +253,9 @@ const theme = extendTheme({ px: "8px !important", py: "2px", h: "20px", - fontWeight: 700, + fontWeight: "bold", fontSize: "11px", + borderRadius: "4px", }, },