Skip to content

Commit

Permalink
Clean up the auth warning page
Browse files Browse the repository at this point in the history
Center content vertically and horizontally. Don't show a link but
directly the Repos view when authenticated.
  • Loading branch information
rudolfs committed Aug 29, 2024
1 parent bb68d6c commit 16cede1
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 17 deletions.
1 change: 0 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
</head>

<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
13 changes: 13 additions & 0 deletions public/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,21 @@

body {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
color: var(--color-foreground-contrast);
background-color: var(--color-background-default);
}

html {
height: 100%;
width: 100%;
}

code {
font-family: var(--font-family-monospace);
font-size: var(--font-size-small);
background-color: var(--color-fill-ghost);
padding: 0.125rem 0.25rem;
}
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import App from "./App.svelte";

const app = new App({
target: document.getElementById("app")!,
target: document.body,
});

export default app;
32 changes: 17 additions & 15 deletions src/views/Startup.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script lang="ts">
import { invoke } from "@tauri-apps/api/core";
import { onMount } from "svelte";
import { Link } from "svelte-routing";
import Repos from "@app/views/Repos.svelte";
import Icon from "@app/components/Icon.svelte";
let loading = true;
Expand All @@ -22,24 +22,26 @@

<style>
main {
padding-top: 7rem;
margin: 0 auto;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100%;
width: 100%;
text-align: center;
row-gap: 0.5rem;
}
</style>

<main>
{#if error}
<div style="display: flex; justify-content: center;">
<Icon name="warning" size="32" />
{#if error}
<main>
<Icon name="warning" size="32" />
<div class="txt-medium txt-semibold">
{error.err}
</div>
<p class="txt-medium">{error.err}</p>
{#if error.hint}
<p class="txt-small">{@html error.hint}</p>
<div class="txt-small">{@html error.hint}</div>
{/if}
{:else if !loading}
<p class="txt-medium">You are all set!</p>
<Link to="/repos">Repos</Link>
{/if}
</main>
</main>
{:else if !loading}
<Repos />
{/if}

0 comments on commit 16cede1

Please sign in to comment.