From 892b9d1ae92c7d8583d6a1df94d759de780f00e0 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Fri, 24 Apr 2026 01:45:20 +0700 Subject: [PATCH] chore(lint): allow css imports in import/no-unassigned-import, hoist host page styles --- .oxlintrc.json | 2 + .../app/src/screens/settings/host-page.tsx | 61 ++++++++++++++----- 2 files changed, 48 insertions(+), 15 deletions(-) diff --git a/.oxlintrc.json b/.oxlintrc.json index a7c0aa890..7a52175fc 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -54,6 +54,8 @@ "typescript/no-this-alias": "warn", "typescript/consistent-type-definitions": ["warn", "interface"], + "import/no-unassigned-import": ["warn", { "allow": ["**/*.css"] }], + "no-nested-ternary": "warn", "no-unneeded-ternary": "warn", diff --git a/packages/app/src/screens/settings/host-page.tsx b/packages/app/src/screens/settings/host-page.tsx index 65de310cf..c08a6d4c3 100644 --- a/packages/app/src/screens/settings/host-page.tsx +++ b/packages/app/src/screens/settings/host-page.tsx @@ -1,4 +1,4 @@ -import { useCallback, useEffect, useRef, useState } from "react"; +import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { Alert, Pressable, Text, TextInput, View } from "react-native"; import { StyleSheet, useUnistyles } from "react-native-unistyles"; import { ChevronRight, Globe, Monitor, Pencil, RotateCw, Trash2 } from "lucide-react-native"; @@ -115,10 +115,20 @@ export function HostPage({ serverId, onHostRemoved }: HostPageProps) { const connectionError = typeof lastError === "string" && lastError.trim().length > 0 ? lastError.trim() : null; + const statusPillStyle = useMemo( + () => [styles.statusPill, { backgroundColor: statusPillBg }], + [statusPillBg], + ); + const statusDotStyle = useMemo( + () => [styles.statusDot, { backgroundColor: statusColor }], + [statusColor], + ); + const statusTextStyle = useMemo(() => [styles.statusText, { color: statusColor }], [statusColor]); + if (!host) { return ( - + Host not found @@ -128,9 +138,9 @@ export function HostPage({ serverId, onHostRemoved }: HostPageProps) { return ( - - - {statusLabel} + + + {statusLabel} {connectionBadge ? ( @@ -256,7 +266,7 @@ export function HostRenameButton({ host }: { host: HostProfile }) {