From 80bb4c94746d3d4d22ee3c7fb52483374c96c774 Mon Sep 17 00:00:00 2001 From: jeanGaston Date: Wed, 29 Jul 2026 20:32:32 +0200 Subject: [PATCH] chore: remove stale *.old.tsx backups and fix Button/Card casing in git The *.old.tsx files (page.old.tsx, layout.old.tsx, ManageClient.old.tsx, etc.) were pre-refactor backups left alongside their replacements, confirmed unreferenced by any import. Also fixes a latent git-tracking bug: since the very first baseline commit tracked these two files as Button.tsx/Card.tsx, and Windows' case-insensitive filesystem means a same-path case change isn't recorded as a rename by default, git's tree kept the capitalized path forever even after they were rewritten to shadcn's lowercase button.tsx/card.tsx content. This surfaced intermittently as a TS1261 "differs only in casing" build error whenever git re-checked-out the tree (e.g. after this branch's merge to master rewrote the working copy back to the capitalized path). Fixed with a two-hop git mv so the rename is actually recorded. Co-Authored-By: Claude Sonnet 5 --- src/app/create/CreateClient.old.tsx | 156 ----- src/app/create/page.old.tsx | 18 - src/app/layout.old.tsx | 44 -- src/app/manage/[token]/ManageClient.old.tsx | 409 ------------- src/app/not-found.old.tsx | 22 - src/app/p/[slug]/ProposalPageClient.old.tsx | 566 ------------------ src/app/page.old.tsx | 50 -- src/components/Footer.old.tsx | 44 -- src/components/LoveFusion.old.tsx | 83 --- src/components/ProposalForm.old.tsx | 581 ------------------- src/components/ui/{Button.tsx => button.tsx} | 0 src/components/ui/{Card.tsx => card.tsx} | 0 12 files changed, 1973 deletions(-) delete mode 100644 src/app/create/CreateClient.old.tsx delete mode 100644 src/app/create/page.old.tsx delete mode 100644 src/app/layout.old.tsx delete mode 100644 src/app/manage/[token]/ManageClient.old.tsx delete mode 100644 src/app/not-found.old.tsx delete mode 100644 src/app/p/[slug]/ProposalPageClient.old.tsx delete mode 100644 src/app/page.old.tsx delete mode 100644 src/components/Footer.old.tsx delete mode 100644 src/components/LoveFusion.old.tsx delete mode 100644 src/components/ProposalForm.old.tsx rename src/components/ui/{Button.tsx => button.tsx} (100%) rename src/components/ui/{Card.tsx => card.tsx} (100%) diff --git a/src/app/create/CreateClient.old.tsx b/src/app/create/CreateClient.old.tsx deleted file mode 100644 index eb59163..0000000 --- a/src/app/create/CreateClient.old.tsx +++ /dev/null @@ -1,156 +0,0 @@ -'use client'; - -import { useState } from 'react'; -import Link from 'next/link'; -import ProposalForm, { type ProposalFormData } from '@/components/ProposalForm'; -import { generateKey, encryptField, encryptOptional } from '@/lib/crypto-client'; - -interface Links { - publicUrl: string; - manageUrl: string; -} - -// Encrypts every personal/narrative field client-side before it ever reaches -// the network; the server only ever receives and stores ciphertext. The key -// itself is generated here and never sent to the server; it only travels in -// the URL fragment of the links shown to the user. -async function encryptPayload(key: string, data: ProposalFormData) { - const activities = await Promise.all( - data.activities.map(async (a) => ({ - title: await encryptField(key, a.title), - description: await encryptOptional(key, a.description), - emoji: a.emoji, - slots: await Promise.all( - a.slots.map(async (s) => ({ - label: await encryptField(key, s.label), - startsAt: await encryptOptional(key, s.startsAt), - })) - ), - })) - ); - - return { - senderName: await encryptField(key, data.senderName), - recipientName: await encryptField(key, data.recipientName), - title: await encryptField(key, data.title), - message: await encryptField(key, data.message), - theme: data.theme, - gradientFrom: data.gradientFrom, - gradientVia: data.gradientVia, - gradientTo: data.gradientTo, - gifUrl: await encryptOptional(key, data.gifUrl), - evasiveNo: data.evasiveNo, - activities, - }; -} - -export default function CreateClient() { - const [links, setLinks] = useState(null); - const [error, setError] = useState(''); - const [copiedPublic, setCopiedPublic] = useState(false); - const [copiedManage, setCopiedManage] = useState(false); - - async function handleSubmit(data: ProposalFormData, _publish: boolean) { - setError(''); - const key = await generateKey(); - const payload = await encryptPayload(key, data); - const res = await fetch('/api/proposals/guest', { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify(payload), - }); - const json = await res.json(); - if (!res.ok) { - setError('Something went wrong. Please check your inputs and try again.'); - return; - } - setLinks({ - publicUrl: `${json.publicUrl}#k=${key}`, - manageUrl: `${json.manageUrl}#k=${key}`, - }); - } - - function copyLink(url: string, which: 'public' | 'manage') { - navigator.clipboard.writeText(url); - if (which === 'public') { setCopiedPublic(true); setTimeout(() => setCopiedPublic(false), 2000); } - else { setCopiedManage(true); setTimeout(() => setCopiedManage(false), 2000); } - } - - if (links) { - return ( -
-
๐ŸŽ‰
-
-

Your proposal is ready!

-

Share the first link, keep the second one private.

-
- -
- copyLink(links.publicUrl, 'public')} - highlight - /> - copyLink(links.manageUrl, 'manage')} - /> -
- -

- Want to create another one?{' '} - - Make a new proposal โ†’ - -

-
- ); - } - - return ; -} - -function LinkBox({ - emoji, label, sublabel, url, copied, onCopy, highlight, -}: { - emoji: string; label: string; sublabel: string; url: string; - copied: boolean; onCopy: () => void; highlight?: boolean; -}) { - return ( -
-
- {emoji} -
-

{label}

-

{sublabel}

-
-
-
- - -
- - {url} - -
- ); -} diff --git a/src/app/create/page.old.tsx b/src/app/create/page.old.tsx deleted file mode 100644 index cce79c6..0000000 --- a/src/app/create/page.old.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import CreateClient from './CreateClient'; - -export const metadata = { title: 'Create a proposal, no account needed' }; - -export default function CreatePage() { - return ( -
-
-
-
๐Ÿ’Œ
-

Create your proposal

-

No account needed, you get two private links when you're done.

-
- -
-
- ); -} diff --git a/src/app/layout.old.tsx b/src/app/layout.old.tsx deleted file mode 100644 index f15febc..0000000 --- a/src/app/layout.old.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import type { Metadata, Viewport } from 'next'; -import { Inter, Poppins } from 'next/font/google'; -import Footer from '@/components/Footer'; -import './globals.css'; - -const inter = Inter({ subsets: ['latin'], variable: '--font-inter' }); -const poppins = Poppins({ - subsets: ['latin'], - weight: ['400', '600', '700', '800'], - variable: '--font-poppins', -}); - -export const metadata: Metadata = { - title: { default: 'lovelope.app', template: '%s | lovelope.app' }, - description: 'The adorable way to ask someone out', - manifest: '/manifest.webmanifest', - appleWebApp: { - capable: true, - statusBarStyle: 'default', - title: 'lovelope.app', - }, - openGraph: { - title: 'lovelope.app', - description: 'The adorable way to ask someone out', - type: 'website', - }, -}; - -export const viewport: Viewport = { - themeColor: '#ec4899', - width: 'device-width', - initialScale: 1, -}; - -export default function RootLayout({ children }: { children: React.ReactNode }) { - return ( - - -
{children}
-