navigation

This commit is contained in:
Tickbase
2026-07-11 12:19:38 +02:00
parent b5ca91d9a9
commit e8906d6ec0
2 changed files with 42 additions and 30 deletions
+4 -15
View File
@@ -1,34 +1,23 @@
import { Button } from '@/components/buttons'
import { Icon, diamond, refresh, search } from '@/components/icons'
import { Icon, diamond, search } from '@/components/icons'
interface HeaderProps {
onRefresh: () => void
refreshDisabled?: boolean
onSearch: (query: string) => void
searchQuery: string
}
/**
* Application header component
* Contains the app title, search input, and refresh button
* Contains the app title and search input
*/
const Header = ({ onRefresh, refreshDisabled = false, onSearch, searchQuery }: HeaderProps) => {
const Header = ({ onSearch, searchQuery }: HeaderProps) => {
return (
<header className="app-header">
<div className="app-title">
<Icon name={diamond} variant="solid" size="lg" className="app-logo-icon" />
<h1>CreamLinux</h1>
</div>
<div className="header-controls">
<Button
variant="primary"
onClick={onRefresh}
disabled={refreshDisabled}
className="refresh-button"
leftIcon={<Icon name={refresh} variant="solid" size="md" />}
>
Refresh
</Button>
<div className="search-container">
<input
type="text"
+37 -14
View File
@@ -1,11 +1,11 @@
import { Icon, layers, linux, proton, settings } from '@/components/icons'
import { useState, useEffect } from 'react'
import { getVersion } from '@tauri-apps/api/app'
import { Icon, layers, linux, proton, settings, diamond } from '@/components/icons'
import { epic } from '@/components/icons'
import { Button } from '@/components/buttons'
interface SidebarProps {
setFilter: (filter: string) => void
currentFilter: string
onSettingsClick: () => void
}
type FilterItem = {
@@ -15,7 +15,20 @@ type FilterItem = {
variant?: string
}
const Sidebar = ({ setFilter, currentFilter, onSettingsClick }: SidebarProps) => {
const Sidebar = ({ setFilter, currentFilter }: SidebarProps) => {
const [version, setVersion] = useState('')
useEffect(() => {
getVersion()
.then(setVersion)
.catch(() => setVersion(''))
}, [])
const generalFilters: FilterItem[] = [
{ id: 'overview', label: 'Overview', icon: diamond, variant: 'solid' },
{ id: 'settings', label: 'Settings', icon: settings, variant: 'solid' },
]
const steamFilters: FilterItem[] = [
{ id: 'all', label: 'All Games', icon: layers, variant: 'solid' },
{ id: 'native', label: 'Native', icon: linux, variant: 'brand' },
@@ -45,6 +58,12 @@ const Sidebar = ({ setFilter, currentFilter, onSettingsClick }: SidebarProps) =>
<h2>Library</h2>
</div>
<div className="sidebar-section">
<ul className="filter-list">
{generalFilters.map(renderFilter)}
</ul>
</div>
<div className="sidebar-section">
<span className="sidebar-section-label">Steam</span>
<ul className="filter-list">
@@ -59,16 +78,20 @@ const Sidebar = ({ setFilter, currentFilter, onSettingsClick }: SidebarProps) =>
</ul>
</div>
<Button
variant="secondary"
size="medium"
onClick={onSettingsClick}
className="settings-button"
leftIcon={<Icon name={settings} variant="solid" size="md" className="settings-icon" />}
fullWidth
>
Settings
</Button>
<div className="sidebar-footer">
<div className="sidebar-footer-info">
{version && <span className="sidebar-footer-version">v{version}</span>}
<span className="sidebar-footer-build">Stable</span>
</div>
<a
href="https://github.com/Novattz/creamlinux-installer"
target="_blank"
rel="noopener noreferrer"
className="sidebar-footer-link"
>
GitHub
</a>
</div>
</div>
)
}