@@ -3,12 +3,15 @@ import { LogoutButton } from "@/components/auth/logout-button"
33import { useStoredDisplayOptions } from "@/lib/displayOptions"
44import { useQueryClient } from "@tanstack/react-query"
55import { Link } from "@tanstack/react-router"
6- import { ExternalLink , Monitor , Moon , Sun , Trash2 } from "lucide-react"
6+ import { Monitor , Moon , Sun , Tags , Trash2 } from "lucide-react"
77import React from "react"
88import { toast } from "sonner"
99
1010import { DisplayOptionsForm } from "./display-options-form"
11+ import { GitHubIcon } from "./github-icon"
1112import { PageHeader } from "./page-header"
13+ import { RefreshButton } from "./refresh-button"
14+ import { useRepoContext } from "./repo/context"
1215import { RepoSelector } from "./repo/selector"
1316import { Button } from "./ui/button"
1417import { Label } from "./ui/label"
@@ -20,6 +23,9 @@ export const SettingsPage: React.FC = () => {
2023 const { theme, setTheme, saturation, setSaturation } = React . useContext ( ThemeContext )
2124 const [ displayOptions , setDisplayOptions ] = useStoredDisplayOptions ( )
2225 const queryClient = useQueryClient ( )
26+ const repo = useRepoContext ( )
27+
28+ const repoURL = `https://github.com/${ repo ?. full_name } `
2329
2430 const clearCache = ( ) => {
2531 queryClient . removeQueries ( )
@@ -30,22 +36,22 @@ export const SettingsPage: React.FC = () => {
3036 < >
3137 < PageHeader title = "Settings" />
3238
33- < div className = "flex flex-col gap-5 p-5 pt-0 w-full max-w-216" >
39+ < div className = "flex flex-col gap-7 p-5 pt-0 w-full max-w-216" >
3440 < div className = "flex flex-col gap-3" >
35- < Label > Account</ Label >
41+ < Label className = "text-muted-foreground" > Account</ Label >
3642 < div className = "flex items-center gap-2" >
3743 < AccountBadge />
3844 < LogoutButton variant = "destructive" className = "w-fit" />
3945 </ div >
4046 </ div >
4147
4248 < div className = "flex flex-col gap-3" >
43- < Label > Repository</ Label >
49+ < Label className = "text-muted-foreground" > Repository</ Label >
4450 < RepoSelector />
4551 </ div >
4652
4753 < div className = "flex flex-col gap-3" >
48- < Label > Theme</ Label >
54+ < Label className = "text-muted-foreground" > Theme</ Label >
4955 < div className = "flex items-center gap-2" >
5056 < Button
5157 variant = "outline"
@@ -77,7 +83,7 @@ export const SettingsPage: React.FC = () => {
7783 </ div >
7884
7985 < div className = "flex flex-col gap-3" >
80- < Label > Color saturation</ Label >
86+ < Label className = "text-muted-foreground" > Color saturation</ Label >
8187 < Slider
8288 value = { [ saturation ] }
8389 onValueChange = { ( v ) => setSaturation ( v [ 0 ] ) }
@@ -89,23 +95,38 @@ export const SettingsPage: React.FC = () => {
8995 </ div >
9096
9197 < div className = "flex flex-col gap-3" >
92- < Label > Tags</ Label >
93- < Link to = "/tags" >
94- < Button variant = "outline" className = "w-fit" >
95- < ExternalLink />
96- Manage
97- </ Button >
98- </ Link >
98+ < Label className = "text-muted-foreground" > Data</ Label >
99+ < div className = "flex items-center gap-2" >
100+ < a href = { repoURL } target = "_blank" >
101+ < Button variant = "outline" >
102+ < GitHubIcon inverted className = "w-4 h-4" />
103+ Root
104+ </ Button >
105+ </ a >
106+
107+ < Link to = "/tags" >
108+ < Button variant = "outline" className = "w-fit" >
109+ < Tags />
110+ Tags
111+ </ Button >
112+ </ Link >
113+ </ div >
99114 </ div >
100115
101- < DisplayOptionsForm options = { displayOptions } onChange = { setDisplayOptions } />
116+ < div className = "flex flex-col gap-3" >
117+ < Label className = "text-muted-foreground" > Display options</ Label >
118+ < DisplayOptionsForm options = { displayOptions } onChange = { setDisplayOptions } />
119+ </ div >
102120
103121 < div className = "flex flex-col gap-3" >
104- < Label > Cache</ Label >
105- < Button variant = "outline" className = "w-fit" onClick = { clearCache } >
106- < Trash2 />
107- Clear cache
108- </ Button >
122+ < Label className = "text-muted-foreground" > Cache</ Label >
123+ < div className = "flex items-center gap-2" >
124+ < Button variant = "outline" className = "w-fit" onClick = { clearCache } >
125+ < Trash2 />
126+ Clear cache
127+ </ Button >
128+ < RefreshButton variant = "outline" />
129+ </ div >
109130 </ div >
110131 </ div >
111132 </ >
0 commit comments