Skip to content

Commit

Permalink
🔧 Fixed naming && Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
nwrenger committed May 17, 2024
1 parent 2ebd239 commit 264c9c5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface View {
}

export enum GuiType {
Dialog = 'Dialog',
Message = 'Message',
Alert = 'Alert',
Browser = 'Browser',
Input = 'Input'
Expand Down
2 changes: 1 addition & 1 deletion src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import * as Avatar from '$lib/components/ui/avatar';
import * as Sheet from '$lib/components/ui/sheet';
import { Button } from '$lib/components/ui/button';
import { Sun, Moon, Github, User, Menu } from 'lucide-svelte';
import { Sun, Moon, Menu } from 'lucide-svelte';
import { page } from '$app/stores';
import SideBar from './builder/SideBar.svelte';
</script>
Expand Down
4 changes: 2 additions & 2 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
<p>
Every possible user interface is build from multiple Views. That's like a slide a in a
presentation and multiple Slides are building the whole presentation. A View can be different
types: Either a <code class="code">Dialog</code>,
types: Either a <code class="code">Message</code>,
<code class="code">Alert</code>, <code class="code">Browser</code> or
<code class="code">Input</code>. Every View comes with their own UI Elements which can be hidden
(dialog) or just edited (all).
(Message) or just edited (All).
</p>

<h3 class="h3">Events</h3>
Expand Down
8 changes: 4 additions & 4 deletions src/routes/builder/Editor.svelte
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<script lang="ts">
import { data } from '$lib/stores';
import * as Card from '$lib/components/ui/card';
import { Align, GuiType } from '$lib';
import { GuiType } from '$lib';
import * as Tooltip from '$lib/components/ui/tooltip';
import { CircleAlert, Eye, EyeOff, Pencil, SquareChevronLeft } from 'lucide-svelte';
import { Button } from '$lib/components/ui/button';
import LabelDialog from './LabelDialog.svelte';
import EventDialog from './EventDialog.svelte';
import Badge from '$lib/components/ui/badge/badge.svelte';
import * as Alert from '$lib/components/ui/alert';
Expand Down Expand Up @@ -44,7 +43,7 @@
</div>

<div class="flex h-full flex-col justify-between gap-2">
{#if $data.views[$data.current]?.type == GuiType.Dialog}
{#if $data.views[$data.current]?.type == GuiType.Message}
<LabelItem bind:label={$data.views[$data.current].data.header} type="Header" />
<LabelItem bind:label={$data.views[$data.current].data.text} type="Text" />
<div class="grid w-full grid-cols-3 gap-2">
Expand Down Expand Up @@ -158,7 +157,8 @@
<CircleAlert class="h-4 w-4" />
<Alert.Title>Error</Alert.Title>
<Alert.Description
>This View isn't implemented yet. Just wait until I've done my work!</Alert.Description
>This View is either not implemented yet and you just have to wait until I've done my work
or the data types changed and you have to delete and redo the View!</Alert.Description
>
</Alert.Root>
{/if}
Expand Down
4 changes: 2 additions & 2 deletions src/routes/builder/SideBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
title: 'Type',
items: [
{
label: 'Dialog',
label: 'Message',
disabled: false,
onclick: () => {
$data.views.push({
Expand All @@ -78,7 +78,7 @@
buttons: [null, null, null],
back_function: 'close'
},
type: GuiType.Dialog
type: GuiType.Message
});
$data = $data;
}
Expand Down

0 comments on commit 264c9c5

Please sign in to comment.