Skip to content

Commit

Permalink
feat(editor nav): make dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
retrouser955 committed Aug 31, 2024
1 parent f8f8a75 commit 652a052
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
32 changes: 15 additions & 17 deletions src/lib/components/EditorNavbar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// import Page from "../../routes/editor/+page.svelte";
let isShowing = true;
let isFilesShowing = false;
const dispatch = createEventDispatcher();
Expand All @@ -23,7 +24,7 @@
</script>

<div
class="absolute top-4 w-full z-20 pr-5 flex justify-end overflow-hidden"
class="absolute top-4 w-full z-20 pr-5 flex justify-end"
style={`padding-left: ${toolBoxWidth + 20}px`}
>
<div
Expand All @@ -35,23 +36,20 @@
>
{#if isShowing}
{#await wait(50) then}
<Button
variant="outline"
class="h-8 mx-1"
on:click={() => {
dispatch("save");
}}>SAVE</Button
>
<Button
variant="outline"
class="h-8 mx-1"
on:click={() => {
dispatch("load");
}}
>
LOAD
</Button>
<Button variant="link" class="h-8 mx-1" href="/">Home</Button>
<div>
<Button class="h-8 mx-1" on:click={() => {
isFilesShowing = !isFilesShowing
}}>
Files
</Button>
<div class={`${isFilesShowing ? "flex" : "hidden"} transition-all absolute w-40 pt-2`}>
<div class="w-full mt-auto bg-white text-gray-800 rounded-md py-2">
<button class="w-full py-1 text-xs hover:bg-gray-200 transition-all">Export to code</button>
<button class="w-full py-1 text-xs hover:bg-gray-200 transition-all" on:click={() => dispatch("save")}>Save</button>
</div>
</div>
</div>
<Warnings bind:workspace />
{/await}
{/if}
Expand Down
1 change: 0 additions & 1 deletion src/lib/utils/localDB/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ class LocalDB {
* @param {string} fileName
* @param {string} workspaceID
* @param {object} blocklySave
* @return {*} {void}
* @memberof LocalDB
*/
saveBlocklyInFile(fileName: string, workspaceID: string, blocklySave: object): void {
Expand Down

0 comments on commit 652a052

Please sign in to comment.