Skip to content

Commit

Permalink
issue #275 feat: create keyword edit
Browse files Browse the repository at this point in the history
  • Loading branch information
sikkzz committed May 10, 2024
1 parent 08f8f66 commit 2eda8cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Box, Heading, Button, getDefaultTextStyle, Theme } from "waggle-design-system";

import PostEdit from "@/components/common/Post/PostEdit";
import Keyword from "@/components/Question/QuestionUpload/Keyword/Keyword";

import { useAddQuestionForm } from "@/hooks/post/useAddQuestionForm";

Expand Down Expand Up @@ -31,6 +32,8 @@ const QuestionEdit = ({ questionData }: QuestionDataType) => {
Q&A - 질문 수정하기
</Heading>

<Keyword initialValue={hashtagList} updateInputValue={updateInputValue} />

<input
type="text"
placeholder="제목을 입력해주세요."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,19 @@ import {
} from "@/components/Question/QuestionUpload/Keyword/Keyword.style";

interface KeywordProps {
initialValue?: string[];
updateInputValue: <Key extends keyof QuestionFormData>(
key: Key,
value: QuestionFormData[Key]
) => void;
}

const Keyword = ({ updateInputValue }: KeywordProps) => {
const Keyword = ({ initialValue, updateInputValue }: KeywordProps) => {
const [isToolTipOpen, setIsToolTipOpen] = useState(false);
const [isInputOpen, setIsInputOpen] = useState(false);

const [keyword, setKeyword] = useState("");
const [keywordList, setKeyWordList] = useState<string[]>([]);
const [keywordList, setKeyWordList] = useState<string[]>(initialValue ?? []);

const tooltipRef = useRef<HTMLDivElement>(null);

Expand Down

0 comments on commit 2eda8cf

Please sign in to comment.