diff --git a/frontend/src/components/Button/Button.tsx b/frontend/src/components/Button/Button.tsx index 00135be0b..156a4d1a0 100644 --- a/frontend/src/components/Button/Button.tsx +++ b/frontend/src/components/Button/Button.tsx @@ -1,3 +1,4 @@ +import { HTMLAttributes, ReactNode } from 'react'; import { Interpolation, SerializedStyles, @@ -5,10 +6,9 @@ import { useTheme, } from '@emotion/react'; -import { ReactNode } from 'react'; import { shapes } from '@_components/Button/Button.style'; -export interface ButtonProps { +export interface ButtonProps extends HTMLAttributes { shape: 'circle' | 'bar'; onClick?: () => void; disabled?: boolean; @@ -22,13 +22,14 @@ export interface ButtonProps { } export default function Button(props: ButtonProps) { - const { onClick, disabled, children, font } = props; + const { onClick, disabled, children, font, ...restProps } = props; const theme = useTheme(); return ( diff --git a/frontend/src/components/Input/MessagInput/MessageInput.tsx b/frontend/src/components/Input/MessagInput/MessageInput.tsx index 2aa20539a..67e926e12 100644 --- a/frontend/src/components/Input/MessagInput/MessageInput.tsx +++ b/frontend/src/components/Input/MessagInput/MessageInput.tsx @@ -1,8 +1,8 @@ import * as S from '@_components/Input/MessagInput/MessageInput.style'; -import { useTheme } from '@emotion/react'; -import { useState } from 'react'; import SubmitButton from '@_common/assets/submit_message_button.svg'; +import { useState } from 'react'; +import { useTheme } from '@emotion/react'; export interface MessageInputProps { placeHolder: string; @@ -36,6 +36,7 @@ export default function MessageInput(props: MessageInputProps) { css={S.button({ theme })} type="submit" disabled={!message.trim() || disabled} + aria-label={`댓글쓰기 버튼 ${!message.trim() || disabled ? '댓글을 작성하여 버튼을 활성화하세요' : ''}`} > diff --git a/frontend/src/components/KebabMenu/KebabMenu.tsx b/frontend/src/components/KebabMenu/KebabMenu.tsx index 701a69f51..2df2bfbeb 100644 --- a/frontend/src/components/KebabMenu/KebabMenu.tsx +++ b/frontend/src/components/KebabMenu/KebabMenu.tsx @@ -1,5 +1,7 @@ import * as S from '@_components/KebabMenu/KebabMenu.style'; -import { useRef, useState, FocusEvent } from 'react'; + +import { FocusEvent, useRef, useState } from 'react'; + import KebabButton from '@_common/assets/kebab_menu.svg'; import { useTheme } from '@emotion/react'; @@ -35,7 +37,12 @@ export default function KebabMenu(props: KebabMenuProps) { return (
- {isKebabOpen && ( @@ -43,6 +50,7 @@ export default function KebabMenu(props: KebabMenuProps) { {options.map((option) => { return ( - ) : moim?.status === 'CANCELED' ? ( - - ) : ( - - ) - ) : role === 'NON_MOIMEE' ? ( - moim?.status === 'MOIMING' ? ( - - ) : moim?.status === 'COMPLETED' ? ( - - ) : ( - - ) - ) : moim?.status === 'MOIMING' ? ( - - ) : ( - - ); - }, [ - completeMoim, - isPendingCompleteMoim, - isPendingJoinMoim, - isPendingOpenChat, - moim?.status, - moimId, - navigate, - mutate, - openChat, - role, - isChamyoMineLoading, - ]); + const buttonClickHandler = (moim: MoimInfo, role: Role) => { + if (moim.status === 'CANCELED') return; + + if (role === 'MOIMER') { + if (moim.status === 'MOIMING') return completeMoim(moimId); + if (moim.status === 'COMPLETED') return openChat(moimId); + return; + } + if (role === 'NON_MOIMEE') { + if (moim.status === 'MOIMING') return joinMoim(moimId); + if (moim.status === 'COMPLETED') return; + return; + } + if (role === 'MOIMEE') { + if (moim.status === 'MOIMING') return; + if (moim.status === 'COMPLETED') + return navigate(GET_ROUTES.nowDarakbang.chattingRoom(moimId)); + return; + } + return; + }; + return ( - navigate(GET_ROUTES.nowDarakbang.main())} - /> + > + +
{isZzimMineLoading && ( @@ -194,6 +210,8 @@ export default function MoimDetailPage() { )} {!isZzimMineLoading && ( changZzim(moimId)} /> @@ -241,7 +259,16 @@ export default function MoimDetailPage() { )} - {button} + {moim && role && ( + + )} ); diff --git a/frontend/src/pages/Moim/MoimDetailPage/components/CommentList/CommentCard/CommentCard.style.ts b/frontend/src/pages/Moim/MoimDetailPage/components/CommentList/CommentCard/CommentCard.style.ts index d464b8e48..731bd566f 100644 --- a/frontend/src/pages/Moim/MoimDetailPage/components/CommentList/CommentCard/CommentCard.style.ts +++ b/frontend/src/pages/Moim/MoimDetailPage/components/CommentList/CommentCard/CommentCard.style.ts @@ -1,4 +1,4 @@ -import { css, Theme } from '@emotion/react'; +import { Theme, css } from '@emotion/react'; export const commentContainer = () => css` display: flex; @@ -26,20 +26,22 @@ export const profileImage = () => css` export const commnetBox = () => css` display: flex; - flex-direction: column; + flex-direction: row; + align-items: flex-start; + justify-content: space-between; + width: 100%; margin-left: 1rem; `; -export const commnetHeader = () => css` +export const commentLeft = () => css` display: flex; + flex-direction: column; gap: 5px; align-items: flex-start; justify-content: space-between; - - width: 100%; `; -export const commentHeaderLeft = () => css` +export const commentLeftHeader = () => css` display: flex; gap: 0.7rem; align-items: flex-start; diff --git a/frontend/src/pages/Moim/MoimDetailPage/components/CommentList/CommentCard/CommentCard.tsx b/frontend/src/pages/Moim/MoimDetailPage/components/CommentList/CommentCard/CommentCard.tsx index 09d2b1509..64f86ccf1 100644 --- a/frontend/src/pages/Moim/MoimDetailPage/components/CommentList/CommentCard/CommentCard.tsx +++ b/frontend/src/pages/Moim/MoimDetailPage/components/CommentList/CommentCard/CommentCard.tsx @@ -1,10 +1,12 @@ import * as S from './CommentCard.style'; +import { formatHhmmToKorean, formatYyyymmddToKorean } from '@_utils/formatters'; + import { Comment } from '@_types/index'; import { HTMLProps } from 'react'; -import { useTheme } from '@emotion/react'; import ProfileFrame from '@_components/ProfileFrame/ProfileFrame'; import useNicknameWidthEffect from '@_hooks/useNicknameWidthEffect'; +import { useTheme } from '@emotion/react'; export interface CommentCardProps extends HTMLProps { comment: Comment; @@ -12,6 +14,13 @@ export interface CommentCardProps extends HTMLProps { isChecked?: boolean; isChild?: boolean; } +const getDateTimeAriaLabel = (string: string) => { + const [date, time] = string.split(' '); + const dateLabel = formatYyyymmddToKorean(date, '-', true); + const timeLabel = formatHhmmToKorean(time, ':'); + + return `${dateLabel} ${timeLabel}`; +}; export default function CommentCard(props: CommentCardProps) { const { @@ -29,30 +38,46 @@ export default function CommentCard(props: CommentCardProps) { const theme = useTheme(); return ( -
-
- +
    +
  • +
    -
    -
    +
    +
    {formattedNickname}
    -
    {dateTime}
    -
    - {!isChild && ( -
    - +
    + {dateTime}
    - )} +
    +
    + {content} +
    -
    {content}
    + {!isChild && ( +
    + +
    + )}
    -
    +
  • {children && (
    {children.map((childComment) => ( @@ -64,6 +89,6 @@ export default function CommentCard(props: CommentCardProps) { ))}
    )} -
+ ); } diff --git a/frontend/src/pages/Moim/MoimDetailPage/components/CommentList/CommentCard/CommentCardSkeleton.tsx b/frontend/src/pages/Moim/MoimDetailPage/components/CommentList/CommentCard/CommentCardSkeleton.tsx index 77f0128f4..558d5959a 100644 --- a/frontend/src/pages/Moim/MoimDetailPage/components/CommentList/CommentCard/CommentCardSkeleton.tsx +++ b/frontend/src/pages/Moim/MoimDetailPage/components/CommentList/CommentCard/CommentCardSkeleton.tsx @@ -11,8 +11,8 @@ export default function CommentCardSkeleton() {
-
-
+
+
diff --git a/frontend/src/pages/Moim/MoimDetailPage/components/MoimDescription/MoimDescription.tsx b/frontend/src/pages/Moim/MoimDetailPage/components/MoimDescription/MoimDescription.tsx index 375af85cc..ca039de24 100644 --- a/frontend/src/pages/Moim/MoimDetailPage/components/MoimDescription/MoimDescription.tsx +++ b/frontend/src/pages/Moim/MoimDetailPage/components/MoimDescription/MoimDescription.tsx @@ -1,5 +1,6 @@ -import { ReactNode } from 'react'; import * as S from './MoimDescription.style'; + +import { ReactNode } from 'react'; import { useTheme } from '@emotion/react'; interface MoimDescriptionProps { @@ -18,8 +19,15 @@ export default function MoimDescription(props: MoimDescriptionProps) { return (
-

{title}

-
{children}
+

+ {title} +

+
+ {children} +
); } diff --git a/frontend/src/pages/Moim/MoimDetailPage/components/MoimInformation/MoimInformation.tsx b/frontend/src/pages/Moim/MoimDetailPage/components/MoimInformation/MoimInformation.tsx index 52c927bf7..0ee015198 100644 --- a/frontend/src/pages/Moim/MoimDetailPage/components/MoimInformation/MoimInformation.tsx +++ b/frontend/src/pages/Moim/MoimDetailPage/components/MoimInformation/MoimInformation.tsx @@ -17,39 +17,45 @@ export default function MoimInformation(props: MoimInformationProps) { const theme = useTheme(); return ( -
-

모임 정보

+
+

+ 모임 정보 +

{date && (
- 날짜 - {formatYyyymmddToKorean(date)} + 날짜 + + {formatYyyymmddToKorean(date)} +
)} {time && (
- 시간 - {formatHhmmToKorean(time)} + 시간 + + {formatHhmmToKorean(time)} +
)} {place && (
- 장소 - {place} + 장소 + {place}
)}
- 최대 인원 - {maxPeople}명 + 최대 인원 + {maxPeople}명
- 현재 참여 인원 - {currentPeople}명 + 현재 참여 인원 + {currentPeople}명
-
+ ); } diff --git a/frontend/src/pages/Moim/MoimDetailPage/components/MoimSummary/MoimSummary.tsx b/frontend/src/pages/Moim/MoimDetailPage/components/MoimSummary/MoimSummary.tsx index 8e4617797..42731e6f8 100644 --- a/frontend/src/pages/Moim/MoimDetailPage/components/MoimSummary/MoimSummary.tsx +++ b/frontend/src/pages/Moim/MoimDetailPage/components/MoimSummary/MoimSummary.tsx @@ -1,12 +1,21 @@ -import { MoimInfo } from '@_types/index'; import * as S from './MoimSummary.style'; -import { useTheme } from '@emotion/react'; + +import { MoimInfo, MoimStatus } from '@_types/index'; + import Tag from '@_pages/Moim/MoimDetailPage/components/Tag/Tag'; +import { useTheme } from '@emotion/react'; interface MoimSummaryProps { moimInfo: Pick; } +const getStatusKoKR = (status: MoimStatus) => { + if (status === 'CANCELED') return '모임 취소'; + if (status === 'COMPLETED') return '모집 완료'; + if (status === 'MOIMING') return '모임 중'; + return ''; +}; + export default function MoimSummary(props: MoimSummaryProps) { const theme = useTheme(); const { @@ -16,8 +25,13 @@ export default function MoimSummary(props: MoimSummaryProps) { return (
-

{title}

- +

+ {title} +

+
); diff --git a/frontend/src/pages/Moim/MoimDetailPage/components/ProfileList/ProfileCard/ProfileCard.tsx b/frontend/src/pages/Moim/MoimDetailPage/components/ProfileList/ProfileCard/ProfileCard.tsx index cd2344dec..6af542f51 100644 --- a/frontend/src/pages/Moim/MoimDetailPage/components/ProfileList/ProfileCard/ProfileCard.tsx +++ b/frontend/src/pages/Moim/MoimDetailPage/components/ProfileList/ProfileCard/ProfileCard.tsx @@ -1,8 +1,9 @@ import * as S from './ProfileCard.style'; -import { useTheme } from '@emotion/react'; + import { Participation } from '@_types/index'; import ProfileFrame from '../../../../../../components/ProfileFrame/ProfileFrame'; import useNicknameWidthEffect from '@_hooks/useNicknameWidthEffect'; +import { useTheme } from '@emotion/react'; interface ProfileCardProps { info: Participation; @@ -18,11 +19,17 @@ export default function ProfileCard(props: ProfileCardProps) { const theme = useTheme(); return ( -
- -
+
  • + +
    {formattedNickname}
    -
  • + ); } diff --git a/frontend/src/pages/Moim/MoimDetailPage/components/ProfileList/ProfileList.tsx b/frontend/src/pages/Moim/MoimDetailPage/components/ProfileList/ProfileList.tsx index 0e95eb118..40d011d74 100644 --- a/frontend/src/pages/Moim/MoimDetailPage/components/ProfileList/ProfileList.tsx +++ b/frontend/src/pages/Moim/MoimDetailPage/components/ProfileList/ProfileList.tsx @@ -1,8 +1,9 @@ import * as S from './ProfileList.style'; -import { Participation } from '@_types/index'; -import { useTheme } from '@emotion/react'; + import { Fragment } from 'react'; +import { Participation } from '@_types/index'; import ProfileCard from './ProfileCard/ProfileCard'; +import { useTheme } from '@emotion/react'; interface ProfileListProps { participants: Participation[]; @@ -13,12 +14,14 @@ export default function ProfileList(props: ProfileListProps) { const { participants } = props; return ( -
    참여자
    -
    +

    + 참여자 +

    +
      {participants.map((participant) => { return ; })} -
    +
    ); } diff --git a/frontend/src/pages/Moim/MoimDetailPage/components/Tag/Tag.tsx b/frontend/src/pages/Moim/MoimDetailPage/components/Tag/Tag.tsx index e5eb7a1c0..bfbe01b23 100644 --- a/frontend/src/pages/Moim/MoimDetailPage/components/Tag/Tag.tsx +++ b/frontend/src/pages/Moim/MoimDetailPage/components/Tag/Tag.tsx @@ -1,8 +1,8 @@ import * as S from '@_pages/Moim/MoimDetailPage/components/Tag/Tag.style'; import { HTMLProps } from 'react'; -import { useTheme } from '@emotion/react'; import { MoimStatus } from '@_types/index'; +import { useTheme } from '@emotion/react'; interface TagProps extends HTMLProps { status: MoimStatus; @@ -10,9 +10,9 @@ interface TagProps extends HTMLProps { export default function Tag(props: TagProps) { const theme = useTheme(); - const { status } = props; + const { status, ...restProps } = props; return ( -
    +
    {status === 'CANCELED' ? '모임 취소' : status === 'MOIMING' diff --git a/frontend/src/pages/Moim/MoimDetailPage/components/Zzim/ZzimButton.tsx b/frontend/src/pages/Moim/MoimDetailPage/components/Zzim/ZzimButton.tsx index 57cd23946..ec375b441 100644 --- a/frontend/src/pages/Moim/MoimDetailPage/components/Zzim/ZzimButton.tsx +++ b/frontend/src/pages/Moim/MoimDetailPage/components/Zzim/ZzimButton.tsx @@ -1,16 +1,18 @@ -import { useTheme } from '@emotion/react'; import * as S from '@_pages/Moim/MoimDetailPage/components/Zzim/ZzimButton.style'; + +import { HTMLAttributes } from 'react'; import HeartIcon from '@_components/Icons/HeartIcon'; +import { useTheme } from '@emotion/react'; -interface ZzimButtonProps { +interface ZzimButtonProps extends HTMLAttributes { isZzimed: boolean; onClick: () => void; } export default function ZzimButton(props: ZzimButtonProps) { const theme = useTheme(); - const { isZzimed, onClick } = props; + const { isZzimed, onClick, ...restProps } = props; return ( - );