fix: highlight menu dropdown server options

This commit is contained in:
Faisal Amir 2024-01-29 11:57:56 +07:00
parent 3445a25606
commit 50c499601e

View File

@ -73,6 +73,8 @@ const LocalServerScreen = () => {
const [host, setHost] = useAtom(hostAtom) const [host, setHost] = useAtom(hostAtom)
const [port, setPort] = useAtom(portAtom) const [port, setPort] = useAtom(portAtom)
const hostOptions = ['127.0.0.1', '0.0.0.0']
const FIRST_TIME_VISIT_API_SERVER = 'firstTimeVisitAPIServer' const FIRST_TIME_VISIT_API_SERVER = 'firstTimeVisitAPIServer'
const [firstTimeVisitAPIServer, setFirstTimeVisitAPIServer] = const [firstTimeVisitAPIServer, setFirstTimeVisitAPIServer] =
@ -166,8 +168,19 @@ const LocalServerScreen = () => {
<SelectValue /> <SelectValue />
</SelectTrigger> </SelectTrigger>
<SelectContent> <SelectContent>
<SelectItem value="127.0.0.1">127.0.0.1</SelectItem> {hostOptions.map((option, i) => {
<SelectItem value="0.0.0.0">0.0.0.0</SelectItem> return (
<SelectItem
key={i}
value={option}
className={twMerge(
host === option && 'bg-secondary'
)}
>
{option}
</SelectItem>
)
})}
</SelectContent> </SelectContent>
</Select> </Select>