Skip to content

Commit

Permalink
feat: 꿀조합 등록 버튼 스타일 수정 (#93)
Browse files Browse the repository at this point in the history
* feat: 꿀조합 등록 버튼 스타일 수정

* refactor: MemberImage 컴포넌트로 교체

* feat: 좋아요 버튼 텍스트 사이 간격 추가
  • Loading branch information
xodms0309 authored Apr 19, 2024
1 parent bf46a51 commit 12e792f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 20 deletions.
20 changes: 5 additions & 15 deletions src/components/Recipe/CommentForm/CommentForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import { useToastActionContext } from '@fun-eat/design-system';
import type { ChangeEventHandler, FormEventHandler, RefObject } from 'react';
import { useRef, useState } from 'react';

import { commentForm, commentTextarea, container, profileImage, sendButton } from './commentForm.css';
import { commentForm, commentTextarea, container, sendButton } from './commentForm.css';

import { SvgIcon, Text } from '@/components/Common';
import { MemberImage } from '@/components/Members';
import { useScroll } from '@/hooks/common';
import { useMemberQuery } from '@/hooks/queries/members';
import { useRecipeCommentMutation } from '@/hooks/queries/recipe';
Expand Down Expand Up @@ -66,13 +67,7 @@ const CommentForm = ({ recipeId, scrollTargetRef }: CommentFormProps) => {

return (
<div className={container}>
<img
className={profileImage}
src={member?.profileImage}
width={29}
height={29}
alt={`${member?.nickname}의 프로필 사진`}
/>
<MemberImage src={member?.profileImage || ''} width={29} height={29} alt={`${member?.nickname}의 프로필 사진`} />
<>
<form className={commentForm} onSubmit={handleSubmitComment}>
<textarea
Expand All @@ -87,13 +82,8 @@ const CommentForm = ({ recipeId, scrollTargetRef }: CommentFormProps) => {
<Text size="caption4" color="disabled">
{commentValue.length}/200
</Text>
<button className={sendButton}>
<SvgIcon
variant="plane"
width={18}
height={18}
fill={commentValue.length === 0 ? vars.colors.gray3 : vars.colors.gray5}
/>
<button className={commentValue.length === 0 ? sendButton['disabled'] : sendButton['active']}>
<SvgIcon variant="plane" width={14} height={14} fill={vars.colors.white} />
</button>
</form>
</>
Expand Down
14 changes: 9 additions & 5 deletions src/components/Recipe/CommentForm/commentForm.css.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { vars } from '@/styles/theme.css';
import { style } from '@vanilla-extract/css';
import { style, styleVariants } from '@vanilla-extract/css';

export const container = style({
display: 'flex',
Expand Down Expand Up @@ -34,10 +34,14 @@ export const commentTextarea = style({
},
});

export const profileImage = style({
borderRadius: '50%',
export const sendButtonStyles = style({
display: 'inherit',
width: 36,
borderRadius: 45,
padding: '4px 10px',
});

export const sendButton = style({
display: 'inherit',
export const sendButton = styleVariants({
active: [sendButtonStyles, { background: vars.colors.primary }],
disabled: [sendButtonStyles, { background: vars.colors.gray3 }],
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ import { style } from '@vanilla-extract/css';
export const container = style({
display: 'flex',
alignItems: 'center',
gap: 6,
});

0 comments on commit 12e792f

Please sign in to comment.