Skip to content

Commit a968636

Browse files
authored
fix: pre written phrases button (#124)
1 parent a60283e commit a968636

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/app/[locale]/resumes/[id]/_components/_sections/AddPreWrittenPhrasesButton.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ import { Button, useDisclosure } from "@chakra-ui/react";
22
import { useTranslations } from "next-intl";
33
import { PlusIcon } from "lucide-react";
44
import { PreWrittenPhrasesModal } from "app/[locale]/resumes/[id]/_components/_sections/PreWrittenPhrasesModal";
5-
import { PHRASES } from "lib/phrases";
5+
import { Phrase } from "types";
66

77
type Props = {
8+
phrases: Phrase[];
89
currentPhrases: string;
910
onChange: (_phrase: string, _isChecked: boolean) => void;
1011
};
1112

1213
function AddPreWrittenPhrasesButton(props: Props) {
13-
const { currentPhrases, onChange } = props;
14+
const { phrases, currentPhrases, onChange } = props;
1415
const t = useTranslations();
1516
const { isOpen, onOpen, onClose } = useDisclosure();
1617

@@ -28,7 +29,7 @@ function AddPreWrittenPhrasesButton(props: Props) {
2829
<PreWrittenPhrasesModal
2930
isOpen={isOpen}
3031
value={currentPhrases}
31-
phrases={PHRASES.SUMMARY}
32+
phrases={phrases}
3233
onClose={onClose}
3334
onChange={onChange}
3435
/>

src/app/[locale]/resumes/[id]/_components/_sections/PersonalDetailsSection.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { useLocalStorage } from "hooks/useLocalStorage";
1919
import { SectionHeader } from "app/[locale]/resumes/[id]/_components/_sections/SectionHeader";
2020
import { AddPreWrittenPhrasesButton } from "app/[locale]/resumes/[id]/_components/_sections/AddPreWrittenPhrasesButton";
2121
import { ProfilePicture } from "app/[locale]/resumes/[id]/_components/_sections/ProfilePicture";
22+
import { PHRASES } from "lib/phrases";
2223

2324
function ProfilePictureGridItem() {
2425
const { control } = useFormContext();
@@ -69,6 +70,7 @@ function SummaryGridItem() {
6970
/>
7071
</FormControl>
7172
<AddPreWrittenPhrasesButton
73+
phrases={PHRASES.SUMMARY}
7274
currentPhrases={summary}
7375
onChange={handleOnPhraseChange}
7476
/>

src/app/[locale]/resumes/[id]/_components/_sections/StandardSectionBody.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { Section } from "types";
2020
import { utils } from "lib/utils";
2121
import { SectionHeader } from "app/[locale]/resumes/[id]/_components/_sections/SectionHeader";
2222
import { AddPreWrittenPhrasesButton } from "app/[locale]/resumes/[id]/_components/_sections/AddPreWrittenPhrasesButton";
23+
import { PHRASES } from "lib/phrases";
2324

2425
type Props = {
2526
id: string;
@@ -92,6 +93,7 @@ function Description({ index, nestIndex, isEmployment }) {
9293
</FormControl>
9394
{isEmployment ? (
9495
<AddPreWrittenPhrasesButton
96+
phrases={PHRASES.EMPLOYMENT}
9597
currentPhrases={description}
9698
onChange={handleOnPhraseChange}
9799
/>

0 commit comments

Comments
 (0)