Skip to content
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

Connect footer #7

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 120 additions & 0 deletions packages/ui/demo.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<!-- <svelte:options tag="my-app" /> -->
<script lang="ts">
import type { ConfigDisconnected, StateDisconnected } from '@fractl-ui/types'
import ConnectModal from './src/components/ConnectModal/ConnectModal.svelte'
import { readable } from 'svelte/store'
const state: StateDisconnected<unknown> = {
activeRequest: null,
current: null,
status: 'disconnected'
}
const icon =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAaoAAAGqCAYAAABajwD2AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAB0ASURBVHgB7d2/jx1X2Qfws04oSKR4aeiInSAiCkhcIiSwjaAnHVKEsAtaJCokChwiEBIV/gdwQkGHCBKUARuoqGwFUVCALdFBYdMgJJJ93+u892Vycn7N3bl7n737+Uir3b135szc2d3znefM2TsHKaWjBABBnUsAEJigAiA0QQVAaIIKgNAEFQChCSoAQhNUAIQmqAAITVABEJqgAiA0QQVAaIIKgNAEFQChCSoAQhNUAIQmqAAITVABEJqgAiC0JxOcIQcHB2kJR0dHCTgZKioAQhNUAIQmqAAITVABEJqgAiA0QQVAaIIKgNAEFQChCSoAQhNUAIQmqAAITVABEJqgAiA0QQVAaIIKgNAEFQChCSoAQnOHX86Mr33ta+natWtpCd/85jfT3bt3E7B9gooz4+LFi+ny5ctpCYeHhwk4GYb+AAhNUAEQmqACIDRBBUBoggqA0AQVAKEJKgBCE1QAhCaoAAhNUAEQmqAC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vpXVcWkGXL7v+ulYdj7Q1GlKbBndp32sVYP67M30t032qtZn/PPN1889CCv9HtUMjZ6S1kFgpnYG3AqHWyU2XHe04Sx14qZNsBUht//IOL29vNKxGAjo/hqUOePp9aTv59krHubT9vL2jo6OhTrm0r73XOn1s2sb663z/a22Xjl3p59Q6Xq3jnG8HVgRVMKWOpHbWnK+TrzdneyNt19ZtPdYL49YZfau9keOTL1urjPK2Sttr7VvrdY0co1I10fo5lparvdaRYz6yndbzre3Unhv5PSn9vDibBFVQczv8kec22e6cZTbZ9kgn1lqv1JnWjt2cMDquOa9r02NQWq4XLr3n5iyz7TaEE2uuUQEQmqACIDRBBUBoggqA0AQVAKEJKgBCE1QAhCaoAAht9R913qtkgLd02Uzt3Qlq7zrQejcDWMrq9+zcOefpp4WfFFvVewuf0tseld5CB5bkROh0EVRs3dz3ilNVAVOCapCz+3lax6tUMZWGAh1zYEVQDXJ2P0/vePVulTHSBmzKSdDpYjLFIL/Y2zH3tiSwFL93p4eKapCgmm/kmOX3iQLICapBzr7m6w3t5csJLKBEUHGiBD4wl6AiDCEGlAgqtspwHnBcgmqQDnczqiTguATVIB0uwG4IqkEqKoDd+B+o3yc4nhJFRQAAAABJRU5ErkJggg=='

const config: ConfigDisconnected<unknown> = {
accountData: readable({
account: null,
balance: null,
nameService: null
}),
state: readable(state),
connectors: [
{ name: 'Test', icon, type: 'injected' },
{ name: 'Test', icon, type: 'injected' },
{ name: 'Test', icon, type: 'injected' },
{ name: 'Test', icon, type: 'injected' },
{ name: 'Test', icon, type: 'injected' },
{ name: 'Test', icon, type: 'injected' },
{ name: 'Test', icon, type: 'injected' },
{ name: 'Test', icon, type: 'injected' }
]
}
</script>

<header></header>
<main>
<div class="hero">
<h1>
<!-- Fractl-ui -->
</h1>
<p>
modular dapp UI library for the EVM <span class="whisper">
and (soon) Starknet and Cosmos and Fuel and...
</span>
</p>
</div>
<ConnectModal {state} {config} />
<!--
{#if connected}
<AccountDialog config={$config}></AccountDialog>
{/if} -->
</main>
<footer class="links">
<a href="https://github.com/sameoldlab/fractl-ui">
<svg
height="20"
aria-hidden="true"
viewBox="0 0 16 16"
fill="currentcolor"
version="1.1"
width="20"
data-view-component="true"
>
<path
d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"
></path>
</svg>
</a>
</footer>

<style>
header {
display: flex;
flex-direction: row;
justify-content: end;
}
.hero {
align-items: center;
display: flex;
flex-direction: column;
gap: 0.15rem;
max-width: 40ch;
margin: 0 auto;
text-align: center;
}
h1 {
font-weight: 300;
font-family: system-serif, cursive, 'Times New Roman', Times, serif;
margin: 0;
}
p {
opacity: 0.8;
font-size: 1em;
font-weight: 500;
}
:root {
background: hsl(0, 0%, 25%);
color: aliceblue;
}
.links {
margin: 1rem;
position: fixed;
bottom: 0;

& a {
color: inherit;
}
}

main {
display: flex;
padding: 10vh 10vw;
flex-direction: column;
gap: 3em;
align-items: center;
}
.whisper {
opacity: 0.5;
font-style: italic;
}
</style>
8 changes: 8 additions & 0 deletions packages/ui/demo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// import './app.css'
import App from './demo.svelte'

const app = new App({
target: document.getElementById('app')
})

export default app
13 changes: 13 additions & 0 deletions packages/ui/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<!-- <link rel="icon" type="image/svg+xml" href="/vite.svg" /> -->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Fractl UI</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/demo.ts"></script>
</body>
</html>
6 changes: 3 additions & 3 deletions packages/ui/src/components/Common/Modal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
</button>
</div>
</header>

<div class="fcl__dialog-content">
<slot />
</div>
Expand All @@ -101,7 +100,6 @@

<style>
@import url('../../styles/index.css');

dialog:not([open]) {
pointer-events: none;
opacity: 0;
Expand Down Expand Up @@ -180,9 +178,11 @@
font-weight: var(--fcl-modal-heading-font-weight, 700);
}
}
/*
& .fcl__dialog-content {
padding: var(--inner-padding);
padding: var(--inner-padding);
}
*/
}
/* @media (max-width: 500px) {
dialog {
Expand Down
123 changes: 62 additions & 61 deletions packages/ui/src/components/ConnectModal/ConnectModal.svelte
Original file line number Diff line number Diff line change
@@ -1,41 +1,51 @@
<script lang="ts">
import copyEN from '../../copy/copy.EN.js'
import '../../styles/index.css'
import Modal from '../Common/Modal.svelte'
import Scannable from './Scannable.svelte'
import type { ConfigDisconnected, Connector } from '@fractl-ui/types'
import Injected from './Injected.svelte'
import type { Config, Connector, State } from '@fractl-ui/types'
import { setPage, getPage } from './context.js'
import { derived } from 'svelte/store'

export let config: ConfigDisconnected
export let state
export let config: Config<Connector<unknown>>
export let state: State<unknown>
export let btnClass = ''
export let triggerText = 'Connect Wallet'

let open: () => void
let close: () => void

// export let demo = true
// export let inputWatch = true
// export let accountStatus: string
// export let chainStatus
// export let showBalance: string
setPage()
const page = getPage()

$: if (state.status === 'connected') close()

let activeRequest: Connector | null = null //config.connectors[3]
$: title = !activeRequest ? 'Connect Wallet' : activeRequest.name
const activeRequest = derived(page, ($page) => {
if (typeof $page === 'object' && $page.connecting) return $page.connecting
return null
})

const title = derived(page, ($page) => {
if ($page === 'main') return 'Connect Wallet'
if ($page === 'explainer') return 'Connect Wallet'

return $page.connecting.name || 'Connect Wallet'
})

const handleConnect = async (connector: Connector) => {
await config.reconnect([connector])

try {
console.log('config.state: ', state.status)
activeRequest = connector
$page = { connecting: connector }
await config.connect(connector)
} catch (error) {
console.error('caught: ', error)
}

console.log('config.state: ', state.status)
}
const clearRequest = () => (activeRequest = null)
const returnHome = () => ($page = 'main')
</script>

<!-- aria-expanded={open ? 'true' : 'false'} -->
Expand All @@ -49,16 +59,16 @@
</button>

<Modal
titleText={title}
titleText={$title}
bind:open
bind:close
inlineSize={activeRequest ? 260 : 240}
inlineSize={$activeRequest ? 260 : 240}
customTrigger
>
<svelte:fragment slot="icon-left">
<button
class:hide={!activeRequest}
on:click={clearRequest}
class:hide={$page === 'main'}
on:click={returnHome}
class="fcl__header-btn"
>
<svg
Expand All @@ -81,50 +91,13 @@
</button>
</svelte:fragment>

<div class="fcl__layout-1col">
{#if activeRequest}
{#if activeRequest.type === 'injected'}
<!-- <Injected connector={activeRequest}></Injected> -->
<div class="fcl__graphic-primary">
<!-- prettier-ignore -->
<svg class:hide={state.status !== 'connecting' && state.status !== 'reconnecting'} class="spin" width="108" height="108" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg" >
<path d="M98 50C98 23.4903 76.5097 2 50 2" stroke="url(#a)" stroke-width="4" stroke-linecap="round" />
<defs>
<radialGradient id="radial" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(100 50) rotate(-90) scale(47 47)" > <stop stop-color="currentColor" /> <stop offset="1" stop-color="currentColor" stop-opacity="0" /> </radialGradient>
<linearGradient x1="8.042%" y1="0%" x2="65.682%" y2="23.865%" id="a" > <stop stop-color="currentColor" stop-opacity="0" offset="0%" /> <stop stop-color="currentColor" stop-opacity=".631" offset="63.146%" /> <stop stop-color="currentColor" offset="100%" /> </linearGradient>
</defs>
</svg>
<img
class="fcl_graphic-icon rounded"
src={activeRequest.icon}
alt={activeRequest.name}
/>
</div>

{#if state.status === 'connecting' || state.status === 'reconnecting'}
<h3 class="fcl__text-primary">Requesting Connection</h3>
<p class="fcl__subhead">
{copyEN(activeRequest.name).connecting[activeRequest.type]}
</p>
{:else}
<h3 class="fcl__text-primary error">Connection Declined</h3>
<p class="fcl__subhead">
{copyEN(activeRequest.name).rejected[activeRequest.type]}
</p>
<button
on:click={() => handleConnect(activeRequest)}
class="fcl__btn-primary justify-center mt-1">Retry</button
>
{/if}
{:else if activeRequest.type === 'walletConnect'}
<Scannable connector={activeRequest} />
{/if}
{:else}
<div class="fcl__layout-1col scrollable">
{#if $page === 'main'}
<div class="connectors">
{#each config.connectors.toReversed() as connector}
{#each config.connectors as connector}
<button
on:click={() => handleConnect(connector)}
data-uid={connector.uid}
data-uid={connector.name}
class="fcl__btn-primary connector justify-between {connector.type}"
>
{connector.name}
Expand All @@ -137,17 +110,43 @@
</button>
{/each}
</div>

<slot name="footer" />
{:else if $page === 'explainer'}
<plc />
{:else if $page.connecting.type === 'injected'}
<Injected {state} {config} />
{:else if $page.connecting.type === 'walletConnect'}
<Scannable />
{/if}
</div>
<footer>
<button class="fcl__btn-text fcl__text-tertiary" on:click={() => {}}
>What is a wallet?
</button>
<slot name="footer" />
</footer>
</Modal>

<!-- </Modal> -->

<style>
@import url('../../styles/index.css');

.scrollable {
overflow-y: auto;
max-height: calc(60px * 4);
min-height: 0;
scrollbar-gutter: stable both-edges;
}
footer {
display: grid;
align-items: center;
justify-content: center;
padding: 0.725em 0 0.5em;
}
.fcl__text-tertiary {
font-size: 0.9em;
color: var(--fcl-text-tertiatry-color, oklch(61.42% 0.18 264.03));
font-weight: 600;
}
.hide {
display: none;
opacity: 0;
Expand All @@ -167,9 +166,11 @@
}

.connectors {
box-sizing: border-box;
display: grid;
width: 100%;
gap: 0.5em;
padding: 0 var(--inner-padding);
}
.connector.mock {
background: hsla(76, 20%, 15%, 1);
Expand Down
Loading