Skip to content

Commit 6b1aeb4

Browse files
committed
Refactor search icon in ApiKeysSection to use FontAwesome
- Replaced the existing search icon with FontAwesome's `faSearch` for improved consistency and visual appeal. - Updated the `Settings.tsx` file to import and utilize the FontAwesomeIcon component, enhancing the UI component's design.
1 parent de3953d commit 6b1aeb4

File tree

3 files changed

+17
-18
lines changed

3 files changed

+17
-18
lines changed

interface/src/components/Sidebar.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ export function Sidebar({ liveStates, collapsed, onToggle }: SidebarProps) {
5555
{/* Logo + collapse toggle */}
5656
<div className="flex h-12 items-center border-b border-sidebar-line px-3">
5757
{collapsed ? (
58-
<Button onClick={onToggle} variant="ghost" size="icon" className="h-full w-full">
59-
<img src={`${BASE_PATH}/ball.png`} alt="" className="h-6 w-6" draggable={false} />
60-
</Button>
58+
<button onClick={onToggle} className="flex h-full w-full items-center justify-center">
59+
<img src={`${BASE_PATH}/ball.png`} alt="" className="h-6 w-6 transition-transform duration-150 ease-out hover:scale-110 active:scale-95" draggable={false} />
60+
</button>
6161
) : (
6262
<div className="flex flex-1 items-center justify-between">
6363
<Link to="/" className="flex items-center gap-2">
64-
<img src={`${BASE_PATH}/ball.png`} alt="" className="h-6 w-6 flex-shrink-0" draggable={false} />
64+
<img src={`${BASE_PATH}/ball.png`} alt="" className="h-6 w-6 flex-shrink-0 transition-transform duration-150 ease-out hover:scale-110 active:scale-95" draggable={false} />
6565
<span className="whitespace-nowrap font-plex text-sm font-semibold text-sidebar-ink">
6666
Spacebot
6767
</span>

interface/src/lib/providerIcons.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ function OpenCodeZenIcon({ size = 24, className }: IconProps) {
3838
focusable="false"
3939
>
4040
<g clipPath={`url(#${clipPathId})`}>
41-
<path d="M24 32H8V16H24V32Z" fill="#4B4646" />
42-
<path d="M24 8H8V32H24V8ZM32 40H0V0H32V40Z" fill="#F1ECEC" />
41+
<path d="M24 32H8V16H24V32Z" fill="currentColor" opacity="0.4" />
42+
<path d="M24 8H8V32H24V8ZM32 40H0V0H32V40Z" fill="currentColor" />
4343
</g>
4444
<defs>
4545
<clipPath id={clipPathId}>

interface/src/routes/Settings.tsx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import {useState, useEffect, useRef} from "react";
22
import {useQuery, useMutation, useQueryClient} from "@tanstack/react-query";
33
import {api, type GlobalSettingsResponse} from "@/api/client";
4-
import {Button, Input, SettingSidebarButton, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, Select, SelectTrigger, SelectValue, SelectContent, SelectItem} from "@/ui";
4+
import {Button, Input, SettingSidebarButton, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, Toggle} from "@/ui";
55
import {useSearch, useNavigate} from "@tanstack/react-router";
66
import {ChannelSettingCard, DisabledChannelCard} from "@/components/ChannelSettingCard";
77
import {ProviderIcon} from "@/lib/providerIcons";
8+
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
9+
import {faSearch} from "@fortawesome/free-solid-svg-icons";
810

911
import {parse as parseToml} from "smol-toml";
1012

@@ -502,9 +504,7 @@ function ApiKeysSection({settings, isLoading}: GlobalSettingsSectionProps) {
502504
<div className="flex flex-col gap-3">
503505
<div className="rounded-lg border border-app-line bg-app-box p-4">
504506
<div className="flex items-center gap-3">
505-
<div className="flex h-8 w-8 items-center justify-center rounded-lg bg-app-darkBox text-ink-faint">
506-
<span className="text-lg">🔍</span>
507-
</div>
507+
<FontAwesomeIcon icon={faSearch} className="text-ink-faint" />
508508
<div className="flex-1">
509509
<div className="flex items-center gap-2">
510510
<span className="text-sm font-medium text-ink">Brave Search</span>
@@ -655,20 +655,19 @@ function ServerSection({settings, isLoading}: GlobalSettingsSectionProps) {
655655
) : (
656656
<div className="flex flex-col gap-4">
657657
<div className="rounded-lg border border-app-line bg-app-box p-4">
658-
<label className="flex items-center gap-3">
659-
<input
660-
type="checkbox"
661-
checked={apiEnabled}
662-
onChange={(e) => setApiEnabled(e.target.checked)}
663-
className="h-4 w-4"
664-
/>
658+
<div className="flex items-center justify-between">
665659
<div>
666660
<span className="text-sm font-medium text-ink">Enable API Server</span>
667661
<p className="mt-0.5 text-sm text-ink-dull">
668662
Disable to prevent the HTTP API from starting
669663
</p>
670664
</div>
671-
</label>
665+
<Toggle
666+
size="sm"
667+
checked={apiEnabled}
668+
onCheckedChange={setApiEnabled}
669+
/>
670+
</div>
672671
</div>
673672

674673
<div className="rounded-lg border border-app-line bg-app-box p-4">

0 commit comments

Comments
 (0)