-
Notifications
You must be signed in to change notification settings - Fork 6
Added get started button to home page #548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from 4 commits
dec0f8b
96c30ff
f204691
b31e3c3
fa04965
7f142ee
b2f31b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,4 +22,6 @@ Thumbs.db | |
| # Vite | ||
| vite.config.js.timestamp-* | ||
| vite.config.ts.timestamp-* | ||
| .wrangler | ||
| .wrangler | ||
|
|
||
| project.inlang/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| <script lang="ts"> | ||
| import { getContext } from 'svelte'; | ||
| import { goto } from '$app/navigation'; | ||
| import type { UnicoveContext } from '$lib/state/client.svelte'; | ||
| import type { LoginOptions } from '@wharfkit/session'; | ||
| import { Button } from 'unicove-components'; | ||
|
|
||
| const context = getContext<UnicoveContext>('state'); | ||
| const urlPath = $derived(context.urlPath); | ||
|
|
||
| const TARGET_PLUGIN_ID = 'web-authenticator'; | ||
|
|
||
| const pluginAvailable = $derived.by(() => { | ||
| const sessionKit = context.wharf.sessionKit; | ||
| if (sessionKit) { | ||
| return sessionKit.walletPlugins.some((wallet) => wallet.id === TARGET_PLUGIN_ID); | ||
| } | ||
| return true; | ||
| }); | ||
|
|
||
| async function handleGetStarted() { | ||
| if (!context.wharf.sessionKit) { | ||
| return; | ||
| } | ||
|
|
||
| const webAuthenticatorPlugin = context.wharf.sessionKit.walletPlugins.find( | ||
| (wallet) => wallet.id === TARGET_PLUGIN_ID | ||
| ); | ||
|
|
||
| if (!webAuthenticatorPlugin) { | ||
| console.error('Web Authenticator plugin not found'); | ||
| return; | ||
| } | ||
|
|
||
| const options: LoginOptions = { | ||
| walletPlugin: webAuthenticatorPlugin.id, | ||
| chain: context.network.chain.id | ||
| }; | ||
|
|
||
| try { | ||
| const session = await context.wharf.login(options); | ||
| goto(urlPath(`/account/${session.actor}`)); | ||
| } catch (error) { | ||
| console.error('Failed to login with web authenticator:', error); | ||
| } | ||
| } | ||
| </script> | ||
|
|
||
| {#if pluginAvailable} | ||
| <Button variant="primary" class="w-fit" onclick={handleGetStarted} | ||
| >Get Started - Create Account</Button | ||
| > | ||
| {/if} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,8 +11,8 @@ | |
| import waxDark from '$lib/assets/hero/wax/dark.png?enhanced'; | ||
| import UnicoveOutline from '$lib/assets/unicove-outline.svg'; | ||
|
|
||
| import { Button } from 'unicove-components'; | ||
| import { browser } from '$app/environment'; | ||
| import GetStarted from './get-started.svelte'; | ||
|
|
||
| interface Props { | ||
| networkName: string; | ||
|
|
@@ -23,7 +23,7 @@ | |
|
|
||
| let darkMode = $state(browser && localStorage.getItem('color-scheme') === 'dark'); | ||
|
|
||
| const logo = { | ||
| const logo: Record<string, string> = { | ||
| vaulta: vaultaLogo, | ||
| telos: telos, | ||
| jungle4: jungle4, | ||
|
|
@@ -181,9 +181,11 @@ | |
| {#snippet vaulta()} | ||
| <section | ||
| id="hero" | ||
| class="@container col-span-full grid h-[70svh] max-h-156 place-content-center sm:pt-12 md:pt-0" | ||
| class="@container col-span-full grid h-[40svh] max-h-156 place-content-center sm:pt-12 md:grid-cols-2 md:items-center md:pt-0" | ||
| > | ||
| <Stack class="relative grid justify-items-center gap-5 text-center"> | ||
| <Stack | ||
| class="relative z-10 row-start-1 flex grid justify-items-center gap-5 justify-self-center text-center md:col-start-1" | ||
| > | ||
| <svg | ||
| class="z-50 mb-2 h-auto w-64" | ||
| width="81" | ||
|
|
@@ -197,28 +199,23 @@ | |
| fill="currentColor" | ||
| /> | ||
| </svg> | ||
| </Stack> | ||
|
|
||
| <Stack class="z-10 grid gap-5 text-center md:col-start-2 md:row-start-1 md:text-left"> | ||
| <h1 | ||
| class="font-sans-hero max-w-128 text-3xl leading-tight font-bold text-balance lg:text-4xl lg:leading-tight" | ||
| > | ||
| <span class="">Unicove -</span> | ||
| The {networkName} web wallet and block explorer. | ||
| Unicove Your Gateway To The Vaulta Network. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm thinking there should be some punctuation after "Unicove" Either: "Unicove: Your gateway to the Vaulta network" Or: "Unicove. Your gateway to the Vaulta network"
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, would hardcoding "Vaulta" be a problem for Telos/Wax/etc.?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is in the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And sounds good, I'll just remove the word |
||
| </h1> | ||
| <p | ||
| class="text-muted mb-2 max-w-md rounded-lg text-xl leading-tight text-pretty lg:text-xl lg:leading-tight" | ||
| > | ||
| Stake, Send, Manage Tokens, and Explore {networkName} – all with ease | ||
| Create your account in minutes. Stake, swap, and manage your digital assets with complete | ||
| control. | ||
| </p> | ||
|
|
||
| <div class="grid gap-4"> | ||
| <!-- <div class="grid gap-4 @2xl:grid-cols-2"> --> | ||
| <!-- <Button variant="primary">Create your Vaulta account</Button> --> | ||
| <Button | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm assuming that it's fine to remove this button at this point.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I think so |
||
| class="text-primary bg-surface-container-lowest/20 backdrop-blur" | ||
| href="https://www.vaulta.com/resources/opening-the-gateway-to-web3-banking" | ||
| > | ||
| EOS rebrands to Vaulta | ||
| </Button> | ||
| <GetStarted /> | ||
| </div> | ||
| </Stack> | ||
| </section> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This button label has two actions: "Get started" and "Create account". Maybe we choose one or the other?
Or combine them? "Get started with an account"