Skip to content

Commit

Permalink
chore: 브랜치 최신화
Browse files Browse the repository at this point in the history
  • Loading branch information
geongyu09 committed Mar 2, 2024
1 parent 12e3d39 commit efcdd1b
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,29 @@ interface ApplicationNextButtonProps {
isLast?: boolean;
}

// etc. 단순히 boolean이 아닌 어느 곳에서 터지는 지와 그 이유를 담은 객체를 반환하면 어떨까?
// TODO: 질문의 이름마다 side effect가 있으니 주의하면 좋을 것
const canNext = (applicationName: Array<string>) => {
return applicationName.every((name) => {
const canNext = (applicationNames: Array<string>) => {
return applicationNames.every((name) => {
const EMPTY_STRING: string = "";
const localStorageValueFromName = localStorage.get(name, EMPTY_STRING);

if (
name === "personalInformationAgreeForPortfolio" ||
name === "personalInformationAgree"
) {
return (
localStorage.get(name) !== "동의하지 않습니다." &&
localStorage.get(name, "") !== ""
);
return localStorageValueFromName === "동의합니다.";
}
if (name === "email") {
return isEmail(localStorage.get(name, ""));
return isEmail(localStorageValueFromName);
}
if (name === "check") {
return localStorage.get(name) === "확인했습니다";
}
if (localStorage.get(name, "").length === 0) {
if (
name === "channel" &&
localStorage.get("channelEtc", "").length !== 0
) {
return true;
}
return false;
return localStorageValueFromName === "확인했습니다";
}
return true;
return (
!(localStorageValueFromName.length === 0) ||
(name === "channel" && localStorage.get("channelEtc", EMPTY_STRING).length !== 0)
);
});
};

Expand All @@ -57,7 +52,7 @@ const ApplicationNextButton = ({
);
if (!canNext(Array.from(applicationName))) {
alert("필수 항목을 입력해주세요.");
return false;
return;
}

if (isLast) {
Expand Down
13 changes: 7 additions & 6 deletions frontend/components/common/navbar/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { KANBAN_MENU } from "@/src/constants/kanban/26";
import { KanbanSelectedButtonNumberState } from "@/src/stores/kanban/Navbar.atoms";
import { cn } from "@/src/utils/cn";
import { useAtom } from "jotai";

type NavbarButtonProps = {
Expand All @@ -14,19 +15,19 @@ const NavbarButton = ({ value }: NavbarButtonProps) => {
const findmenuIndex =
KANBAN_MENU.findIndex((menu) => menu.navTitle === value) + 1;

const buttonClassName = " py-2 px-6 rounded-lg min-w-fit ";
const buttonClassName = "py-2 px-6 rounded-lg min-w-fit";

const onClick = () => {
setnavbarId(findmenuIndex.toString());
};
const isButtonSelected = navbarId === findmenuIndex.toString();

return (
<button
className={
findmenuIndex.toString() === navbarId
? `bg-dark text-white${buttonClassName}`
: `bg-white text-gray-400${buttonClassName}`
}
className={cn(
buttonClassName,
isButtonSelected ? `bg-dark text-white` : `bg-white text-gray-400`
)}
onClick={onClick}
>
{value}
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/kanban/Navbar.component.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { KANBAN_MENU, KanbanMenu } from "@/src/constants/kanban/26";
import { KANBAN_MENU, KanbanMenu } from "@/src/constants/kanban/27";
import NavbarButton from "../common/navbar/Button";

const KanbanNavbar = () => {
Expand Down
35 changes: 35 additions & 0 deletions frontend/src/constants/kanban/27.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
export interface KanbanMenu {
id: number;
navTitle: string;
}

export const KANBAN_MENU = [
{
id: 1,
navTitle: "공통",
},
{
id: 2,
navTitle: "회장단",
},
{
id: 3,
navTitle: "운영팀",
},
{
id: 4,
navTitle: "홍보 및 디자인팀",
},
{
id: 5,
navTitle: "지원자 대응팀",
},
{
id: 6,
navTitle: "방송팀",
},
{
id: 7,
navTitle: "기타 참고",
},
];

0 comments on commit efcdd1b

Please sign in to comment.