mirror of
https://github.com/whekin/household-bot.git
synced 2026-03-31 20:44:02 +00:00
refactor(miniapp): extract shell states and finance visuals
This commit is contained in:
20
apps/miniapp/src/components/session/blocked-state.tsx
Normal file
20
apps/miniapp/src/components/session/blocked-state.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import { HeroBanner } from '../layout/hero-banner'
|
||||
|
||||
type Props = {
|
||||
badge: string
|
||||
title: string
|
||||
body: string
|
||||
reloadLabel: string
|
||||
onReload: () => void
|
||||
}
|
||||
|
||||
export function BlockedState(props: Props) {
|
||||
return (
|
||||
<HeroBanner
|
||||
badges={[props.badge]}
|
||||
title={props.title}
|
||||
body={props.body}
|
||||
action={{ label: props.reloadLabel, onClick: props.onReload }}
|
||||
/>
|
||||
)
|
||||
}
|
||||
11
apps/miniapp/src/components/session/loading-state.tsx
Normal file
11
apps/miniapp/src/components/session/loading-state.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
import { HeroBanner } from '../layout/hero-banner'
|
||||
|
||||
type Props = {
|
||||
badge: string
|
||||
title: string
|
||||
body: string
|
||||
}
|
||||
|
||||
export function LoadingState(props: Props) {
|
||||
return <HeroBanner badges={[props.badge]} title={props.title} body={props.body} />
|
||||
}
|
||||
47
apps/miniapp/src/components/session/onboarding-state.tsx
Normal file
47
apps/miniapp/src/components/session/onboarding-state.tsx
Normal file
@@ -0,0 +1,47 @@
|
||||
import { Show } from 'solid-js'
|
||||
|
||||
import { Button } from '../ui'
|
||||
|
||||
type Props = {
|
||||
badge: string
|
||||
title: string
|
||||
body: string
|
||||
joinActionLabel: string
|
||||
joiningLabel: string
|
||||
joining: boolean
|
||||
canJoin: boolean
|
||||
botLinkLabel: string
|
||||
botLink: string | null
|
||||
reloadLabel: string
|
||||
onJoin: () => void
|
||||
onReload: () => void
|
||||
}
|
||||
|
||||
export function OnboardingState(props: Props) {
|
||||
return (
|
||||
<section class="hero-card">
|
||||
<div class="hero-card__meta">
|
||||
<span class="pill">{props.badge}</span>
|
||||
</div>
|
||||
<h2>{props.title}</h2>
|
||||
<p>{props.body}</p>
|
||||
<div class="nav-grid">
|
||||
<Show when={props.canJoin}>
|
||||
<Button variant="ghost" disabled={props.joining} onClick={props.onJoin}>
|
||||
{props.joining ? props.joiningLabel : props.joinActionLabel}
|
||||
</Button>
|
||||
</Show>
|
||||
<Show when={props.botLink}>
|
||||
{(link) => (
|
||||
<a class="ui-button ui-button--ghost" href={link()} target="_blank" rel="noreferrer">
|
||||
{props.botLinkLabel}
|
||||
</a>
|
||||
)}
|
||||
</Show>
|
||||
<Button variant="ghost" onClick={props.onReload}>
|
||||
{props.reloadLabel}
|
||||
</Button>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user