diff --git a/src/global.d.ts b/src/global.d.ts index 1c166eba..50b59791 100644 --- a/src/global.d.ts +++ b/src/global.d.ts @@ -14,6 +14,7 @@ interface TabEvents { interface Tab { id: string; title: string; + icon?: string; } interface State { diff --git a/src/lib/components/actions.svelte b/src/lib/components/actions.svelte index 4a86aa32..a08e6126 100644 --- a/src/lib/components/actions.svelte +++ b/src/lib/components/actions.svelte @@ -122,15 +122,23 @@
{#if isClipboardAvailable()} - + {/if} - - - + +
diff --git a/src/lib/components/card/tabs.svelte b/src/lib/components/card/tabs.svelte index 78e58c90..67df1e6e 100644 --- a/src/lib/components/card/tabs.svelte +++ b/src/lib/components/card/tabs.svelte @@ -47,7 +47,7 @@ ? 'text-indigo-500 bg-white border-white' : 'text-white bg-indigo-500 border-indigo-500 hover:bg-indigo-600'}" on:click|stopPropagation={() => toggleTabs(tab)}> - {tab.title} + {#if tab.icon} {/if}{tab.title}
{/each} diff --git a/src/lib/components/history/history.svelte b/src/lib/components/history/history.svelte index a9ced292..595f1426 100644 --- a/src/lib/components/history/history.svelte +++ b/src/lib/components/history/history.svelte @@ -20,11 +20,13 @@ const tabs: Tab[] = [ { id: 'saved', - title: 'Saved' + title: 'Saved', + icon: 'far fa-bookmark' }, { id: 'timeline', - title: 'Timeline' + title: 'Timeline', + icon: 'fas fa-history' } ]; @@ -71,11 +73,11 @@
+ > + title="Delete all saved states">
    {#each $historyStore as { state, time, name }} @@ -90,10 +92,10 @@
    + on:click={() => restoreHistory(state)}> Restore + on:click={() => clearHistory(time)}> Delete
@@ -103,6 +105,6 @@ diff --git a/src/lib/components/navbar.svelte b/src/lib/components/navbar.svelte index dd0e5aaf..ccf8ba76 100644 --- a/src/lib/components/navbar.svelte +++ b/src/lib/components/navbar.svelte @@ -3,6 +3,7 @@ interface Link { title: string; href: string; + icon?: string; } const links: Link[] = [ { @@ -22,8 +23,9 @@ href: 'https://github.com/mermaid-js/mermaid-cli' }, { - title: 'Github', - href: 'https://github.com/mermaid-js/mermaid-live-editor' + title: '', + href: 'https://github.com/mermaid-js/mermaid-live-editor', + icon: 'fab fa-github fa-lg' } ]; @@ -47,9 +49,13 @@