Skip to content

TopBar icons are refactored and LogoutIcon is added #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions dashboard-v4/src/components/docs/icons/CampaignIcon.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<script>
export let extendClass = 'h-6 w-6';
</script>

<svg
xmlns="http://www.w3.org/2000/svg"
class={extendClass}
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width={2}
d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"
/>
</svg>
22 changes: 22 additions & 0 deletions dashboard-v4/src/components/docs/icons/LogoutIcon.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<script>
export let extendClass = '';
</script>

<svg
width="28"
height="28"
viewBox="0 0 24 24"
id="_24x24_On_Light_Session-Leave"
data-name="24x24/On Light/Session-Leave"
xmlns="http://www.w3.org/2000/svg"
class={extendClass}
>
<rect id="view-box" width="24" height="24" fill="none" />
<path
id="Shape"
d="M2.95,17.5A2.853,2.853,0,0,1,0,14.75v-12A2.854,2.854,0,0,1,2.95,0h8.8a.75.75,0,0,1,0,1.5H2.95A1.362,1.362,0,0,0,1.5,2.75v12A1.363,1.363,0,0,0,2.95,16h8.8a.75.75,0,0,1,0,1.5Zm9.269-4.219a.751.751,0,0,1,0-1.061L14.939,9.5H5.75a.75.75,0,0,1,0-1.5h9.19L12.219,5.28A.75.75,0,1,1,13.28,4.22l4,4a.749.749,0,0,1,0,1.06l-4,4a.751.751,0,0,1-1.061,0Z"
transform="translate(3.25 3.25)"
stroke-width={2}
fill="currentColor"
/>
</svg>
18 changes: 18 additions & 0 deletions dashboard-v4/src/components/docs/icons/PlusIcon.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<script>
export let extendClass = 'h-6 w-6';
</script>

<svg
xmlns="http://www.w3.org/2000/svg"
class={extendClass}
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width={2}
d="M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"
/>
</svg>
13 changes: 13 additions & 0 deletions dashboard-v4/src/components/docs/icons/SearchIcon.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<script>
export let extendClass = 'absolute fill-current h-4 hidden left-0 ml-4 pointer-events-none text-gray-500 w-4 group-hover:text-gray-400 sm:block';
</script>

<svg
class={extendClass}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
>
<path
d="M12.9 14.32a8 8 0 1 1 1.41-1.41l5.35 5.33-1.42 1.42-5.33-5.34zM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z"
/>
</svg>
18 changes: 18 additions & 0 deletions dashboard-v4/src/components/docs/icons/ShareIcon.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<script>
export let extendClass = "h-6 w-6";
</script>

<svg
xmlns="http://www.w3.org/2000/svg"
class={extendClass}
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width={2}
d="M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"
/>
</svg>
80 changes: 23 additions & 57 deletions dashboard-v4/src/dashboard/TopBar.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
<script>
import { openSidebar } from './store.ts';

import CampaignIcon from '../components/docs/icons/CampaignIcon.svelte';
import PlusIcon from '../components/docs/icons/PlusIcon.svelte';
import ShareIcon from '../components/docs/icons/ShareIcon.svelte';
import SearchIcon from '../components/docs/icons/SearchIcon.svelte';
import LogoutIcon from '../components/docs/icons/LogoutIcon.svelte';

const iconsOptions = [
{ href: '/logout', component: LogoutIcon },
{ href: '/', component: ShareIcon },
{ href: '/', component: PlusIcon },
{ href: '/', component: CampaignIcon }
];

const handleOnClicIcon = (href) => (window.location.href = href);
</script>

<header class="h-20 items-center relative z-10">
Expand Down Expand Up @@ -35,15 +50,7 @@
<path d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
</div>
<svg
class="absolute fill-current h-4 hidden left-0 ml-4 pointer-events-none text-gray-500 w-4 group-hover:text-gray-400 sm:block"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
>
<path
d="M12.9 14.32a8 8 0 1 1 1.41-1.41l5.35 5.33-1.42 1.42-5.33-5.34zM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z"
/>
</svg>
<SearchIcon />
<input
type="text"
class="bg-gray-800 block leading-normal pl-10 py-1.5 pr-4 ring-opacity-90 rounded-2xl text-gray-400 w-full focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500"
Expand All @@ -52,54 +59,13 @@
</div>
</div>
<div class="flex items-center justify-end ml-5 p-1 relative w-full sm:mr-0 sm:right-auto">
<span class="block pr-5">
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-6 w-6"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width={2}
d="M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"
/>
</svg>
</span>
<span class="block pr-5">
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-6 w-6"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width={2}
d="M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"
/>
</svg>
</span>
<span class="block pr-5 relative">
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-6 w-6"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width={2}
d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"
/>
</svg>
</span>
{#each iconsOptions as { href, component }, i}
<span class="block pr-5 cursor-pointer">
<div on:click={() => handleOnClicIcon(href)}>
<svelte:component this={component} />
</div>
</span>
{/each}
<span class="block relative">
<img
alt="Maurice Lokumba"
Expand Down