refactor: extract first page into a component
It is a component now which allows for inspection in Storybook. Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
This commit is contained in:
parent
c89f9d6f1b
commit
0d1b0454ef
9 changed files with 88 additions and 26 deletions
|
@ -18,7 +18,7 @@
|
|||
/*place global styles here */
|
||||
html,
|
||||
body {
|
||||
@apply h-full overflow-hidden;
|
||||
@apply h-full overflow-hidden bg-white;
|
||||
}
|
||||
|
||||
:root {
|
||||
|
|
39
src/lib/components/molecules/Welcome.svelte
Normal file
39
src/lib/components/molecules/Welcome.svelte
Normal file
|
@ -0,0 +1,39 @@
|
|||
<!--
|
||||
Welcome molecule.
|
||||
Copyright (C) 2024 André Jaenisch
|
||||
SPDX-FileCopyrightText: 2024 André Jaenisch
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<script>
|
||||
import { _ } from 'svelte-i18n';
|
||||
|
||||
import AnvilLogo from '../atoms/AnvilLogo.svelte';
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="max-w-[400px] mx-auto flex flex-col self-center justify-start items-center content-stretch bg-surface-50 border border-rounded border-surface-200 drop-shadow p-8"
|
||||
>
|
||||
<AnvilLogo class="items-center w-[77px]" />
|
||||
<h1 class="font-semibold text-4xl text-surface-500">{$_('page.welcome.headline')}</h1>
|
||||
<p class="text-surface-500">{$_('page.welcome.intro')}</p>
|
||||
<div class="space-y-3">
|
||||
<div>
|
||||
<a href="/account/create" class="btn variant-filled-primary">Create F2 account</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="/account/login" class="btn text-primary-500 font-semibold variant-filled-ghost"
|
||||
>I have an account</a
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<a href="/" class="btn bg-initial text-surface-500">Reset passphrase</a>
|
||||
</div>
|
||||
</div>
|
|
@ -127,6 +127,9 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"welcome": ""
|
||||
"welcome": {
|
||||
"headline": "",
|
||||
"intro": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -127,6 +127,9 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"welcome": "Willkommen bei Anvil!"
|
||||
"welcome": {
|
||||
"headline": "Willkommen bei Anvil",
|
||||
"intro": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -127,6 +127,9 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"welcome": "Welcome to Anvil!"
|
||||
"welcome": {
|
||||
"headline": "Welcome to Anvil",
|
||||
"intro": "Anvil is a F2 („ForgeFed”) client. If you don't have an F2 account you need to create one on an F2 server."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -127,6 +127,9 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"welcome": ""
|
||||
"welcome": {
|
||||
"headline": "",
|
||||
"intro": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -127,6 +127,9 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"welcome": "Witamy w Anvil!"
|
||||
"welcome": {
|
||||
"headline": "Witamy w Anvil",
|
||||
"intro": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,25 +8,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
|
|||
<script lang="ts">
|
||||
import { _ } from 'svelte-i18n';
|
||||
|
||||
import AnvilLogo from '$lib/components/atoms/AnvilLogo.svelte';
|
||||
import Welcome from '$lib/components/molecules/Welcome.svelte';
|
||||
</script>
|
||||
|
||||
<div class="w-full max-w-md h-full mx-auto flex flex-col justify-center items-center py-10">
|
||||
<AnvilLogo class="items-center w-[77px]" />
|
||||
<h1 class="h1 font-bold">{$_('page.welcome')}</h1>
|
||||
<p>
|
||||
Anvil is a F2 (Federated Forge) client. Would you like to create a new F2 account or log in with
|
||||
your existing one?
|
||||
</p>
|
||||
<div class="text-center space-y-3">
|
||||
<div>
|
||||
<a href="/account/create" class="btn variant-filled-primary">Create F2 account</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="/account/login" class="btn variant-filled-secondary">I have an account</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<a href="/" class="btn btn-sm bg-initial">Reset passphrase</a>
|
||||
</div>
|
||||
</div>
|
||||
<Welcome />
|
||||
|
|
26
stories/molecules/Welcome.stories.ts
Normal file
26
stories/molecules/Welcome.stories.ts
Normal file
|
@ -0,0 +1,26 @@
|
|||
/* Stories for Welcome molecule.
|
||||
* Copyright (C) 2024 André Jaenisch
|
||||
* SPDX-FileCopyrightText: 2024 André Jaenisch
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import type { Meta, StoryObj } from '@storybook/svelte';
|
||||
|
||||
import Welcome from '$lib/components/molecules/Welcome.svelte';
|
||||
|
||||
const meta = {
|
||||
title: 'Molecules/Welcome',
|
||||
component: Welcome,
|
||||
tags: ['autodocs']
|
||||
} satisfies Meta<Welcome>;
|
||||
|
||||
export default meta;
|
||||
type Story = StoryObj<typeof meta>;
|
||||
|
||||
export const Plain: Story = {};
|
Loading…
Reference in a new issue