feat(homepage): add new sections to homepage

This commit is contained in:
Amruth Pillai
2023-11-13 17:03:41 +01:00
parent 4b1e33db80
commit d18b258761
79 changed files with 3096 additions and 313 deletions

View File

@ -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);

View File

@ -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 />

View File

@ -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>

View File

@ -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>
);
};

View File

@ -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>