|
1 | 1 | <script> |
2 | | - import { Box, Flex, Stack, Text, Button, IconButton, Logo } from '$lib/components'; |
3 | | - import { colorModeValue } from '$lib/stores'; |
| 2 | + import { Box, Flex, Stack, ButtonGroup, Input, Logo } from '$lib/components'; |
| 3 | + import { colorMode } from '$lib/stores'; |
| 4 | +
|
| 5 | + import FaTwitter from 'svelte-icons/fa/FaTwitter.svelte'; |
| 6 | + import FaGithub from 'svelte-icons/fa/FaGithub.svelte'; |
| 7 | + import FaSun from 'svelte-icons/fa/FaSun.svelte'; |
| 8 | + import FaMoon from 'svelte-icons/fa/FaMoon.svelte'; |
| 9 | +
|
| 10 | + import { bg, inputBg, color } from '../../stores'; |
| 11 | + import ActionButton from '../components/ActionButton.svelte'; |
4 | 12 | </script> |
5 | 13 |
|
6 | | -<Box> |
7 | | - <Stack flex={{ base: 1, md: 0 }} justify={'flex-end'} direction={'row'} spacing={6}> |
| 14 | +<Box |
| 15 | + as="nav" |
| 16 | + h="16" |
| 17 | + bg={$bg} |
| 18 | + shadow="md" |
| 19 | + display="flex" |
| 20 | + alignItems="center" |
| 21 | + justifyContent="space-around" |
| 22 | +> |
| 23 | + <Stack direction="row" spacing={6}> |
8 | 24 | <Logo /> |
9 | | - <Button fontSize={'sm'} fontWeight={400} bgColor="green.500">Sign In</Button> |
10 | | - <Button fontSize={'sm'} fontWeight={400}>Sign In</Button> |
11 | 25 | </Stack> |
| 26 | + |
| 27 | + <Flex justify="center" justifyContent="center" display={{ base: 'none', md: 'flex' }} /> |
| 28 | + |
| 29 | + <Flex justify="right" justifyContent="end"> |
| 30 | + <Input |
| 31 | + placeholder="Search the docs." |
| 32 | + sx={{ |
| 33 | + bg: $inputBg, |
| 34 | + color: $color, |
| 35 | + width: '300px', |
| 36 | + fontWeight: 400, |
| 37 | + fontSize: 'sm', |
| 38 | + _hover: { |
| 39 | + bg: $inputBg |
| 40 | + }, |
| 41 | + _placeholder: { |
| 42 | + color: 'gray.400' |
| 43 | + } |
| 44 | + }} |
| 45 | + mr="8" |
| 46 | + display={{ base: 'none', md: 'inline' }} |
| 47 | + /> |
| 48 | + <ButtonGroup alignItems="center" justifyContent="space-between"> |
| 49 | + <ActionButton |
| 50 | + label="Star the Github Repo" |
| 51 | + icon={FaGithub} |
| 52 | + href="https://github.com" |
| 53 | + display={{ base: 'none', md: 'inline' }} |
| 54 | + /> |
| 55 | + <ActionButton label="Twitter" icon={FaTwitter} display={{ base: 'none', md: 'inline' }} /> |
| 56 | + {#if $colorMode === 'dark'} |
| 57 | + <ActionButton |
| 58 | + icon={FaSun} |
| 59 | + label="Switch to light Mode" |
| 60 | + on:click={() => colorMode.set('light')} |
| 61 | + /> |
| 62 | + {:else} |
| 63 | + <ActionButton |
| 64 | + icon={FaMoon} |
| 65 | + label="Switch to dark Mode" |
| 66 | + on:click={() => colorMode.set('dark')} |
| 67 | + /> |
| 68 | + {/if} |
| 69 | + </ButtonGroup> |
| 70 | + </Flex> |
12 | 71 | </Box> |
0 commit comments