fix(site): unified card styles, import Nersans One font, native naming input
🔍 Lint / 🪄 Check lint (pull_request) Has been cancelled
🔍 Lint / 🎨 Check format (pull_request) Has been cancelled
🔍 Lint / 🔎 Typecheck (pull_request) Has been cancelled
📊 Quality / 🔒 Security Audit (pull_request) Has been cancelled
📊 Quality / 📋 Dependency Freshness (pull_request) Has been cancelled
📊 Quality / 📦 Bundle Size (pull_request) Has been cancelled
🔍 Lint / 🏗 Build (pull_request) Has been cancelled

This commit is contained in:
Tom Boullay
2026-05-30 17:56:42 +02:00
parent 29342d796c
commit 6ae21a2427
6 changed files with 25 additions and 24 deletions
+6 -10
View File
@@ -18,24 +18,20 @@ export function SiteCard({
const getBackground = (): string => {
if (imagePath) return `url(${imagePath}) center/cover`;
if (isSituation) return "rgba(255, 255, 255, 0.42)";
if (disabled) return "#b8b8b8";
if (selected) return "#d9d9d9";
return "#e8e8e8";
if (disabled) return "rgba(255, 255, 255, 0.42)";
return "#b8b8b8";
};
const getBorder = (): string => {
if (selected) return "3px solid #a8d5a2";
if (isSituation) return "3px solid rgba(255, 255, 255, 0.55)";
if (disabled) return "none";
return "2px solid #ffffff";
if (disabled) return "3px solid rgba(255, 255, 255, 0.55)";
return "3px solid rgba(255, 255, 255, 0.55)";
};
const getTextColor = (): string => {
if (isSituation && disabled) return "rgba(77, 77, 77, 0.72)";
if (isSituation) return "#4d4d4d";
if (disabled) return "#888888";
return "#666666";
if (disabled) return "rgba(77, 77, 77, 0.72)";
return "#4d4d4d";
};
return (
+7 -12
View File
@@ -38,16 +38,12 @@ export function SiteNamingScreen(): React.JSX.Element {
inputRef.current?.focus();
}, []);
const handleKeyDown = useCallback(
(e: React.KeyboardEvent<HTMLInputElement>): void => {
e.preventDefault();
// Only process if not complete and it's a letter key
if (!isComplete && e.key.length === 1 && /[a-zA-Z]/.test(e.key)) {
setCharIndex((prev) => Math.min(prev + 1, forcedName.length));
}
const handleNameChange = useCallback(
(event: React.ChangeEvent<HTMLInputElement>): void => {
const nextLength = Math.min(event.target.value.length, forcedName.length);
setCharIndex(nextLength);
},
[isComplete, forcedName.length],
[forcedName.length],
);
const handleConfirm = (): void => {
@@ -99,8 +95,7 @@ export function SiteNamingScreen(): React.JSX.Element {
ref={inputRef}
type="text"
value={displayValue}
onKeyDown={handleKeyDown}
readOnly
onChange={handleNameChange}
placeholder="Écrivez votre prénom ici"
style={{
display: "flex",
@@ -114,7 +109,7 @@ export function SiteNamingScreen(): React.JSX.Element {
background: "#D9D9D9",
outline: "none",
color: "#333",
caretColor: "transparent",
caretColor: "#333",
fontFamily: "Inter, system-ui, sans-serif",
fontSize: "clamp(16px, 2.5vw, 20px)",
textAlign: "left",
+2 -2
View File
@@ -24,11 +24,11 @@ export const EXPERIENCE_CARDS: readonly SiteCardConfig[] = [
* Cards for screen 2: "Quelle est votre situation ?"
*/
export const SITUATION_CARDS: readonly SiteCardConfig[] = [
{ id: "sit-refugie-climat", label: "Réfugié.e climatique", disabled: true },
{ id: "sit-refugie-climat", label: "Sans domicile fixe", disabled: true },
{ id: "sit-refugie-guerre", label: "Réfugié.e de guerre", disabled: true },
{
id: "sit-sans-domicile",
label: "Sans domicile fixe",
label: "Réfugié.e climatique",
disabled: false,
},
{ id: "sit-autre", label: "Autre", disabled: true },
+10
View File
@@ -1,5 +1,15 @@
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");
@font-face {
font-family: "Nersans One";
src:
url("/fonts/NersansOne.woff2") format("woff2"),
url("/fonts/NersansOne.woff") format("woff");
font-weight: 400;
font-style: normal;
font-display: swap;
}
/* Base document reset */
:root {
color-scheme: dark;