diff --git a/apps/web/src/features/resume/editor/design/template-group.tsx b/apps/web/src/features/resume/editor/design/template-group.tsx index bccb4b077..f4dde0630 100644 --- a/apps/web/src/features/resume/editor/design/template-group.tsx +++ b/apps/web/src/features/resume/editor/design/template-group.tsx @@ -7,7 +7,6 @@ import { t } from "@lingui/core/macro"; import { Trans } from "@lingui/react/macro"; import { useEffect, useId, useRef, useState } from "react"; import { templateLayouts } from "@reactive-resume/schema/templates"; -import { Alert, AlertDescription } from "@reactive-resume/ui/components/alert"; import { Icon } from "@reactive-resume/ui/components/icon"; import { SegmentedControl, SegmentedControlItem } from "@reactive-resume/ui/components/segmented-control"; import { Slider } from "@reactive-resume/ui/components/slider"; @@ -16,9 +15,7 @@ import { isRTL } from "@reactive-resume/utils/locale"; import { cn } from "@reactive-resume/utils/style"; import { templates } from "@/dialogs/resume/template/data"; import { useResumeData, useResumeStore, useUpdateResumeData } from "@/features/resume/builder/draft"; -import { getSectionTitle } from "@/libs/resume/section"; import { useEditorStore } from "../store"; -import { getOutlineRows } from "../write/model"; import { useTemplateThumbnail } from "./thumbnails"; type Filter = "all" | "one" | "two" | "ats"; @@ -209,44 +206,17 @@ function TemplateCard({ id, data, selected, onPreview }: TemplateCardProps) { type SidebarPanelProps = { data: ResumeData; template: Template }; -/** Two-column templates: the sidebar's side and width, which sections it holds, and the ATS caveat. */ +/** Two-column templates: the sidebar's side and width. Write moves sections between columns. */ function SidebarPanel({ data, template }: SidebarPanelProps) { const updateResumeData = useUpdateResumeData(); // The side the page shows now: the chosen one, else the template's own (mirrored on right-to-left pages). const ownSide = templateLayouts[template].sidebarSide ?? "left"; const shownOwnSide = isRTL(data.metadata.page.locale) ? (ownSide === "left" ? "right" : "left") : ownSide; const side = data.metadata.layout.sidebarSide ?? shownOwnSide; - const rows = getOutlineRows(data); const width = Math.min(42, Math.max(26, data.metadata.layout.sidebarWidth)); const titleId = useId(); const widthId = useId(); - const titleOf = (id: string) => { - const custom = data.customSections.find((section) => section.id === id); - if (custom) return custom.title || getSectionTitle(custom.type); - const section = id === "summary" ? data.summary : data.sections[id as keyof ResumeData["sections"]]; - return section?.title || getSectionTitle(id as never); - }; - - const toggle = (id: string) => - updateResumeData( - (draft) => { - for (const page of draft.metadata.layout.pages) { - if (page.sidebar.includes(id)) { - page.sidebar = page.sidebar.filter((section) => section !== id); - page.main.push(id); - return; - } - if (page.main.includes(id)) { - page.main = page.main.filter((section) => section !== id); - page.sidebar.push(id); - return; - } - } - }, - { newStep: true }, - ); - return (

@@ -295,37 +265,6 @@ function SidebarPanel({ data, template }: SidebarPanelProps) { } />

-
- - In the sidebar ยท tap to move - -
- {rows.map((row) => ( - - ))} -
-
- - - - - Some applicant tracking systems read columns out of order. Check mode shows the order they'll see. - - - ); }