Skip to content

Commit 5b3752e

Browse files
committed
feat(ui): improve Setup buttons and add Reset Setup option
- Fix button styling in Setup.tsx (add 'btn' class) - Add 'Reset Setup' option in Settings.tsx to allow returning to welcome screen - Add resetSetup action to themeStore
1 parent 97a003e commit 5b3752e

3 files changed

Lines changed: 29 additions & 6 deletions

File tree

web/src/pages/Settings.tsx

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default function Settings() {
3838
accessLost,
3939
clearAccessLost
4040
} = useAppStore()
41-
const { theme, toggleTheme } = useThemeStore()
41+
const { theme, toggleTheme, resetSetup } = useThemeStore()
4242
const [openModal, setOpenModal] = useState<ModalType>(null)
4343
const [animationsEnabled, setAnimationsEnabled] = useState(true)
4444

@@ -165,6 +165,27 @@ export default function Settings() {
165165
/>
166166
</div>
167167
</section>
168+
169+
{/* Reset Section */}
170+
<section className="animate-fade-in-up stagger-3">
171+
<h2 className="text-xs font-semibold text-text-muted uppercase tracking-wider mb-3 px-1">
172+
Danger Zone
173+
</h2>
174+
<div className="card overflow-hidden border-error/20">
175+
<SettingItem
176+
icon={RotateCcw}
177+
iconColor="error"
178+
title="Reset Setup"
179+
subtitle="Return to the initial setup screen"
180+
onClick={() => {
181+
if (window.confirm('Are you sure you want to reset the setup? This will return you to the welcome screen.')) {
182+
resetSetup()
183+
window.location.href = '/'
184+
}
185+
}}
186+
/>
187+
</div>
188+
</section>
168189
</div>
169190

170191
{/* Modals */}

web/src/pages/Setup.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function WelcomeStep({ onNext }: { onNext: () => void }) {
8989
<FeatureItem icon={Smartphone} text="Monitor system performance" />
9090
</div>
9191

92-
<button onClick={onNext} className="btn-primary w-full">
92+
<button onClick={onNext} className="btn btn-primary w-full">
9393
Get Started
9494
<ChevronRight size={20} />
9595
</button>
@@ -151,7 +151,7 @@ function ModeStep({ mode, onNext }: { mode: string; onNext: () => void }) {
151151
</div>
152152
</div>
153153

154-
<button onClick={onNext} className="btn-primary w-full">
154+
<button onClick={onNext} className="btn btn-primary w-full">
155155
Continue
156156
<ChevronRight size={20} />
157157
</button>
@@ -209,7 +209,7 @@ function ThemeStep({ theme, setTheme, onNext }: { theme: string; setTheme: (t: '
209209
</button>
210210
</div>
211211

212-
<button onClick={onNext} className="btn-primary w-full">
212+
<button onClick={onNext} className="btn btn-primary w-full">
213213
Continue
214214
<ChevronRight size={20} />
215215
</button>
@@ -241,7 +241,7 @@ function ReadyStep({ onComplete }: { onComplete: () => void }) {
241241
</ul>
242242
</div>
243243

244-
<button onClick={onComplete} className="btn-primary w-full">
244+
<button onClick={onComplete} className="btn btn-primary w-full">
245245
Start Using AppControlX
246246
<ChevronRight size={20} />
247247
</button>

web/src/store/themeStore.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ interface ThemeState {
1313
setTheme: (theme: Theme) => void
1414
toggleTheme: () => void
1515
completeSetup: () => void
16+
resetSetup: () => void
1617
}
1718

1819
// Apply theme to DOM immediately
@@ -45,7 +46,8 @@ export const useThemeStore = create<ThemeState>()(
4546
set({ theme: newTheme })
4647
applyTheme(newTheme)
4748
},
48-
completeSetup: () => set({ isFirstLaunch: false })
49+
completeSetup: () => set({ isFirstLaunch: false }),
50+
resetSetup: () => set({ isFirstLaunch: true })
4951
}),
5052
{
5153
name: 'appcontrolx-theme',

0 commit comments

Comments
 (0)