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

[FEATURE] org admin 빈 곳 있을 시 해당 섹션으로 이동 #179

Merged
merged 14 commits into from
Dec 31, 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
14 changes: 10 additions & 4 deletions src/components/org/OrgAdmin/AboutSection/Curriculum/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,22 @@ const CURRICULUM = PART_LIST.reduce(
{} as Record<string, string[]>,
);

const Curriculum = () => {
interface CurriculumProps {
selectedPart: PART_KO;
onChangeSelectedPart: (part: PART_KO) => void;
}

const Curriculum = ({
selectedPart,
onChangeSelectedPart,
}: CurriculumProps) => {
const {
register,
formState: { errors },
} = useFormContext();

const [selectedPart, setSelectedPart] = useState<PART_KO>('기획');

const handleSetSelectedPart = (value: PART_KO) => {
setSelectedPart(value);
onChangeSelectedPart(value);
};

return (
Expand Down
18 changes: 11 additions & 7 deletions src/components/org/OrgAdmin/AboutSection/Executives/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import { Chip } from '@sopt-makers/ui';
import { useState } from 'react';

import { PART_LIST, 임원진_LIST } from '@/utils/org';
import { EXEC_TYPE, PART_LIST, 임원진_LIST } from '@/utils/org';

import { StTitle, StWrapper } from '../style';
import ExecInfo from './ExecInfo';
import { StChipLabel, StChipLine, StChipWrapper } from './style';

const Executives = () => {
type ExecType = (typeof 임원진_LIST)[number] | (typeof PART_LIST)[number];
const [selectedExec, setSelectedExec] = useState<ExecType>('회장');
interface ExecutivesProps {
selectedExec: EXEC_TYPE;
onChangeSelectedExec: (member: EXEC_TYPE) => void;
}

const handleSetSelectedExec = (value: ExecType) => {
setSelectedExec(value);
const Executives = ({
selectedExec,
onChangeSelectedExec,
}: ExecutivesProps) => {
const handleSetSelectedExec = (value: EXEC_TYPE) => {
onChangeSelectedExec(value);
};

return (
Expand Down
26 changes: 23 additions & 3 deletions src/components/org/OrgAdmin/AboutSection/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,36 @@
import { EXEC_TYPE, PART_KO } from '@/utils/org';

import CoreValue from './CoreValue';
import Curriculum from './Curriculum';
import Executives from './Executives';
import HeaderBanner from './HeaderBanner';
import { StContainer } from './style';

const AboutSection = () => {
interface AboutSectionProps {
selectedPart: PART_KO;
onChangeSelectedPart: (part: PART_KO) => void;
selectedExec: EXEC_TYPE;
onChangeSelectedExec: (member: EXEC_TYPE) => void;
}

const AboutSection = ({
selectedPart,
onChangeSelectedPart,
selectedExec,
onChangeSelectedExec,
}: AboutSectionProps) => {
return (
<StContainer>
<HeaderBanner />
<CoreValue />
<Curriculum />
<Executives />
<Curriculum
selectedPart={selectedPart}
onChangeSelectedPart={onChangeSelectedPart}
/>
<Executives
selectedExec={selectedExec}
onChangeSelectedExec={onChangeSelectedExec}
/>
</StContainer>
);
};
Expand Down
Loading