Skip to content

Commit

Permalink
feat: 간식인증 업로드 페이지에서 상세 정보 선택 항목 변경으로인한 디자인 및 상수 변경[#96]
Browse files Browse the repository at this point in the history
  • Loading branch information
j2h30728 committed Oct 22, 2024
1 parent 801a508 commit 17f41f4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 21 deletions.
8 changes: 2 additions & 6 deletions src/shared/constants/verification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,8 @@ export const MEAL_OPTION = {
};

export const TREATS_OPTION = {
DOG_CHEW: '강아지껌',
DRIED_TREAT: '건조간식',
JERKY_TREAT: '저키/트릿',
CAN: '캔',
BISCUIT: '비스킷',
OTHER: '기타',
ALL: '다 먹었어요!',
NONE: '거의 안먹었어요!',
};

export const BATH_OPTION = {
Expand Down
3 changes: 0 additions & 3 deletions src/widgets/verification/ui/VerificationOption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const VerificationOption = ({
case VERIFICATION.MEAL:
return (
<VerificationRadioOptions
name="meal"
options={Object.values(MEAL_OPTION)}
register={register}
watch={watch}
Expand All @@ -54,7 +53,6 @@ const VerificationOption = ({
case VERIFICATION.TREATS:
return (
<VerificationRadioOptions
name="treats"
options={Object.values(TREATS_OPTION)}
register={register}
watch={watch}
Expand All @@ -64,7 +62,6 @@ const VerificationOption = ({
case VERIFICATION.BATH:
return (
<VerificationRadioOptions
name="bath"
options={Object.values(BATH_OPTION)}
register={register}
watch={watch}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import styled from 'styled-components';

import { VerificationWithCategory } from './VerificationRadioOptions';

export const VerificationOptionContainer = styled.label<{
$name: VerificationWithCategory;
}>`
export const VerificationOptionContainer = styled.label`
display: flex;
width: ${({ $name }) => ($name === 'treats' ? 'auto' : '100%')};
margin: ${({ $name }) => ($name === 'treats' ? '0 -60px' : '')};
width: 100%;
justify-content: space-around;
align-items: center;
gap: 10px;
Expand Down
6 changes: 1 addition & 5 deletions src/widgets/verification/ui/VerificationRadioOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,21 @@ import { Fragment } from 'react/jsx-runtime';
import { verificationOption } from '../../../shared/constants/verification';
import * as S from './VerificationRadioOptions.styled';

export type VerificationWithCategory = 'meal' | 'treats' | 'bath';

const VerificationRadioOptions = ({
options,
register,
watch,
setValue,
name,
}: {
options: string[];
register: UseFormRegister<FieldValues>;
watch: UseFormWatch<FieldValues>;
setValue: UseFormSetValue<FieldValues>;
name: VerificationWithCategory;
}) => {
const currentValue = watch(verificationOption) as string;

return (
<S.VerificationOptionContainer $name={name}>
<S.VerificationOptionContainer>
{Object.values(options).map((value) => (
<Fragment key={value}>
<input
Expand Down

0 comments on commit 17f41f4

Please sign in to comment.