Files
si-no-o-indiferente/frontend/src/screens/NarratorView.tsx
T
dasemu 2681039074 Rename game, redesign UI as a noir case-file, simplify narrator flow
Renames the game to "Sí, no, o indiferente" across the app, README,
Capacitor config and Android strings. Replaces the dark-purple theme
with a distinct case-file/dossier look (monospace type, black/cream/red
palette, stamped difficulty badges, stacked-card shadows). Removes the
progressive hint system and the two-step solution confirmation: the
narrator's solution is now always rendered, gated only by a blur
show/hide toggle with a "Confidencial" stamp. Adds a back button from
the narrator screen to the picker (without marking the story as used),
drops dev-facing cruft (story source/count badge), converts remaining
UI copy to Peninsular Spanish, and adds a post-game screen where players
can optionally rate a story's difficulty (1-5), sent to the new backend
ratings endpoint.
2026-08-24 04:53:25 +02:00

44 lines
1.3 KiB
TypeScript

import { useState } from "react";
import type { Story } from "../types";
interface NarratorViewProps {
story: Story;
onFinish: () => void;
onBack: () => void;
}
export default function NarratorView({ story, onFinish, onBack }: NarratorViewProps) {
const [solutionHidden, setSolutionHidden] = useState(true);
return (
<section className="screen narrator">
<header className="narrator-header">
<button className="ghost" onClick={onBack}>
← Volver
</button>
<h2>{story.title}</h2>
</header>
<div className="teaser-card">
<h3>Enigma</h3>
<p>{story.teaser}</p>
</div>
<div className="solution-card">
<div className="solution-card-header">
<h3>Solución completa</h3>
<button className="icon-toggle" onClick={() => setSolutionHidden((v) => !v)}>
{solutionHidden ? "Mostrar" : "Ocultar"}
</button>
</div>
<p className={solutionHidden ? "solution-text is-hidden" : "solution-text"}>{story.solution}</p>
{solutionHidden && <span className="confidential-stamp">Confidencial</span>}
</div>
<button className="primary" onClick={onFinish}>
Terminar historia y volver
</button>
</section>
);
}