diff --git a/src/App.tsx b/src/App.tsx index 0dc25d0..8b862bd 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -72,8 +72,8 @@ export function App() { return ( ( - - + + Error: {err?.message ?? String(err)} {"\n"} Press a number key (1-6) to switch tabs. diff --git a/src/components/CodeValidation.tsx b/src/components/CodeValidation.tsx index 757f0e7..a7481ec 100644 --- a/src/components/CodeValidation.tsx +++ b/src/components/CodeValidation.tsx @@ -6,6 +6,7 @@ import { createSignal } from "solid-js"; import { useAuthStore } from "@/stores/auth"; import { AUTH_CONFIG } from "@/config/auth"; +import { useTheme } from "@/context/ThemeContext"; interface CodeValidationProps { focused?: boolean; @@ -16,6 +17,7 @@ type FocusField = "code" | "submit" | "back"; export function CodeValidation(props: CodeValidationProps) { const auth = useAuthStore(); + const { theme } = useTheme(); const [code, setCode] = createSignal(""); const [focusField, setFocusField] = createSignal("code"); const [codeError, setCodeError] = createSignal(null); @@ -98,32 +100,32 @@ export function CodeValidation(props: CodeValidationProps) { }; return ( - - + + Enter Sync Code - + Enter your 8-character sync code to link your account. - You can get this code from the web portal. + You can get this code from the web portal. {/* Code display */} - - Code ({codeProgress()}): - + + Code ({codeProgress()}): + - + {codeDisplay()} @@ -139,7 +141,7 @@ export function CodeValidation(props: CodeValidationProps) { width={30} /> - {codeError() && {codeError()}} + {codeError() && {codeError()}} @@ -149,9 +151,9 @@ export function CodeValidation(props: CodeValidationProps) { - + {auth.isLoading ? "Validating..." : "[Enter] Validate Code"} @@ -159,20 +161,20 @@ export function CodeValidation(props: CodeValidationProps) { - + [Esc] Back to Login {/* Auth error message */} - {auth.error && {auth.error.message}} + {auth.error && {auth.error.message}} - Tab to navigate, Enter to select, Esc to go back + Tab to navigate, Enter to select, Esc to go back ); } diff --git a/src/pages/Discover/DiscoverPage.tsx b/src/pages/Discover/DiscoverPage.tsx index cab0284..cdba416 100644 --- a/src/pages/Discover/DiscoverPage.tsx +++ b/src/pages/Discover/DiscoverPage.tsx @@ -66,7 +66,7 @@ export function DiscoverPage(props: PageProps) { backgroundColor={isSelected() ? theme.accent : undefined} onMouseDown={() => handleCategorySelect(category.id)} > - + {category.icon} {category.name} @@ -83,7 +83,7 @@ export function DiscoverPage(props: PageProps) { > Trending in{" "} {DISCOVER_CATEGORIES.find( @@ -96,9 +96,9 @@ export function DiscoverPage(props: PageProps) { fallback={ {discoverStore.filteredPodcasts().length !== 0 ? ( - Loading trending shows... + Loading trending shows... ) : ( - No podcasts found in this category. + No podcasts found in this category. )} } diff --git a/src/pages/Discover/PodcastCard.tsx b/src/pages/Discover/PodcastCard.tsx index 11e8fc6..ef4931e 100644 --- a/src/pages/Discover/PodcastCard.tsx +++ b/src/pages/Discover/PodcastCard.tsx @@ -4,6 +4,7 @@ import { Show, For } from "solid-js"; import type { Podcast } from "@/types/podcast"; +import { useTheme } from "@/context/ThemeContext"; type PodcastCardProps = { podcast: Podcast; @@ -14,6 +15,7 @@ type PodcastCardProps = { }; export function PodcastCard(props: PodcastCardProps) { + const { theme } = useTheme(); const handleSubscribeClick = () => { props.onSubscribe?.(); }; @@ -22,28 +24,28 @@ export function PodcastCard(props: PodcastCardProps) { {/* Title Row */} - - {props.podcast.title} - + + {props.podcast.title} + - [+] + [+] {/* Author */} - by {props.podcast.author} + by {props.podcast.author} {/* Description */} - + {props.podcast.description!.length > 80 ? props.podcast.description!.slice(0, 80) + "..." : props.podcast.description} @@ -59,14 +61,14 @@ export function PodcastCard(props: PodcastCardProps) { 0}> - {(cat) => [{cat}]} + {(cat) => [{cat}]} - + {props.podcast.isSubscribed ? "[Unsubscribe]" : "[Subscribe]"} diff --git a/src/pages/Feed/FeedDetail.tsx b/src/pages/Feed/FeedDetail.tsx index 891bed6..dd3205e 100644 --- a/src/pages/Feed/FeedDetail.tsx +++ b/src/pages/Feed/FeedDetail.tsx @@ -8,6 +8,7 @@ import { useKeyboard } from "@opentui/solid"; import type { Feed } from "@/types/feed"; import type { Episode } from "@/types/episode"; import { format } from "date-fns"; +import { useTheme } from "@/context/ThemeContext"; interface FeedDetailProps { feed: Feed; @@ -17,6 +18,7 @@ interface FeedDetailProps { } export function FeedDetail(props: FeedDetailProps) { + const { theme } = useTheme(); const [selectedIndex, setSelectedIndex] = createSignal(0); const [showInfo, setShowInfo] = createSignal(true); @@ -82,45 +84,45 @@ export function FeedDetail(props: FeedDetailProps) { {/* Header with back button */} - - [Esc] Back + + [Esc] Back - setShowInfo((v) => !v)}> - [i] {showInfo() ? "Hide" : "Show"} Info + setShowInfo((v) => !v)} borderColor={theme.border}> + [i] {showInfo() ? "Hide" : "Show"} Info {/* Podcast info section */} - - + + {props.feed.customName || props.feed.podcast.title} {props.feed.podcast.author && ( - by - {props.feed.podcast.author} + by + {props.feed.podcast.author} )} - + {props.feed.podcast.description?.slice(0, 200)} {(props.feed.podcast.description?.length || 0) > 200 ? "..." : ""} - Episodes: - {props.feed.episodes.length} + Episodes: + {props.feed.episodes.length} - Updated: - {formatDate(props.feed.lastUpdated)} + Updated: + {formatDate(props.feed.lastUpdated)} - + {props.feed.visibility === "public" ? "[Public]" : "[Private]"} - {props.feed.isPinned && [Pinned]} + {props.feed.isPinned && [Pinned]} @@ -141,7 +143,7 @@ export function FeedDetail(props: FeedDetailProps) { flexDirection="column" gap={0} padding={1} - backgroundColor={index() === selectedIndex() ? "#333" : undefined} + backgroundColor={index() === selectedIndex() ? theme.backgroundElement : undefined} onMouseDown={() => { setSelectedIndex(index()); if (props.onPlayEpisode) { @@ -150,17 +152,17 @@ export function FeedDetail(props: FeedDetailProps) { }} > - - {index() === selectedIndex() ? ">" : " "} - - - {episode.episodeNumber ? `#${episode.episodeNumber} - ` : ""} - {episode.title} - + + {index() === selectedIndex() ? ">" : " "} + + + {episode.episodeNumber ? `#${episode.episodeNumber} - ` : ""} + {episode.title} + - {formatDate(episode.pubDate)} - {formatDuration(episode.duration)} + {formatDate(episode.pubDate)} + {formatDuration(episode.duration)} )} @@ -168,7 +170,7 @@ export function FeedDetail(props: FeedDetailProps) { {/* Help text */} - + j/k to navigate, Enter to play, i to toggle info, Esc to go back diff --git a/src/pages/Feed/FeedFilter.tsx b/src/pages/Feed/FeedFilter.tsx index 666f455..20135a2 100644 --- a/src/pages/Feed/FeedFilter.tsx +++ b/src/pages/Feed/FeedFilter.tsx @@ -6,6 +6,7 @@ import { createSignal } from "solid-js"; import { FeedVisibility, FeedSortField } from "@/types/feed"; import type { FeedFilter } from "@/types/feed"; +import { useTheme } from "@/context/ThemeContext"; interface FeedFilterProps { filter: FeedFilter; @@ -16,6 +17,7 @@ interface FeedFilterProps { type FilterField = "visibility" | "sort" | "pinned" | "search"; export function FeedFilterComponent(props: FeedFilterProps) { + const { theme } = useTheme(); const [focusField, setFocusField] = createSignal("visibility"); const [searchValue, setSearchValue] = createSignal( props.filter.searchQuery || "", @@ -89,9 +91,9 @@ export function FeedFilterComponent(props: FeedFilterProps) { const visibilityColor = () => { const vis = props.filter.visibility; - if (vis === "public") return "green"; - if (vis === "private") return "yellow"; - return "white"; + if (vis === "public") return theme.success; + if (vis === "private") return theme.warning; + return theme.text; }; const sortLabel = () => { @@ -110,8 +112,8 @@ export function FeedFilterComponent(props: FeedFilterProps) { }; return ( - - + + Filter Feeds @@ -120,10 +122,11 @@ export function FeedFilterComponent(props: FeedFilterProps) { - + Show: {visibilityLabel()} @@ -134,11 +137,11 @@ export function FeedFilterComponent(props: FeedFilterProps) { - Sort: - {sortLabel()} + Sort: + {sortLabel()} @@ -146,13 +149,13 @@ export function FeedFilterComponent(props: FeedFilterProps) { - + Pinned: - + {props.filter.pinnedOnly ? "Yes" : "No"} @@ -161,7 +164,7 @@ export function FeedFilterComponent(props: FeedFilterProps) { {/* Search box */} - Search: + Search: - Tab to navigate, Enter/Space to toggle + Tab to navigate, Enter/Space to toggle ); } diff --git a/src/pages/Feed/FeedItem.tsx b/src/pages/Feed/FeedItem.tsx index 02d2a96..20a87c7 100644 --- a/src/pages/Feed/FeedItem.tsx +++ b/src/pages/Feed/FeedItem.tsx @@ -31,12 +31,13 @@ export function FeedItem(props: FeedItemProps) { }; const visibilityColor = () => { - return props.feed.visibility === "public" ? "green" : "yellow"; + return props.feed.visibility === "public" ? theme.success : theme.warning; }; const pinnedIndicator = () => { return props.feed.isPinned ? "*" : " "; }; + const { theme } = useTheme(); if (props.compact) { @@ -45,18 +46,18 @@ export function FeedItem(props: FeedItemProps) { - - {props.isSelected ? ">" : " "} - - {visibilityIcon()} - - {props.feed.customName || props.feed.podcast.title} - - {props.showEpisodeCount && ({episodeCount()})} + backgroundColor={props.isSelected ? theme.backgroundElement : undefined} + paddingLeft={1} + paddingRight={1} + > + + {props.isSelected ? ">" : " "} + + {visibilityIcon()} + + {props.feed.customName || props.feed.podcast.title} + + {props.showEpisodeCount && ({episodeCount()})} ); } @@ -67,18 +68,18 @@ export function FeedItem(props: FeedItemProps) { flexDirection="column" gap={0} border={props.isSelected} - borderColor={props.isSelected ? "cyan" : undefined} - backgroundColor={props.isSelected ? "#222" : undefined} + borderColor={props.isSelected ? theme.primary : undefined} + backgroundColor={props.isSelected ? theme.backgroundElement : undefined} padding={1} > {/* Title row */} - + {props.isSelected ? ">" : " "} {visibilityIcon()} - {pinnedIndicator()} - + {pinnedIndicator()} + {props.feed.customName || props.feed.podcast.title} @@ -87,18 +88,18 @@ export function FeedItem(props: FeedItemProps) { {props.showEpisodeCount && ( - + {episodeCount()} episodes ({unplayedCount()} new) )} {props.showLastUpdated && ( - Updated: {formatDate(props.feed.lastUpdated)} + Updated: {formatDate(props.feed.lastUpdated)} )} {props.feed.podcast.description && ( - + {props.feed.podcast.description.slice(0, 60)} {props.feed.podcast.description.length > 60 ? "..." : ""} diff --git a/src/pages/Feed/FeedList.tsx b/src/pages/Feed/FeedList.tsx index 8b6c3b5..6d9fe4b 100644 --- a/src/pages/Feed/FeedList.tsx +++ b/src/pages/Feed/FeedList.tsx @@ -9,6 +9,7 @@ import { FeedItem } from "./FeedItem"; import { useFeedStore } from "@/stores/feed"; import { FeedVisibility, FeedSortField } from "@/types/feed"; import type { Feed } from "@/types/feed"; +import { useTheme } from "@/context/ThemeContext"; interface FeedListProps { focused?: boolean; @@ -21,6 +22,7 @@ interface FeedListProps { } export function FeedList(props: FeedListProps) { + const { theme } = useTheme(); const feedStore = useFeedStore(); const [selectedIndex, setSelectedIndex] = createSignal(0); @@ -136,26 +138,26 @@ export function FeedList(props: FeedListProps) { {/* Header with filter controls */} - + My Feeds - ({filteredFeeds().length} feeds) - - - [f] {visibilityLabel()} - - - [s] {sortLabel()} - - + ({filteredFeeds().length} feeds) + + + [f] {visibilityLabel()} + + + [s] {sortLabel()} + + {/* Feed list in scrollbox */} 0} fallback={ - - + + No feeds found. Add podcasts from the Discover or Search tabs. @@ -180,9 +182,9 @@ export function FeedList(props: FeedListProps) { {/* Navigation help */} - - Enter open | Esc up | j/k navigate | p pin | f filter | s sort - + + Enter open | Esc up | j/k navigate | p pin | f filter | s sort + ); diff --git a/src/pages/Feed/FeedPage.tsx b/src/pages/Feed/FeedPage.tsx index 2292885..9c40ebe 100644 --- a/src/pages/Feed/FeedPage.tsx +++ b/src/pages/Feed/FeedPage.tsx @@ -50,14 +50,14 @@ export function FeedPage(props: PageProps) { > {/* Status line */} - Refreshing feeds... + Refreshing feeds... 0} fallback={ - + No episodes yet. Subscribe to shows from Discover or Search. @@ -75,22 +75,22 @@ export function FeedPage(props: PageProps) { paddingTop={0} paddingBottom={0} backgroundColor={ - index() === selectedIndex() ? "#333" : undefined + index() === selectedIndex() ? theme.backgroundElement : undefined } onMouseDown={() => setSelectedIndex(index())} > - + {index() === selectedIndex() ? ">" : " "} - + {item.episode.title} - {item.feed.podcast.title} - {formatDate(item.episode.pubDate)} - {formatDuration(item.episode.duration)} + {item.feed.podcast.title} + {formatDate(item.episode.pubDate)} + {formatDuration(item.episode.duration)} )} diff --git a/src/pages/Player/PlaybackControls.tsx b/src/pages/Player/PlaybackControls.tsx index 93e8256..0e7bf33 100644 --- a/src/pages/Player/PlaybackControls.tsx +++ b/src/pages/Player/PlaybackControls.tsx @@ -1,4 +1,5 @@ import type { BackendName } from "../utils/audio-player" +import { useTheme } from "@/context/ThemeContext" type PlaybackControlsProps = { isPlaying: boolean @@ -22,39 +23,40 @@ const BACKEND_LABELS: Record = { } export function PlaybackControls(props: PlaybackControlsProps) { + const { theme } = useTheme(); return ( - - - [Prev] + + + [Prev] - - {props.isPlaying ? "[Pause]" : "[Play]"} + + {props.isPlaying ? "[Pause]" : "[Play]"} - - [Next] + + [Next] - Vol - {Math.round(props.volume * 100)}% + Vol + {Math.round(props.volume * 100)}% - Speed - {props.speed}x + Speed + {props.speed}x {props.backendName && props.backendName !== "none" && ( - via - {BACKEND_LABELS[props.backendName]} + via + {BACKEND_LABELS[props.backendName]} )} {props.backendName === "none" && ( - No audio player found + No audio player found )} {props.hasAudioUrl === false && ( - No audio URL + No audio URL )} diff --git a/src/pages/Search/ResultCard.tsx b/src/pages/Search/ResultCard.tsx index 5cc09be..5f6f060 100644 --- a/src/pages/Search/ResultCard.tsx +++ b/src/pages/Search/ResultCard.tsx @@ -1,6 +1,7 @@ import { Show } from "solid-js"; import type { SearchResult } from "@/types/source"; import { SourceBadge } from "./SourceBadge"; +import { useTheme } from "@/context/ThemeContext"; type ResultCardProps = { result: SearchResult; @@ -10,6 +11,7 @@ type ResultCardProps = { }; export function ResultCard(props: ResultCardProps) { + const { theme } = useTheme(); const podcast = () => props.result.podcast; return ( @@ -17,8 +19,8 @@ export function ResultCard(props: ResultCardProps) { flexDirection="column" padding={1} border={props.selected} - borderColor={props.selected ? "cyan" : undefined} - backgroundColor={props.selected ? "#222" : undefined} + borderColor={props.selected ? theme.primary : undefined} + backgroundColor={props.selected ? theme.backgroundElement : undefined} onMouseDown={props.onSelect} > - - {podcast().title} - + + {podcast().title} + - [Subscribed] + [Subscribed] - by {podcast().author} + by {podcast().author} {(description) => ( - + {description().length > 120 ? description().slice(0, 120) + "..." : description()} @@ -58,7 +60,7 @@ export function ResultCard(props: ResultCardProps) { 0}> {(podcast().categories ?? []).slice(0, 3).map((category) => ( - [{category}] + [{category}] ))} @@ -75,7 +77,7 @@ export function ResultCard(props: ResultCardProps) { props.onSubscribe?.(); }} > - [+] Add to Feeds + [+] Add to Feeds diff --git a/src/pages/Search/ResultDetail.tsx b/src/pages/Search/ResultDetail.tsx index b61e47d..531cc67 100644 --- a/src/pages/Search/ResultDetail.tsx +++ b/src/pages/Search/ResultDetail.tsx @@ -2,6 +2,7 @@ import { Show } from "solid-js"; import { format } from "date-fns"; import type { SearchResult } from "@/types/source"; import { SourceBadge } from "./SourceBadge"; +import { useTheme } from "@/context/ThemeContext"; type ResultDetailProps = { result?: SearchResult; @@ -9,15 +10,16 @@ type ResultDetailProps = { }; export function ResultDetail(props: ResultDetailProps) { + const { theme } = useTheme(); return ( - + Select a result to see details.} + fallback={ Select a result to see details.} > {(result) => ( <> - + {result().podcast.title} @@ -28,24 +30,24 @@ export function ResultDetail(props: ResultDetailProps) { /> - by {result().podcast.author} + by {result().podcast.author} - {result().podcast.description} + {result().podcast.description} 0}> {(result().podcast.categories ?? []).map((category) => ( - [{category}] + [{category}] ))} - Feed: {result().podcast.feedUrl} + Feed: {result().podcast.feedUrl} - + Updated: {format(result().podcast.lastUpdated, "MMM d, yyyy")} @@ -58,12 +60,12 @@ export function ResultDetail(props: ResultDetailProps) { width={18} onMouseDown={() => props.onSubscribe?.(result())} > - [+] Add to Feeds + [+] Add to Feeds - Already subscribed + Already subscribed )} diff --git a/src/pages/Search/SearchHistory.tsx b/src/pages/Search/SearchHistory.tsx index d8e36dd..6b3d338 100644 --- a/src/pages/Search/SearchHistory.tsx +++ b/src/pages/Search/SearchHistory.tsx @@ -3,6 +3,7 @@ */ import { For, Show } from "solid-js" +import { useTheme } from "@/context/ThemeContext" type SearchHistoryProps = { history: string[] @@ -15,6 +16,7 @@ type SearchHistoryProps = { } export function SearchHistory(props: SearchHistoryProps) { + const { theme } = useTheme(); const handleSearchClick = (index: number, query: string) => { props.onChange?.(index) props.onSelect?.(query) @@ -27,19 +29,19 @@ export function SearchHistory(props: SearchHistoryProps) { return ( - Recent Searches - 0}> - props.onClear?.()} padding={0}> - [Clear All] - - + Recent Searches + 0}> + props.onClear?.()} padding={0}> + [Clear All] + + 0} fallback={ - No recent searches + No recent searches } > @@ -56,15 +58,15 @@ export function SearchHistory(props: SearchHistoryProps) { padding={0} paddingLeft={1} paddingRight={1} - backgroundColor={isSelected() ? "#333" : undefined} + backgroundColor={isSelected() ? theme.backgroundElement : undefined} onMouseDown={() => handleSearchClick(index(), query)} > - {">"} - {query} + {">"} + {query} handleRemoveClick(query)} padding={0}> - [x] + [x] ) diff --git a/src/pages/Search/SourceBadge.tsx b/src/pages/Search/SourceBadge.tsx index 6f65b2a..fc90246 100644 --- a/src/pages/Search/SourceBadge.tsx +++ b/src/pages/Search/SourceBadge.tsx @@ -1,4 +1,5 @@ import { SourceType } from "@/types/source"; +import { useTheme } from "@/context/ThemeContext"; type SourceBadgeProps = { sourceId: string; @@ -14,21 +15,29 @@ const typeLabel = (sourceType?: SourceType) => { }; const typeColor = (sourceType?: SourceType) => { - if (sourceType === SourceType.API) return "cyan"; - if (sourceType === SourceType.RSS) return "green"; - if (sourceType === SourceType.CUSTOM) return "yellow"; - return "gray"; + if (sourceType === SourceType.API) return theme.primary; + if (sourceType === SourceType.RSS) return theme.success; + if (sourceType === SourceType.CUSTOM) return theme.warning; + return theme.textMuted; }; export function SourceBadge(props: SourceBadgeProps) { + const { theme } = useTheme(); const label = () => props.sourceName || props.sourceId; + const typeColor = (sourceType?: SourceType) => { + if (sourceType === SourceType.API) return theme.primary; + if (sourceType === SourceType.RSS) return theme.success; + if (sourceType === SourceType.CUSTOM) return theme.warning; + return theme.textMuted; + }; + return ( [{typeLabel(props.sourceType)}] - {label()} + {label()} ); } diff --git a/src/pages/Settings/OAuthPlaceholder.tsx b/src/pages/Settings/OAuthPlaceholder.tsx index c1786ab..840e981 100644 --- a/src/pages/Settings/OAuthPlaceholder.tsx +++ b/src/pages/Settings/OAuthPlaceholder.tsx @@ -5,6 +5,7 @@ import { createSignal } from "solid-js"; import { OAUTH_PROVIDERS, OAUTH_LIMITATION_MESSAGE } from "@/config/auth"; +import { useTheme } from "@/context/ThemeContext"; interface OAuthPlaceholderProps { focused?: boolean; @@ -15,6 +16,7 @@ interface OAuthPlaceholderProps { type FocusField = "code" | "back"; export function OAuthPlaceholder(props: OAuthPlaceholderProps) { + const { theme } = useTheme(); const [focusField, setFocusField] = createSignal("code"); const fields: FocusField[] = ["code", "back"]; @@ -38,23 +40,23 @@ export function OAuthPlaceholder(props: OAuthPlaceholderProps) { }; return ( - - + + OAuth Authentication {/* OAuth providers list */} - Available OAuth Providers: + Available OAuth Providers: {OAUTH_PROVIDERS.map((provider) => ( - + {provider.enabled ? "[+]" : "[-]"} {provider.name} - - {provider.description} + - {provider.description} ))} @@ -62,33 +64,29 @@ export function OAuthPlaceholder(props: OAuthPlaceholderProps) { {/* Limitation message */} - - Terminal Limitations + + Terminal Limitations {OAUTH_LIMITATION_MESSAGE.split("\n").map((line) => ( - {line} + {line} ))} {/* Alternative options */} - Recommended Alternatives: + Recommended Alternatives: - [1] - Use a sync code from the web portal - - - [2] - Use email/password authentication - - - [3] - Use file-based sync (no account needed) + [1] + Use a sync code from the web portal + [2] + Use email/password authentication + [3] + Use file-based sync (no account needed) @@ -99,9 +97,9 @@ export function OAuthPlaceholder(props: OAuthPlaceholderProps) { - + [C] Enter Sync Code @@ -109,9 +107,9 @@ export function OAuthPlaceholder(props: OAuthPlaceholderProps) { - + [Esc] Back to Login @@ -119,7 +117,7 @@ export function OAuthPlaceholder(props: OAuthPlaceholderProps) { - Tab to navigate, Enter to select, Esc to go back + Tab to navigate, Enter to select, Esc to go back ); } diff --git a/src/pages/Settings/SyncProfile.tsx b/src/pages/Settings/SyncProfile.tsx index 648ca5f..031ddd9 100644 --- a/src/pages/Settings/SyncProfile.tsx +++ b/src/pages/Settings/SyncProfile.tsx @@ -6,6 +6,7 @@ import { createSignal } from "solid-js"; import { useAuthStore } from "@/stores/auth"; import { format } from "date-fns"; +import { useTheme } from "@/context/ThemeContext"; interface SyncProfileProps { focused?: boolean; @@ -17,6 +18,7 @@ type FocusField = "sync" | "export" | "logout"; export function SyncProfile(props: SyncProfileProps) { const auth = useAuthStore(); + const { theme } = useTheme(); const [focusField, setFocusField] = createSignal("sync"); const [lastSyncTime] = createSignal(new Date()); @@ -59,8 +61,8 @@ export function SyncProfile(props: SyncProfileProps) { }; return ( - - + + User Profile @@ -77,38 +79,38 @@ export function SyncProfile(props: SyncProfileProps) { justifyContent="center" alignItems="center" > - {userInitials()} + {userInitials()} {/* User details */} - {user()?.name || "Guest User"} - {user()?.email || "No email"} - Joined: {formatDate(user()?.createdAt)} + {user()?.name || "Guest User"} + {user()?.email || "No email"} + Joined: {formatDate(user()?.createdAt)} {/* Sync status section */} - - Sync Status + + Sync Status - Status: - - {user()?.syncEnabled ? "Enabled" : "Disabled"} - + Status: + + {user()?.syncEnabled ? "Enabled" : "Disabled"} + - Last Sync: - {formatDate(lastSyncTime())} + Last Sync: + {formatDate(lastSyncTime())} - Method: - File-based (JSON/XML) + Method: + File-based (JSON/XML) @@ -119,9 +121,9 @@ export function SyncProfile(props: SyncProfileProps) { - + [S] Manage Sync @@ -129,9 +131,9 @@ export function SyncProfile(props: SyncProfileProps) { - + [E] Export Data @@ -139,9 +141,9 @@ export function SyncProfile(props: SyncProfileProps) { - + [L] Logout @@ -149,7 +151,7 @@ export function SyncProfile(props: SyncProfileProps) { - Tab to navigate, Enter to select + Tab to navigate, Enter to select ); } diff --git a/src/ui/command.tsx b/src/ui/command.tsx index d035ce6..af8ae6d 100644 --- a/src/ui/command.tsx +++ b/src/ui/command.tsx @@ -270,7 +270,7 @@ function CommandDialog(props: { const maxHeight = Math.floor(dimensions().height * 0.6); return ( - + {/* Search input */} {"> "} @@ -278,7 +278,7 @@ function CommandDialog(props: { {/* Command list */} - + {(option, index) => ( {props.children}