Skip to content

Commit

Permalink
refactor: branding color register 네이밍 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
eonseok-jeon committed Dec 23, 2024
1 parent ac98fce commit 28e1cb1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions src/components/org/OrgAdmin/CommonSection/BrandingColor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ const BrandingColor = () => {
<StDescription>다크 모드를 고려하여 선정해주세요.</StDescription>
</StTitleWrapper>
<StInputWrapper>
<ColorInputField label="키컬러 (메인)" id="brandingColor_main" />
<ColorInputField label="키컬러 (저명도)" id="brandingColor_low" />
<ColorInputField label="키컬러 (고명도)" id="brandingColor_high" />
<ColorInputField label="키컬러 (메인)" id="brandingColor.main" />
<ColorInputField label="키컬러 (저명도)" id="brandingColor.low" />
<ColorInputField label="키컬러 (고명도)" id="brandingColor.high" />
<BrandingSubColor onInfoToggle={onInfoToggle} />
</StInputWrapper>
</StWrapper>{' '}
Expand Down
10 changes: 5 additions & 5 deletions src/components/org/OrgAdmin/CommonSection/BrandingSubColor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const BrandingSubColor = ({
<IconInfoCircle />
</StInfoButton>
<StInput
{...register('brandingColor_point', {
{...register('brandingColor.point', {
required: true && VALIDATION_CHECK.required.errorText,
})}
required
Expand All @@ -37,13 +37,13 @@ const BrandingSubColor = ({
type="text"
maxLength={9}
placeholder="ex. #ffffff"
isError={errors.brandingColor_point?.message != undefined}
errorMessage={errors.brandingColor_point?.message as string}
isError={!!(errors as any).brandingColor?.point?.message}
errorMessage={(errors as any).brandingColor?.point?.message as string}
/>
<StColorPreview
type="color"
value={expandHexColor(watch('brandingColor_point'))}
onChange={(e) => setValue('brandingColor_point', e.target.value)}
value={expandHexColor(watch('brandingColor.point'))}
onChange={(e) => setValue('brandingColor.point', e.target.value)}
/>
</StColorWrapper>
</StInputBox>
Expand Down
7 changes: 5 additions & 2 deletions src/components/org/OrgAdmin/CommonSection/ColorInputField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const ColorInputField = ({ label, id }: ColorInputFieldProps) => {
watch,
setValue,
} = useFormContext();
const [brandingColor, color] = id.split('.');

return (
<StColorWrapper>
Expand All @@ -31,8 +32,10 @@ const ColorInputField = ({ label, id }: ColorInputFieldProps) => {
type="text"
maxLength={9}
placeholder="ex. #ffffff"
isError={errors[id]?.message != undefined}
errorMessage={errors[id]?.message as string}
isError={!!(errors as any)[brandingColor]?.[color]?.message}
errorMessage={
(errors as any)[brandingColor]?.[color]?.message as string
}
/>
<StColorPreview
type="color"
Expand Down
13 changes: 5 additions & 8 deletions src/components/org/OrgAdmin/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,7 @@ function OrgAdmin() {

if (isScheduleValid && isCurriculumValid && isFnaValid) {
const {
brandingColor_high,
brandingColor_low,
brandingColor_main,
brandingColor_point,
brandingColor,
generation,
name,
recruitHeaderImage: { fileName: recruitHeaderImageFileName },
Expand Down Expand Up @@ -177,10 +174,10 @@ function OrgAdmin() {
},
],
brandingColor: {
main: brandingColor_main,
low: brandingColor_low,
high: brandingColor_high,
point: brandingColor_point,
main: brandingColor.main,
low: brandingColor.low,
high: brandingColor.high,
point: brandingColor.point,
},
mainButton: {
text: '지원하기',
Expand Down

0 comments on commit 28e1cb1

Please sign in to comment.