mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-16 17:51:43 +10:00
feat(homepage): add new sections to homepage
This commit is contained in:
@ -36,6 +36,7 @@ type Props = { id: SectionKey };
|
||||
|
||||
export const SectionOptions = ({ id }: Props) => {
|
||||
const { open } = useDialog(id);
|
||||
|
||||
const setValue = useResumeStore((state) => state.setValue);
|
||||
const removeSection = useResumeStore((state) => state.removeSection);
|
||||
|
||||
|
||||
@ -8,7 +8,6 @@ import { ThemeSwitch } from "@/client/components/theme-switch";
|
||||
import { ExportSection } from "./sections/export";
|
||||
import { InformationSection } from "./sections/information";
|
||||
import { LayoutSection } from "./sections/layout";
|
||||
import { LocaleSection } from "./sections/locale";
|
||||
import { NotesSection } from "./sections/notes";
|
||||
import { PageSection } from "./sections/page";
|
||||
import { SharingSection } from "./sections/sharing";
|
||||
@ -40,8 +39,6 @@ export const RightSidebar = () => {
|
||||
<Separator />
|
||||
<PageSection />
|
||||
<Separator />
|
||||
<LocaleSection />
|
||||
<Separator />
|
||||
<SharingSection />
|
||||
<Separator />
|
||||
<StatisticsSection />
|
||||
|
||||
@ -26,7 +26,6 @@ const DonateCard = () => (
|
||||
If you like the app and want to support keeping it free forever, please donate whatever
|
||||
you can afford to give.
|
||||
</p>
|
||||
<p>Your donations could be tax-deductible, depending on your location.</p>
|
||||
</Trans>
|
||||
</CardDescription>
|
||||
</CardContent>
|
||||
|
||||
@ -1,48 +0,0 @@
|
||||
import { t } from "@lingui/macro";
|
||||
import { useLingui } from "@lingui/react";
|
||||
import { Combobox, Label } from "@reactive-resume/ui";
|
||||
import { useMemo } from "react";
|
||||
|
||||
import { dynamicActivate, getLocales } from "@/client/libs/lingui";
|
||||
import { useResumeStore } from "@/client/stores/resume";
|
||||
|
||||
import { getSectionIcon } from "../shared/section-icon";
|
||||
|
||||
export const LocaleSection = () => {
|
||||
const { _ } = useLingui();
|
||||
|
||||
const setValue = useResumeStore((state) => state.setValue);
|
||||
const locale = useResumeStore((state) => state.resume.data.metadata.locale);
|
||||
|
||||
const options = useMemo(() => {
|
||||
return Object.entries(getLocales()).map(([value, label]) => ({
|
||||
label,
|
||||
value,
|
||||
}));
|
||||
}, [_]);
|
||||
|
||||
const onChangeLanguage = async (value: string) => {
|
||||
setValue("metadata.locale", value);
|
||||
await dynamicActivate(value);
|
||||
|
||||
// Update resume section titles with new locale
|
||||
};
|
||||
|
||||
return (
|
||||
<section id="locale" className="grid gap-y-6">
|
||||
<header className="flex items-center justify-between">
|
||||
<div className="flex items-center gap-x-4">
|
||||
{getSectionIcon("locale")}
|
||||
<h2 className="line-clamp-1 text-3xl font-bold">{t`Locale`}</h2>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main className="grid gap-y-4">
|
||||
<div className="space-y-1.5">
|
||||
<Label>{t`Language`}</Label>
|
||||
<Combobox value={locale} onValueChange={onChangeLanguage} options={options} />
|
||||
</div>
|
||||
</main>
|
||||
</section>
|
||||
);
|
||||
};
|
||||
@ -168,17 +168,26 @@ export const TypographySection = () => {
|
||||
<div className="space-y-1.5">
|
||||
<Label>{t`Options`}</Label>
|
||||
|
||||
<div className="py-2">
|
||||
<div className="flex items-center gap-x-4">
|
||||
<Switch
|
||||
id="metadata.typography.underlineLinks"
|
||||
checked={typography.underlineLinks}
|
||||
onCheckedChange={(checked) => {
|
||||
setValue("metadata.typography.underlineLinks", checked);
|
||||
}}
|
||||
/>
|
||||
<Label htmlFor="metadata.typography.underlineLinks">{t`Underline Links`}</Label>
|
||||
</div>
|
||||
<div className="flex items-center gap-x-4 py-2">
|
||||
<Switch
|
||||
id="metadata.typography.hideIcons"
|
||||
checked={typography.hideIcons}
|
||||
onCheckedChange={(checked) => {
|
||||
setValue("metadata.typography.hideIcons", checked);
|
||||
}}
|
||||
/>
|
||||
<Label htmlFor="metadata.typography.hideIcons">{t`Hide Icons`}</Label>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-x-4 py-2">
|
||||
<Switch
|
||||
id="metadata.typography.underlineLinks"
|
||||
checked={typography.underlineLinks}
|
||||
onCheckedChange={(checked) => {
|
||||
setValue("metadata.typography.underlineLinks", checked);
|
||||
}}
|
||||
/>
|
||||
<Label htmlFor="metadata.typography.underlineLinks">{t`Underline Links`}</Label>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user