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

Feat: 모집글 작성 수정 페이지 api연동 제외 #154

Merged
Show file tree
Hide file tree
Changes from 5 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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import useOpenToggle from "@/hooks/useOpenToggle";
import SquareDropButton from "../commons/SquareDropButton";
import { Calendar } from "./ui/calendar";
interface DeadlineDropdownProps {
placeholder: string;
placeholder: string | null;
selectedOption: string;
onSelect: (option: string) => void;
}
Expand Down
4 changes: 2 additions & 2 deletions co-kkiri/src/components/commons/DropDowns/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import DropMenu from "./commons/DropMenu";
import styled from "styled-components";

interface DropdownProps {
placeholder?: string;
selectedOption?: string;
placeholder: string;
selectedOption?: string | null;
options: string[];
onSelect: (option: string) => void;
dropdownRef?: React.RefCallback<HTMLButtonElement>;
Expand Down
10 changes: 5 additions & 5 deletions co-kkiri/src/components/commons/ReactQuill/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "react-quill/dist/quill.snow.css";
import CustomToolbar from "./CustomToolbar";
import styled from "styled-components";
import DESIGN_TOKEN from "@/styles/tokens";
import { RecruitmentRequest } from "@/types/recruitmentRequestTypes";
import { RecruitApiRequestDto } from "@/lib/api/post/type";

const formats = [
"header",
Expand All @@ -21,9 +21,9 @@ const formats = [
];

export default function QuillEditor({
setSelectedOption,
setSelectedOptions,
}: {
setSelectedOption: React.Dispatch<React.SetStateAction<RecruitmentRequest>>;
setSelectedOptions: React.Dispatch<React.SetStateAction<RecruitApiRequestDto>>;
}) {
const modules = useMemo(() => {
return {
Expand All @@ -34,14 +34,14 @@ export default function QuillEditor({
}, []);

const handleTitleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
setSelectedOption((prevOptions) => ({
setSelectedOptions((prevOptions) => ({
...prevOptions,
title: e.target.value,
}));
};

const handleContentChange = (content: string) => {
setSelectedOption((prevOptions) => ({
setSelectedOptions((prevOptions) => ({
...prevOptions,
content: content,
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ interface LinkInputProps {

export default function LinkInput({ selectedOption, onChange }: LinkInputProps) {
const { recruitment } = DROPDOWN_INFO;
const optionIndex = recruitment.contactWay.options?.indexOf(selectedOption);
const value = recruitment.contactWay.placeholder[optionIndex];
const optionIndex = recruitment.contactWay.options.indexOf(selectedOption);
const value = selectedOption ? String(recruitment.contactWay.placeholder[optionIndex]) : "";

return (
<Container>
{selectedOption !== "기타" ? <Input placeholder={value} onChange={(e) => onChange(e.target.value)} /> : null}
{selectedOption !== "기타" && <Input placeholder={value} onChange={(e) => onChange(e.target.value)} />}
</Container>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,38 @@ export const Container = styled.form`
}
`;

export const SelectContainer = styled.form`
display: flex;
flex-direction: column;
width: 77.4rem;
gap: 4rem;

& p {
${typography.font12Medium}
color: ${color.red};
}

& h1 {
border-bottom: 0.1rem solid ${color.gray[2]};
padding-bottom: 2rem;
}

${mediaQueries.tablet} {
width: 46.2rem;
}

${mediaQueries.mobile} {
width: 32rem;
}
`;

export const GirdContainer = styled.div`
& h3 {
display: flex;

& span {
color: ${color.red};
margin-left: 0.2rem;
}
}

Expand Down Expand Up @@ -74,10 +100,6 @@ export const RadioButtonBox = styled.div`
display: flex;
gap: 3rem;
}

& p {
margin-top: -1.2rem;
}
`;

export const RadioButtonWarper = styled.div`
Expand All @@ -102,16 +124,24 @@ export const SelectBox = styled.div`
display: flex;
flex-direction: column;
gap: 1.2rem;
height: 10.1rem;

& p {
position: relative;
top: -0.4rem;
}
`;

export const SelectChipBox = styled.div`
display: flex;
flex-direction: column;
gap: 2rem;
height: 9.5rem;

& h3 {
& span {
color: ${color.red};
margin-left: 0.2rem;
}
}

Expand All @@ -122,7 +152,7 @@ export const SelectChipBox = styled.div`
}

& p {
margin-top: -0.95rem;
margin-top: -1.2rem;
}
`;

Expand All @@ -142,27 +172,3 @@ export const SubmitButtonBox = styled.div`
gap: 1.2rem;
justify-content: end;
`;

export const SelectContainer = styled.form`
display: flex;
flex-direction: column;
width: 77.4rem;
gap: 4rem;

& p {
color: ${color.red};
}

& h1 {
border-bottom: 0.1rem solid ${color.gray[2]};
padding-bottom: 2rem;
}

${mediaQueries.tablet} {
width: 46.2rem;
}

${mediaQueries.mobile} {
width: 32rem;
}
`;
Loading
Loading