mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-26 09:54:43 +10:00
- an assortment of bugfixes and improvements
- remove line numbers from generated locale files - add .gitattributes to not display diffs of .po files
This commit is contained in:
@@ -110,7 +110,7 @@ function CustomSectionContainer({ section }: { section: CustomSection }) {
|
||||
type="button"
|
||||
onClick={onUpdateSection}
|
||||
className={cn(
|
||||
"flex flex-1 flex-col items-start justify-center space-y-0.5 p-4 text-left transition-opacity hover:bg-secondary/40 focus:outline-none focus-visible:ring-1",
|
||||
"flex flex-1 flex-col items-start justify-center space-y-0.5 p-4 text-start transition-opacity hover:bg-secondary/40 focus:outline-none focus-visible:ring-1",
|
||||
section.hidden && "opacity-50",
|
||||
)}
|
||||
>
|
||||
|
||||
@@ -244,7 +244,7 @@ export function SectionItem<T extends SectionItemType>({ type, item, title, subt
|
||||
<button
|
||||
onClick={onUpdate}
|
||||
className={cn(
|
||||
"flex flex-1 flex-col items-start justify-center space-y-0.5 pl-1.5 text-left opacity-100 transition-opacity hover:bg-secondary/40 focus:outline-none focus-visible:ring-1",
|
||||
"flex flex-1 flex-col items-start justify-center space-y-0.5 pl-1.5 text-start opacity-100 transition-opacity hover:bg-secondary/40 focus:outline-none focus-visible:ring-1",
|
||||
item.hidden && "opacity-50",
|
||||
)}
|
||||
>
|
||||
|
||||
@@ -47,7 +47,7 @@ export function ExportSectionBuilder() {
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={onDownloadJSON}
|
||||
className="h-auto gap-x-4 whitespace-normal p-4! text-left font-normal active:scale-98"
|
||||
className="h-auto gap-x-4 whitespace-normal p-4! text-start font-normal active:scale-98"
|
||||
>
|
||||
<FileJsIcon className="size-6 shrink-0" />
|
||||
<div className="flex flex-1 flex-col gap-y-1">
|
||||
@@ -65,7 +65,7 @@ export function ExportSectionBuilder() {
|
||||
variant="outline"
|
||||
disabled={isPrinting}
|
||||
onClick={onDownloadPDF}
|
||||
className="h-auto gap-x-4 whitespace-normal p-4! text-left font-normal active:scale-98"
|
||||
className="h-auto gap-x-4 whitespace-normal p-4! text-start font-normal active:scale-98"
|
||||
>
|
||||
{isPrinting ? (
|
||||
<CircleNotchIcon className="size-6 shrink-0 animate-spin" />
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { t } from "@lingui/core/macro";
|
||||
import { useLingui } from "@lingui/react";
|
||||
import { CircleNotchIcon, LockSimpleIcon } from "@phosphor-icons/react";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { Link } from "@tanstack/react-router";
|
||||
import { AnimatePresence, motion } from "motion/react";
|
||||
import { useMemo } from "react";
|
||||
import { match, P } from "ts-pattern";
|
||||
import { orpc, type RouterOutput } from "@/integrations/orpc/client";
|
||||
import { cn } from "@/utils/style";
|
||||
import { ResumeContextMenu } from "../menus/context-menu";
|
||||
@@ -14,6 +16,8 @@ type ResumeCardProps = {
|
||||
};
|
||||
|
||||
export function ResumeCard({ resume }: ResumeCardProps) {
|
||||
const { i18n } = useLingui();
|
||||
|
||||
const { data: screenshotData, isLoading } = useQuery(
|
||||
orpc.printer.getResumeScreenshot.queryOptions({ input: { id: resume.id } }),
|
||||
);
|
||||
@@ -21,24 +25,27 @@ export function ResumeCard({ resume }: ResumeCardProps) {
|
||||
const imageSrc = screenshotData?.url;
|
||||
|
||||
const updatedAt = useMemo(() => {
|
||||
return new Date(resume.updatedAt).toLocaleDateString();
|
||||
}, [resume.updatedAt]);
|
||||
return Intl.DateTimeFormat(i18n.locale, { dateStyle: "long", timeStyle: "short" }).format(resume.updatedAt);
|
||||
}, [i18n.locale, resume.updatedAt]);
|
||||
|
||||
return (
|
||||
<ResumeContextMenu resume={resume}>
|
||||
<Link to="/builder/$resumeId" params={{ resumeId: resume.id }} className="cursor-default">
|
||||
<BaseCard title={resume.name} description={t`Last updated on ${updatedAt}`} tags={resume.tags}>
|
||||
{isLoading || !imageSrc ? (
|
||||
<div className="flex size-full items-center justify-center">
|
||||
<CircleNotchIcon weight="thin" className="size-12 animate-spin" />
|
||||
</div>
|
||||
) : (
|
||||
<img
|
||||
src={imageSrc}
|
||||
alt={resume.name}
|
||||
className={cn("size-full object-cover transition-all", resume.isLocked && "blur-xs")}
|
||||
/>
|
||||
)}
|
||||
{match({ isLoading, imageSrc })
|
||||
.with({ isLoading: true }, () => (
|
||||
<div className="flex size-full items-center justify-center">
|
||||
<CircleNotchIcon weight="thin" className="size-12 animate-spin" />
|
||||
</div>
|
||||
))
|
||||
.with({ imageSrc: P.string }, () => (
|
||||
<img
|
||||
src={imageSrc}
|
||||
alt={resume.name}
|
||||
className={cn("size-full object-cover transition-all", resume.isLocked && "blur-xs")}
|
||||
/>
|
||||
))
|
||||
.otherwise(() => null)}
|
||||
|
||||
<ResumeLockOverlay isLocked={resume.isLocked} />
|
||||
</BaseCard>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { useLingui } from "@lingui/react";
|
||||
import { Trans } from "@lingui/react/macro";
|
||||
import { DotsThreeIcon, DownloadSimpleIcon, PlusIcon } from "@phosphor-icons/react";
|
||||
import { Link } from "@tanstack/react-router";
|
||||
@@ -32,7 +33,7 @@ export function ListView({ resumes }: Props) {
|
||||
size="lg"
|
||||
variant="ghost"
|
||||
tapScale={0.99}
|
||||
className="h-12 w-full justify-start gap-x-4 text-left"
|
||||
className="h-12 w-full justify-start gap-x-4 text-start"
|
||||
onClick={handleCreateResume}
|
||||
>
|
||||
<PlusIcon />
|
||||
@@ -56,7 +57,7 @@ export function ListView({ resumes }: Props) {
|
||||
size="lg"
|
||||
variant="ghost"
|
||||
tapScale={0.99}
|
||||
className="h-12 w-full justify-start gap-x-4 text-left"
|
||||
className="h-12 w-full justify-start gap-x-4 text-start"
|
||||
onClick={handleImportResume}
|
||||
>
|
||||
<DownloadSimpleIcon />
|
||||
@@ -90,9 +91,11 @@ export function ListView({ resumes }: Props) {
|
||||
}
|
||||
|
||||
function ResumeListItem({ resume }: { resume: Resume }) {
|
||||
const { i18n } = useLingui();
|
||||
|
||||
const updatedAt = useMemo(() => {
|
||||
return new Date(resume.updatedAt).toLocaleDateString();
|
||||
}, [resume.updatedAt]);
|
||||
return Intl.DateTimeFormat(i18n.locale, { dateStyle: "long", timeStyle: "short" }).format(resume.updatedAt);
|
||||
}, [i18n.locale, resume.updatedAt]);
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-x-2">
|
||||
@@ -101,7 +104,7 @@ function ResumeListItem({ resume }: { resume: Resume }) {
|
||||
size="lg"
|
||||
variant="ghost"
|
||||
tapScale={0.99}
|
||||
className="h-12 w-full flex-1 justify-start gap-x-4 text-left"
|
||||
className="h-12 w-full flex-1 justify-start gap-x-4 text-start"
|
||||
>
|
||||
<Link to="/builder/$resumeId" params={{ resumeId: resume.id }}>
|
||||
<div className="size-3" />
|
||||
|
||||
Reference in New Issue
Block a user