Skip to content

Commit

Permalink
start componentizing bottom navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
MaHaWo committed Aug 21, 2024
1 parent 62f594a commit bd837cf
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 38 deletions.
60 changes: 22 additions & 38 deletions src/lib/components/AbstractContent.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import {
Avatar,
BottomNav,
BottomNavItem,
DarkMode,
Navbar,
NavBrand,
Expand All @@ -11,16 +10,11 @@
NavUl,
Tooltip
} from 'flowbite-svelte';
import {
CaretLeftSolid,
CaretRightSolid,
LightbulbSolid,
MoonSolid,
SunSolid
} from 'flowbite-svelte-icons';
import { CaretLeftSolid, MoonSolid, SunSolid } from 'flowbite-svelte-icons';
// logo
import logo_dark from '../assets/mondey_dark.svg';
import logo_light from '../assets/mondey_light.svg';
import BottomNavElement from './Navigation/BottomNavElement.svelte';
// variables for showing or hiding elements
export let showBottomNavbar = true;
Expand Down Expand Up @@ -78,35 +72,25 @@
class="fixed bottom-0 left-0 right-0 border-t border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-800"
classInner="grid-cols-3"
>
<BottomNavItem
href={lastpage}
btnName="Zurück"
btnClass="text-gray-500 dark:text-gray-400 hover:text-primary-800 dark:hover:text-primary-500 group-hover:text-primary-800 dark:group-hover:text-primary-500"
>
<CaretLeftSolid
class="mb-1 h-8 w-8 text-gray-500 hover:text-primary-800 group-hover:text-primary-800 dark:text-gray-400 dark:hover:text-primary-500 dark:group-hover:text-primary-500"
/>
<Tooltip arrow={false}>Zur letzten Seite</Tooltip>
</BottomNavItem>
<BottomNavItem
href={infopage}
btnName="Hilfe"
btnClass="text-gray-500 dark:text-gray-400 hover:text-primary-800 dark:hover:text-primary-500 group-hover:text-primary-800 dark:group-hover:text-primary-500"
>
<LightbulbSolid
class="mb-1 h-8 w-8 text-gray-500 hover:text-primary-800 group-hover:text-primary-800 dark:text-gray-400 dark:hover:text-primary-500 dark:group-hover:text-primary-500"
/>
<Tooltip arrow={false}>Hilfe</Tooltip>
</BottomNavItem>
<BottomNavItem
href={nextpage}
btnName="Weiter"
btnClass="text-gray-500 dark:text-gray-400 hover:text-primary-800 dark:hover:text-primary-500 group-hover:text-primary-800 dark:group-hover:text-primary-500"
>
<CaretRightSolid
class="mb-1 h-8 w-8 text-gray-500 hover:text-primary-800 group-hover:text-primary-800 dark:text-gray-400 dark:hover:text-primary-500 dark:group-hover:text-primary-500"
/>
<Tooltip arrow={false}>Zur nächsten Seite</Tooltip>
</BottomNavItem>
<BottomNavElement
href="{lastpage},"
description="{'Zurück'},"
Icon="{CaretLeftSolid},"
tooltip={'Zur letzten Seite'}
></BottomNavElement>

<!-- <BottomNavElement
href="{infopage},"
description="{'Hilfe'},"
Icon="{LightbulbSolid},"
tooltip={'Zusätzliche Informationen'}
></BottomNavElement>
<BottomNavElement
href="{nextpage},"
description="{'Weiter'},"
Icon="{CaretLeftSolid},"
tooltip={'Zur nächsten Seite'}
></BottomNavElement> -->
</BottomNav>
{/if}
17 changes: 17 additions & 0 deletions src/lib/components/Navigation/BottomNavElement.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<script>
import { BottomNavItem, Tooltip } from 'flowbite-svelte';
export let description;
export let href;
export let Icon;
export let tooltip;
</script>

<BottomNavItem
{href}
btnName={description}
btnClass="text-gray-500 dark:text-gray-400 hover:text-primary-800 dark:hover:text-primary-500 group-hover:text-primary-800 dark:group-hover:text-primary-500"
>
<svelte:component this={Icon} />
<Tooltip arrow={false}>{tooltip}</Tooltip>
</BottomNavItem>
2 changes: 2 additions & 0 deletions src/lib/components/Navigation/NaviBottom.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<script>
</script>
2 changes: 2 additions & 0 deletions src/lib/components/Navigation/NaviTop.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<script>
</script>

0 comments on commit bd837cf

Please sign in to comment.