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
Binary file not shown.
Binary file not shown.
+6 -10
View File
@@ -18,24 +18,20 @@ export function SiteCard({
const getBackground = (): string => { const getBackground = (): string => {
if (imagePath) return `url(${imagePath}) center/cover`; if (imagePath) return `url(${imagePath}) center/cover`;
if (isSituation) return "rgba(255, 255, 255, 0.42)"; if (disabled) return "rgba(255, 255, 255, 0.42)";
if (disabled) return "#b8b8b8"; return "#b8b8b8";
if (selected) return "#d9d9d9";
return "#e8e8e8";
}; };
const getBorder = (): string => { const getBorder = (): string => {
if (selected) return "3px solid #a8d5a2"; if (selected) return "3px solid #a8d5a2";
if (isSituation) return "3px solid rgba(255, 255, 255, 0.55)"; if (isSituation) return "3px solid rgba(255, 255, 255, 0.55)";
if (disabled) return "none"; if (disabled) return "3px solid rgba(255, 255, 255, 0.55)";
return "2px solid #ffffff"; return "3px solid rgba(255, 255, 255, 0.55)";
}; };
const getTextColor = (): string => { const getTextColor = (): string => {
if (isSituation && disabled) return "rgba(77, 77, 77, 0.72)"; if (disabled) return "rgba(77, 77, 77, 0.72)";
if (isSituation) return "#4d4d4d"; return "#4d4d4d";
if (disabled) return "#888888";
return "#666666";
}; };
return ( return (
+7 -12
View File
@@ -38,16 +38,12 @@ export function SiteNamingScreen(): React.JSX.Element {
inputRef.current?.focus(); inputRef.current?.focus();
}, []); }, []);
const handleKeyDown = useCallback( const handleNameChange = useCallback(
(e: React.KeyboardEvent<HTMLInputElement>): void => { (event: React.ChangeEvent<HTMLInputElement>): void => {
e.preventDefault(); const nextLength = Math.min(event.target.value.length, forcedName.length);
setCharIndex(nextLength);
// 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));
}
}, },
[isComplete, forcedName.length], [forcedName.length],
); );
const handleConfirm = (): void => { const handleConfirm = (): void => {
@@ -99,8 +95,7 @@ export function SiteNamingScreen(): React.JSX.Element {
ref={inputRef} ref={inputRef}
type="text" type="text"
value={displayValue} value={displayValue}
onKeyDown={handleKeyDown} onChange={handleNameChange}
readOnly
placeholder="Écrivez votre prénom ici" placeholder="Écrivez votre prénom ici"
style={{ style={{
display: "flex", display: "flex",
@@ -114,7 +109,7 @@ export function SiteNamingScreen(): React.JSX.Element {
background: "#D9D9D9", background: "#D9D9D9",
outline: "none", outline: "none",
color: "#333", color: "#333",
caretColor: "transparent", caretColor: "#333",
fontFamily: "Inter, system-ui, sans-serif", fontFamily: "Inter, system-ui, sans-serif",
fontSize: "clamp(16px, 2.5vw, 20px)", fontSize: "clamp(16px, 2.5vw, 20px)",
textAlign: "left", textAlign: "left",
+2 -2
View File
@@ -24,11 +24,11 @@ export const EXPERIENCE_CARDS: readonly SiteCardConfig[] = [
* Cards for screen 2: "Quelle est votre situation ?" * Cards for screen 2: "Quelle est votre situation ?"
*/ */
export const SITUATION_CARDS: readonly SiteCardConfig[] = [ 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-refugie-guerre", label: "Réfugié.e de guerre", disabled: true },
{ {
id: "sit-sans-domicile", id: "sit-sans-domicile",
label: "Sans domicile fixe", label: "Réfugié.e climatique",
disabled: false, disabled: false,
}, },
{ id: "sit-autre", label: "Autre", disabled: true }, { 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"); @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 */ /* Base document reset */
:root { :root {
color-scheme: dark; color-scheme: dark;