diff --git a/src/App.tsx b/src/App.tsx index 185fca3..e7f9d60 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -58,6 +58,21 @@ const topSidebarItems: SidebarItem[] = [ { route: 'wishlist', label: 'Wishlist', short: 'W', icon: 'wishlist' }, ] +// Only English is translated today; more can be added here and show up in Settings. +const LANGUAGE_OPTIONS: SelectOption[] = [{ id: 'en-US', label: 'English (en-US)' }] + +const REGION_CODES = [ + 'US', 'GB', 'CA', 'AU', 'NZ', 'IE', 'ES', 'MX', 'AR', 'CL', 'CO', 'PE', 'FR', 'DE', 'IT', 'PT', 'BR', + 'NL', 'BE', 'SE', 'NO', 'DK', 'FI', 'PL', 'JP', 'KR', 'CN', 'TW', 'IN', +] +const regionNames = new Intl.DisplayNames(['en'], { type: 'region' }) +const REGION_OPTIONS: SelectOption[] = REGION_CODES.map((code) => ({ id: code, label: `${regionNames.of(code) ?? code} (${code})` })) + +// A value saved earlier that is not in the list stays selectable instead of being lost. +function withCurrentOption(options: SelectOption[], current: string): SelectOption[] { + return current && !options.some((option) => option.id === current) ? [{ id: current, label: current }, ...options] : options +} + const sidebarItems: SidebarItem[] = [ { route: 'home', label: 'Home', short: 'H', icon: 'home' }, { route: 'dorama', label: 'K-Drama', short: '아' }, @@ -4244,7 +4259,7 @@ function SettingsView(props: { return (
void props.onSave(event)}> - +
{SERVICE_KEYS.map((key) => getServiceStatus(props.connections, key) ?? notCheckedYet(key)).map((connection) => (
@@ -4256,20 +4271,35 @@ function SettingsView(props: {
))}
+
+ + +
- - - - - - + Promise; wide?: boolean; children: ReactNode }) { +function SettingsCard({ title, status, busy, onCheck, children }: { title: string; status?: ConnectionStatus; busy?: boolean; onCheck?: () => Promise; children: ReactNode }) { return ( -
+

{title}

{onCheck ? ( diff --git a/src/index.css b/src/index.css index a361d29..88cc48e 100644 --- a/src/index.css +++ b/src/index.css @@ -6075,10 +6075,6 @@ img { } /* Profiles: who sees which sections, and which libraries Jellyfin gives them. */ -.settings-card.is-wide { - grid-column: 1 / -1; -} - .visually-hidden { position: absolute; width: 1px; @@ -6104,7 +6100,7 @@ img { .profiles-access-list { display: grid; - grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); + grid-template-columns: minmax(0, 1fr); gap: 0.6rem; margin: 0; padding: 0; @@ -6351,3 +6347,25 @@ img { grid-template-columns: minmax(0, 1fr); } } + +.settings-preferences { + display: grid; + gap: 0.9rem; + margin-top: 0.4rem; + padding-top: 1.1rem; + border-top: 1px solid rgba(255, 255, 255, 0.06); +} + +select.input { + appearance: none; + padding-right: 2.6rem; + background-image: linear-gradient(45deg, transparent 50%, #9ba9c2 50%), linear-gradient(135deg, #9ba9c2 50%, transparent 50%); + background-position: calc(100% - 1.3rem) 50%, calc(100% - 0.95rem) 50%; + background-size: 0.35rem 0.35rem, 0.35rem 0.35rem; + background-repeat: no-repeat; +} + +select.input option { + background: #0b0e16; + color: #f4f7ff; +}