Skip to content

Commit

Permalink
Update header again
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrtenz committed Jan 29, 2025
1 parent 5a48bb5 commit f145af5
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 27 deletions.
4 changes: 2 additions & 2 deletions src/components/ColorModeToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export const ColorModeToggle: FunctionComponent = () => {
<IconButton
flexShrink="0"
aria-label={_(t`Toggle color mode`)}
variant="clear"
icon={<DarkModeIcon width="0.75rem" color="text.default" />}
variant="outline"
icon={<DarkModeIcon width="0.75rem" />}
onClick={toggleColorMode}
/>
);
Expand Down
11 changes: 3 additions & 8 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import type { BoxProps } from '@chakra-ui/react';
import { Button, Box, Container, Stack } from '@chakra-ui/react';
import { Box, Container, Stack } from '@chakra-ui/react';
import { Link } from 'gatsby';
import type { FunctionComponent } from 'react';

import { ColorModeToggle } from './ColorModeToggle';
import { GlobeIcon } from './icons';
import { Logo } from './Logo';
import { FilterSearch, Notifications } from '../features';

Expand All @@ -27,7 +26,7 @@ export const Header: FunctionComponent<HeaderProps> = (props) => (
width="100%"
zIndex="sticky"
>
<Container maxWidth="100%">
<Container maxWidth="7xl">
<Stack
direction="row"
alignItems="center"
Expand All @@ -40,13 +39,9 @@ export const Header: FunctionComponent<HeaderProps> = (props) => (
</Stack>
</Link>
<Stack direction="row" gap="4">
<GlobeIcon flexShrink="0" />
<ColorModeToggle />
<FilterSearch />
<ColorModeToggle />
<Notifications />
<Button flexShrink="0" variant="primary">
Download
</Button>
</Stack>
</Stack>
</Container>
Expand Down
2 changes: 1 addition & 1 deletion src/components/icons/bell.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/features/filter/components/FilterSearchInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from '@chakra-ui/react';
import { t } from '@lingui/macro';
import { useLingui } from '@lingui/react';
import type { ChangeEvent, FunctionComponent } from 'react';
import type { ChangeEvent, FunctionComponent, KeyboardEvent } from 'react';

import { SearchIcon } from '../../../components';

Expand All @@ -27,7 +27,7 @@ export const FilterSearchInput: FunctionComponent<FilterSearchInputProps> =
forwardRef(({ query, onFormClick, onFormChange, onFormSubmit }, ref) => {
const { _ } = useLingui();

const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {
const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {
if (event.key === 'Enter') {
onFormSubmit();
}
Expand All @@ -41,7 +41,7 @@ export const FilterSearchInput: FunctionComponent<FilterSearchInputProps> =
<Input
type="search"
variant="outline"
placeholder={_(t`Search`)}
placeholder={_(t`Search Snaps`)}
value={query}
onChange={onFormChange}
onClick={onFormClick}
Expand Down
14 changes: 1 addition & 13 deletions src/features/notifications/components/NotificationsButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,7 @@ export const NotificationsButton: ComponentWithAs<
variant="outline"
icon={
<>
<NotificationIcon
color="text.default"
width="0.638rem"
height="0.75rem"
sx={{
'& > svg > rect': {
fillOpacity: 1,
},
'& > svg > path': {
fill: 'text.alternative',
},
}}
/>
<NotificationIcon width="0.638rem" height="0.75rem" />
{hasUnacknowledgedUpdates && (
<DotIcon position="absolute" top="0" right="0" />
)}
Expand Down
9 changes: 9 additions & 0 deletions src/theme/components/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ export const Button = defineStyleConfig({
fontWeight: '500',
paddingX: '6',
paddingY: '4',
_hover: {
opacity: '1',
background: 'text.default',
color: 'background.default',
},
_active: {
background: 'text.alternative',
color: 'background.default',
},
}),

filter: defineStyle({
Expand Down
4 changes: 4 additions & 0 deletions src/theme/components/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ export const Input = defineMultiStyleConfig({
field: {
borderWidth: '0.094rem',
borderColor: 'text.default',
_hover: {
borderColor: 'text.default',
background: 'background.alternative',
},
},
}),
},
Expand Down

0 comments on commit f145af5

Please sign in to comment.