Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FE-61 ๐Ÿ”จ ๊ณต์šฉ ์ปดํฌ๋„ŒํŠธ ์ˆ˜์ • #24

Merged
merged 8 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ module.exports = {
'react/jsx-props-no-spreading': 'off',
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': ['off'],
"react/require-default-props": 'off',
"react/self-closing-comp": 'off',
},
settings: {
react: {
Expand Down
16 changes: 13 additions & 3 deletions src/components/Card/CommentCard.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import React from 'react';
import Image from 'next/image';
import { CommentCardProps } from '@/types/CommentCardTypes';
import { sizeStyles, textSizeStyles, gapStyles, paddingStyles, contentWidthStyles } from '@/styles/CommentCardStyles';

export interface CommentCardProps {
status: 'edit' | 'complete';
}

function CommentCard({ status }: CommentCardProps) {
return (
<div
Expand All @@ -17,8 +20,14 @@ function CommentCard({ status }: CommentCardProps) {
<div className={`flex-col justify-start items-start ${gapStyles.sm} ${gapStyles.md} ${gapStyles.lg} inline-flex ${contentWidthStyles.sm} ${contentWidthStyles.md} ${contentWidthStyles.lg}`}>
<div className='justify-between items-center w-full inline-flex'>
<div className='justify-start items-start gap-2 flex'>
<div className={`text-zinc-600 font-normal font-pretendard leading-normal ${textSizeStyles.sm.name} ${textSizeStyles.md.name} ${textSizeStyles.lg.name}`}>์ง€ํ‚ฌ๊ณผ ํ•˜์ด๋“œ</div>
<div className={`text-zinc-600 font-normal font-pretendard leading-normal ${textSizeStyles.sm.time} ${textSizeStyles.md.time} ${textSizeStyles.lg.time}`}>1์‹œ๊ฐ„ ์ „</div>
<div className={`text-zinc-600 font-normal font-pretendard leading-normal ${textSizeStyles.sm.name} ${textSizeStyles.md.name} ${textSizeStyles.lg.name}`}>
{/* ํ…Œ์ŠคํŠธ ํ…์ŠคํŠธ์ž…๋‹ˆ๋‹ค. */}
์ง€ํ‚ฌ๊ณผ ํ•˜์ด๋“œ
</div>
<div className={`text-zinc-600 font-normal font-pretendard leading-normal ${textSizeStyles.sm.time} ${textSizeStyles.md.time} ${textSizeStyles.lg.time}`}>
{/* ํ…Œ์ŠคํŠธ ํ…์ŠคํŠธ์ž…๋‹ˆ๋‹ค. */}
1์‹œ๊ฐ„ ์ „
</div>
</div>
{status === 'edit' && (
<div className='justify-start items-start gap-4 flex'>
Expand All @@ -30,6 +39,7 @@ function CommentCard({ status }: CommentCardProps) {
<div
className={`w-full text-zinc-800 font-normal font-pretendard ${textSizeStyles.sm.content} ${textSizeStyles.md.content} ${textSizeStyles.lg.content} ${contentWidthStyles.sm} ${contentWidthStyles.md} ${contentWidthStyles.lg}`}
>
{/* ํ…Œ์ŠคํŠธ ํ…์ŠคํŠธ์ž…๋‹ˆ๋‹ค. */}
์˜ค๋Š˜ ํ•˜๋ฃจ ์šฐ์šธํ–ˆ์—ˆ๋Š”๋ฐ ๋•๋ถ„์— ๋งŽ์€ ํž˜ ์–ป๊ณ  ๊ฐ‘๋‹ˆ๋‹ค. ์—ฐ๊ธˆ์ˆ ์‚ฌ ์ฑ… ๋‹ค์‹œ ์‚ฌ์„œ ์˜ค๋žœ๋งŒ์— ์ฝ์–ด๋ด์•ผ๊ฒ ์–ด์š”!
</div>
</div>
Expand Down
21 changes: 12 additions & 9 deletions src/components/Card/EpigramCard.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';

// figma ์ƒ์œผ๋กœ๋Š” sm ~ 3xl ์‚ฌ์ด์ฆˆ๋กœ ๊ตฌํ˜„๋˜์–ด ์žˆ๋Š”๋ฐ, tailwind ํ™˜๊ฒฝ์„ ๋ฐ˜์˜ํ•ด
// base ~ 2xl ์œผ๋กœ ์ •์˜ํ–ˆ์Šต๋‹ˆ๋‹ค.
// xs ~ 2xl ์œผ๋กœ ์ •์˜ํ–ˆ์Šต๋‹ˆ๋‹ค.
const sizeStyles = {
base: 'w-[286px] max-h-[132px]',
xs: 'w-[286px] max-h-[132px]',
sm: 'sm:w-[312px] sm:max-h-[152px]',
md: 'md:w-[384px] md:max-h-[180px]',
lg: 'lg:w-[540px] lg:max-h-[160px]',
Expand All @@ -12,7 +12,7 @@ const sizeStyles = {
};

const textSizeStyles = {
base: 'text-xs',
xs: 'text-xs',
sm: 'sm:text-sm',
md: 'md:text-base',
lg: 'lg:text-xl',
Expand All @@ -22,34 +22,37 @@ const textSizeStyles = {

function EpigramCard() {
return (
<div className={`relative flex-col justify-start items-end gap-2 inline-flex ${sizeStyles.base} ${sizeStyles.sm} ${sizeStyles.md} ${sizeStyles.lg} ${sizeStyles.xl} ${sizeStyles['2xl']}`}>
<div className={`relative flex-col justify-start items-end gap-2 inline-flex ${sizeStyles.xs} ${sizeStyles.sm} ${sizeStyles.md} ${sizeStyles.lg} ${sizeStyles.xl} ${sizeStyles['2xl']}`}>
<div className='w-full p-[22px] bg-white rounded-[14.67px] shadow border border-zinc-100 flex-col justify-start items-start flex relative overflow-hidden'>
{/* eslint-disable-next-line */}
<div className='absolute inset-0 bg-stripes w-full h-full'></div> {/* ์ค„๋ฌด๋Šฌ๋ฅผ ๋งŒ๋“ค๋ ค๋ฉด ๋น„์–ด์žˆ๋Š” div๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. */}
<div className='relative w-full z-10 flex flex-col justify-start items-start flex-1'>
<div className='self-stretch flex-col justify-start items-start gap-2 flex'>
<div
className={`self-stretch ${textSizeStyles.base} ${textSizeStyles.sm} ${textSizeStyles.md} ${textSizeStyles.lg} ${textSizeStyles.xl} ${textSizeStyles['2xl']} text-neutral-700 font-normal font-iropkeBatang leading-normal`}
className={`self-stretch ${textSizeStyles.xs} ${textSizeStyles.sm} ${textSizeStyles.md} ${textSizeStyles.lg} ${textSizeStyles.xl} ${textSizeStyles['2xl']} text-neutral-700 font-normal font-iropkeBatang leading-normal`}
>
{/* ํ…Œ์ŠคํŠธ ํ…์ŠคํŠธ์ž…๋‹ˆ๋‹ค. */}
์˜ค๋žซ๋™์•ˆ ๊ฟˆ์„ ๊ทธ๋ฆฌ๋Š” ์‚ฌ๋žŒ์€ ๋งˆ์นจ๋‚ด ๊ทธ ๊ฟˆ์„ ๋‹ฎ์•„ ๊ฐ„๋‹ค.
</div>
<div
className={`self-stretch ${textSizeStyles.base} ${textSizeStyles.sm} ${textSizeStyles.md} ${textSizeStyles.lg} ${textSizeStyles.xl} ${textSizeStyles['2xl']} text-right text-slate-400 font-normal font-iropkeBatang leading-normal`}
className={`self-stretch ${textSizeStyles.xs} ${textSizeStyles.sm} ${textSizeStyles.md} ${textSizeStyles.lg} ${textSizeStyles.xl} ${textSizeStyles['2xl']} text-right text-slate-400 font-normal font-iropkeBatang leading-normal`}
>
- ์•™๋“œ๋ ˆ ๋ง๋กœ -
{/* ํ…Œ์ŠคํŠธ ํ…์ŠคํŠธ์ž…๋‹ˆ๋‹ค. */}- ์•™๋“œ๋ ˆ ๋ง๋กœ -
</div>
</div>
</div>
</div>
<div className='justify-start items-start gap-2 inline-flex'>
<div
className={`text-right ${textSizeStyles.base} ${textSizeStyles.sm} ${textSizeStyles.md} ${textSizeStyles.lg} ${textSizeStyles.xl} ${textSizeStyles['2xl']} text-slate-400 font-normal font-iropkeBatang leading-normal`}
className={`text-right ${textSizeStyles.xs} ${textSizeStyles.sm} ${textSizeStyles.md} ${textSizeStyles.lg} ${textSizeStyles.xl} ${textSizeStyles['2xl']} text-slate-400 font-normal font-iropkeBatang leading-normal`}
>
{/* ํ…Œ์ŠคํŠธ ํ…์ŠคํŠธ์ž…๋‹ˆ๋‹ค. */}
#๋‚˜์•„๊ฐ€์•ผํ• ๋•Œ
</div>
<div
className={`text-right ${textSizeStyles.base} ${textSizeStyles.sm} ${textSizeStyles.md} ${textSizeStyles.lg} ${textSizeStyles.xl} ${textSizeStyles['2xl']} text-slate-400 font-normal font-iropkeBatang leading-normal`}
className={`text-right ${textSizeStyles.xs} ${textSizeStyles.sm} ${textSizeStyles.md} ${textSizeStyles.lg} ${textSizeStyles.xl} ${textSizeStyles['2xl']} text-slate-400 font-normal font-iropkeBatang leading-normal`}
>
{/* ํ…Œ์ŠคํŠธ ํ…์ŠคํŠธ์ž…๋‹ˆ๋‹ค. */}
#๊ฟˆ์„์ด๋ฃจ๊ณ ์‹ถ์„๋•Œ
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
1๊ฐœ์˜ ๊ฐ์ • ์•„์ด์ฝ˜ ์นด๋“œ๋ฅผ ๋žœ๋”๋ง ํ•ฉ๋‹ˆ๋‹ค.
์•„์ด์ฝ˜์˜ ํƒ€์ž…, ์ƒํƒœ, ํฌ๊ธฐ, ํด๋ฆญ ์ด๋ฒคํŠธ๋ฅผ ๊ด€๋ฆฌํ•ฉ๋‹ˆ๋‹ค.
์•„์ด์ฝ˜ ํƒ€์ž…๊ณผ ์ƒํƒœ์— ๋”ฐ๋ผ ์•„์ด์ฝ˜์˜ ๋ชจ์–‘๊ณผ ์Šคํƒ€์ผ์„ ์กฐ์ •ํ•ฉ๋‹ˆ๋‹ค.
*/

import React from 'react';
import cn from '@/lib/utils';
import Image from 'next/image';
Expand Down Expand Up @@ -104,11 +110,4 @@ function EmotionIconCard({ iconType = '๊ฐ๋™', state = 'Default', size = 'sm',
);
}

EmotionIconCard.displayName = 'EmotionIconCard';

// ๊ธฐ๋ณธ props ์„ค์ •
EmotionIconCard.defaultProps = {
onClick: () => {},
};

export default EmotionIconCard;
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
/*
์—ฌ๋Ÿฌ ๊ฐœ์˜ EmotionIconCard๋ฅผ ๊ด€๋ฆฌํ•ฉ๋‹ˆ๋‹ค.
์‚ฌ์šฉ์ž ์ธํ„ฐํŽ˜์ด์Šค์— ํ•„์š”ํ•œ ์ƒํ˜ธ ์ž‘์šฉ ๋กœ์ง์„ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค.
*/

import React, { useState } from 'react';
import InteractiveEmotionIconCard from '@/components/Emotion/card/InteractiveEmotionIconCard';
import EmotionIconCard from '@/components/Emotion/EmotionCard';
import useMediaQuery from '@/hooks/useMediaQuery';
import { EmotionType, EmotionState } from '@/types/EmotionTypes';

Expand Down Expand Up @@ -52,7 +57,7 @@ function EmotionSelector() {
return (
<div className={`justify-start items-start inline-flex ${containerClass}`}>
{(['๊ฐ๋™', '๊ธฐ์จ', '๊ณ ๋ฏผ', '์Šฌํ””', '๋ถ„๋…ธ'] as const).map((iconType) => (
<InteractiveEmotionIconCard key={iconType} iconType={iconType} size={cardSize} state={states[iconType]} onClick={() => handleCardClick(iconType)} />
<EmotionIconCard key={iconType} iconType={iconType} size={cardSize} state={states[iconType]} onClick={() => handleCardClick(iconType)} />
))}
</div>
);
Expand Down
12 changes: 0 additions & 12 deletions src/components/Emotion/card/InteractiveEmotionIconCard.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions src/types/CommentCardTypes.ts

This file was deleted.

Loading