mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
feat: add theme-aware OpenCode logo to header
- Add OpenCode wordmark logos for light and dark themes - Update Header component to display logo on main page - Enhance useTheme hook to return current theme state - Implement responsive logo sizing for mobile devices
This commit is contained in:
1 parent
37b00e27ea
commit
298be46623
5 files changed
+24
-4
No files matched your search
@@ -0,0 +1 @@
|
||||
<svg width='240' height='300' viewBox='0 0 240 300' fill='none' xmlns='http://www.w3.org/2000/svg'><g clip-path='url(#clip0_1401_86283)'><mask id='mask0_1401_86283' style='mask-type:luminance' maskUnits='userSpaceOnUse' x='0' y='0' width='240' height='300'><path d='M240 0H0V300H240V0Z' fill='white'/></mask><g mask='url(#mask0_1401_86283)'><path d='M180 240H60V120H180V240Z' fill='#4B4646'/><path d='M180 60H60V240H180V60ZM240 300H0V0H240V300Z' fill='#F1ECEC'/></g></g><defs><clipPath id='clip0_1401_86283'><rect width='240' height='300' fill='white'/></clipPath></defs></svg>
|
||||
|
After Width: | Height: | Size: 577 B |
@@ -0,0 +1 @@
|
||||
<svg width='641' height='115' viewBox='0 0 641 115' fill='none' xmlns='http://www.w3.org/2000/svg'><g clip-path='url(#clip0_1401_86292)'><mask id='mask0_1401_86292' style='mask-type:luminance' maskUnits='userSpaceOnUse' x='0' y='0' width='641' height='115'><path d='M640.714 0H0V115H640.714V0Z' fill='white'/></mask><g mask='url(#mask0_1401_86292)'><path d='M49.2868 82.1433H16.4297V49.2861H49.2868V82.1433Z' fill='#4B4646'/><path d='M49.2857 32.8573H16.4286V82.143H49.2857V32.8573ZM65.7143 98.5716H0V16.4287H65.7143V98.5716Z' fill='#B7B1B1'/><path d='M131.427 82.1433H98.5703V49.2861H131.427V82.1433Z' fill='#4B4646'/><path d='M98.5692 82.143H131.426V32.8573H98.5692V82.143ZM147.855 98.5716H98.5692V115H82.1406V16.4287H147.855V98.5716Z' fill='#B7B1B1'/><path d='M229.997 65.7139V82.1424H180.711V65.7139H229.997Z' fill='#4B4646'/><path d='M230.003 65.7144H180.718V82.143H230.003V98.5716H164.289V16.4287H230.003V65.7144ZM180.718 49.2859H213.575V32.8573H180.718V49.2859Z' fill='#B7B1B1'/><path d='M295.717 98.5718H262.859V49.2861H295.717V98.5718Z' fill='#4B4646'/><path d='M295.715 32.8573H262.858V98.5716H246.43V16.4287H295.715V32.8573ZM312.144 98.5716H295.715V32.8573H312.144V98.5716Z' fill='#B7B1B1'/><path d='M394.286 82.1433H345V49.2861H394.286V82.1433Z' fill='#4B4646'/><path d='M394.285 32.8573H344.999V82.143H394.285V98.5716H328.57V16.4287H394.285V32.8573Z' fill='#F1ECEC'/><path d='M459.998 82.1433H427.141V49.2861H459.998V82.1433Z' fill='#4B4646'/><path d='M459.997 32.8573H427.14V82.143H459.997V32.8573ZM476.425 98.5716H410.711V16.4287H476.425V98.5716Z' fill='#F1ECEC'/><path d='M542.146 82.1433H509.289V49.2861H542.146V82.1433Z' fill='#4B4646'/><path d='M542.145 32.8571H509.288V82.1429H542.145V32.8571ZM558.574 98.5714H492.859V16.4286H542.145V0H558.574V98.5714Z' fill='#F1ECEC'/><path d='M640.715 65.7139V82.1424H591.43V65.7139H640.715Z' fill='#4B4646'/><path d='M591.429 32.8573V49.2859H624.286V32.8573H591.429ZM640.714 65.7144H591.429V82.143H640.714V98.5716H575V16.4287H640.714V65.7144Z' fill='#F1ECEC'/></g></g><defs><clipPath id='clip0_1401_86292'><rect width='640.714' height='115' fill='white'/></clipPath></defs></svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
@@ -0,0 +1 @@
|
||||
<svg width='640' height='115' viewBox='0 0 640 115' fill='none' xmlns='http://www.w3.org/2000/svg'><g clip-path='url(#clip0_1401_86330)'><mask id='mask0_1401_86330' style='mask-type:luminance' maskUnits='userSpaceOnUse' x='0' y='0' width='640' height='115'><path d='M640 0H0V115H640V0Z' fill='white'/></mask><g mask='url(#mask0_1401_86330)'><path d='M49.2346 82.1433H16.4141V49.2861H49.2346V82.1433Z' fill='#CFCECD'/><path d='M49.2308 32.8573H16.4103V82.143H49.2308V32.8573ZM65.641 98.5716H0V16.4287H65.641V98.5716Z' fill='#656363'/><path d='M131.281 82.1433H98.4609V49.2861H131.281V82.1433Z' fill='#CFCECD'/><path d='M98.4649 82.143H131.285V32.8573H98.4649V82.143ZM147.696 98.5716H98.4649V115H82.0547V16.4287H147.696V98.5716Z' fill='#656363'/><path d='M229.746 65.7139V82.1424H180.516V65.7139H229.746Z' fill='#CFCECD'/><path d='M229.743 65.7144H180.512V82.143H229.743V98.5716H164.102V16.4287H229.743V65.7144ZM180.512 49.2859H213.332V32.8573H180.512V49.2859Z' fill='#656363'/><path d='M295.383 98.5718H262.562V49.2861H295.383V98.5718Z' fill='#CFCECD'/><path d='M295.387 32.8573H262.567V98.5716H246.156V16.4287H295.387V32.8573ZM311.797 98.5716H295.387V32.8573H311.797V98.5716Z' fill='#656363'/><path d='M393.848 82.1433H344.617V49.2861H393.848V82.1433Z' fill='#CFCECD'/><path d='M393.844 32.8573H344.613V82.143H393.844V98.5716H328.203V16.4287H393.844V32.8573Z' fill='#211E1E'/><path d='M459.485 82.1433H426.664V49.2861H459.485V82.1433Z' fill='#CFCECD'/><path d='M459.489 32.8573H426.668V82.143H459.489V32.8573ZM475.899 98.5716H410.258V16.4287H475.899V98.5716Z' fill='#211E1E'/><path d='M541.539 82.1433H508.719V49.2861H541.539V82.1433Z' fill='#CFCECD'/><path d='M541.535 32.8571H508.715V82.1428H541.535V32.8571ZM557.946 98.5714H492.305V16.4286H541.535V0H557.946V98.5714Z' fill='#211E1E'/><path d='M639.996 65.7139V82.1424H590.766V65.7139H639.996Z' fill='#CFCECD'/><path d='M590.77 32.8573V49.2859H623.59V32.8573H590.77ZM640 65.7144H590.77V82.143H640V98.5716H574.359V16.4287H640V65.7144Z' fill='#211E1E'/></g></g><defs><clipPath id='clip0_1401_86330'><rect width='640' height='115' fill='white'/></clipPath></defs></svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
@@ -2,6 +2,7 @@ import { Settings } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { BackButton } from "@/components/ui/back-button";
|
||||
import { useSettingsDialog } from "@/hooks/useSettingsDialog";
|
||||
import { useTheme } from "@/hooks/useTheme";
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
interface HeaderProps {
|
||||
@@ -12,6 +13,7 @@ interface HeaderProps {
|
||||
|
||||
export function Header({ title, backTo, action }: HeaderProps) {
|
||||
const { open: openSettings } = useSettingsDialog();
|
||||
const theme = useTheme();
|
||||
|
||||
return (
|
||||
<header className="sticky top-0 z-10 bg-gradient-to-b from-background via-background to-background border-b border-border backdrop-blur-sm">
|
||||
@@ -19,9 +21,19 @@ export function Header({ title, backTo, action }: HeaderProps) {
|
||||
<div className="flex items-center justify-between h-16">
|
||||
<div className="flex items-center gap-4">
|
||||
{backTo && <BackButton to={backTo} />}
|
||||
<h1 className="text-xl font-semibold bg-gradient-to-r from-foreground to-muted-foreground bg-clip-text text-transparent truncate">
|
||||
{title}
|
||||
</h1>
|
||||
<div className="flex items-center gap-2">
|
||||
{title === "OpenCode" ? (
|
||||
<img
|
||||
src={theme === 'light' ? "/opencode-wordmark-light.svg" : "/opencode-wordmark-dark.svg"}
|
||||
alt="OpenCode"
|
||||
className="h-6 w-auto sm:h-8"
|
||||
/>
|
||||
) : (
|
||||
<h1 className="text-xl font-semibold bg-gradient-to-r from-foreground to-muted-foreground bg-clip-text text-transparent truncate">
|
||||
{title}
|
||||
</h1>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
{action && <div>{action}</div>}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { useEffect } from 'react'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useSettings } from './useSettings'
|
||||
|
||||
export function useTheme() {
|
||||
const { preferences } = useSettings()
|
||||
const [currentTheme, setCurrentTheme] = useState<'light' | 'dark'>('dark')
|
||||
|
||||
useEffect(() => {
|
||||
const theme = preferences?.theme || 'dark'
|
||||
@@ -11,8 +12,10 @@ export function useTheme() {
|
||||
const applyTheme = (isDark: boolean) => {
|
||||
if (isDark) {
|
||||
root.classList.add('dark')
|
||||
setCurrentTheme('dark')
|
||||
} else {
|
||||
root.classList.remove('dark')
|
||||
setCurrentTheme('light')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,4 +30,6 @@ export function useTheme() {
|
||||
applyTheme(theme === 'dark')
|
||||
}
|
||||
}, [preferences?.theme])
|
||||
|
||||
return currentTheme
|
||||
}
|
||||
Reference in new issue
Block a user