fix(welcome): make WelcomeScreen support isCompact prop to prevent full-screen CSS clash when rendering inside saved-ID wrapper card in App.tsx
Per PLAN item 8. Saved users now get a clean compact welcome prompt without double min-h-screen divs.
This commit is contained in:
@@ -80,7 +80,7 @@ export default function App() {
|
|||||||
if (!identified && !loadingPrefs) {
|
if (!identified && !loadingPrefs) {
|
||||||
const savedId = localStorage.getItem('kira-user-id');
|
const savedId = localStorage.getItem('kira-user-id');
|
||||||
if (!savedId) {
|
if (!savedId) {
|
||||||
return <WelcomeScreen onComplete={handleWelcome} />;
|
return <WelcomeScreen onComplete={handleWelcome} isCompact />;
|
||||||
}
|
}
|
||||||
// Has saved ID but not identified yet — show welcome with their name
|
// Has saved ID but not identified yet — show welcome with their name
|
||||||
return (
|
return (
|
||||||
@@ -92,7 +92,7 @@ export default function App() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p className="text-kira-plum/60 text-sm">coming back? say your name to pick up where you left off</p>
|
<p className="text-kira-plum/60 text-sm">coming back? say your name to pick up where you left off</p>
|
||||||
<WelcomeScreen onComplete={handleWelcome} />
|
<WelcomeScreen onComplete={handleWelcome} isCompact />
|
||||||
</div>
|
</div>
|
||||||
<style>{`
|
<style>{`
|
||||||
@keyframes pulse-glow {
|
@keyframes pulse-glow {
|
||||||
|
|||||||
@@ -2,9 +2,10 @@ import { useState } from 'react';
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
onComplete: (name: string) => void;
|
onComplete: (name: string) => void;
|
||||||
|
isCompact?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function WelcomeScreen({ onComplete }: Props) {
|
export default function WelcomeScreen({ onComplete, isCompact = false }: Props) {
|
||||||
const [name, setName] = useState('');
|
const [name, setName] = useState('');
|
||||||
|
|
||||||
const handleSubmit = (e: React.FormEvent) => {
|
const handleSubmit = (e: React.FormEvent) => {
|
||||||
@@ -13,9 +14,8 @@ export default function WelcomeScreen({ onComplete }: Props) {
|
|||||||
if (trimmed) onComplete(trimmed);
|
if (trimmed) onComplete(trimmed);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
const content = (
|
||||||
<div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-kira-bg via-kira-glow to-kira-pink/20 p-4">
|
<>
|
||||||
<div className="glass-card max-w-md w-full p-8 text-center space-y-6">
|
|
||||||
{/* Avatar preview */}
|
{/* Avatar preview */}
|
||||||
<div className="flex justify-center">
|
<div className="flex justify-center">
|
||||||
<div className="w-20 h-20 rounded-full bg-gradient-to-br from-kira-pink via-kira-lav to-kira-mint p-1 animate-pulse-glow">
|
<div className="w-20 h-20 rounded-full bg-gradient-to-br from-kira-pink via-kira-lav to-kira-mint p-1 animate-pulse-glow">
|
||||||
@@ -61,8 +61,22 @@ export default function WelcomeScreen({ onComplete }: Props) {
|
|||||||
<p className="text-[10px] text-kira-plum/30">
|
<p className="text-[10px] text-kira-plum/30">
|
||||||
everything stays between us — your name, your preferences, your focus vibes
|
everything stays between us — your name, your preferences, your focus vibes
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</>
|
||||||
|
);
|
||||||
|
|
||||||
|
if (isCompact) {
|
||||||
|
return (
|
||||||
|
<div className="glass-card max-w-md w-full p-8 text-center space-y-6">
|
||||||
|
{content}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-kira-bg via-kira-glow to-kira-pink/20 p-4">
|
||||||
|
<div className="glass-card max-w-md w-full p-8 text-center space-y-6">
|
||||||
|
{content}
|
||||||
|
</div>
|
||||||
<style>{`
|
<style>{`
|
||||||
@keyframes pulse-glow {
|
@keyframes pulse-glow {
|
||||||
0%, 100% { box-shadow: 0 0 12px rgba(255,182,193,0.3); }
|
0%, 100% { box-shadow: 0 0 12px rgba(255,182,193,0.3); }
|
||||||
|
|||||||
Reference in New Issue
Block a user