From c168270c990bde34ad6d446b3592a4b7a136fcb8 Mon Sep 17 00:00:00 2001 From: Alexis Sellier Date: Thu, 4 Mar 2021 17:16:54 +0100 Subject: [PATCH] Move vesting to its own module --- public/index.css | 37 +++++++++ src/App.svelte | 121 ++---------------------------- src/Header.svelte | 3 +- src/base/vesting/Vesting.svelte | 89 ++++++++++++++++++++++ src/{ => base/vesting}/state.js | 1 - src/{ => base/vesting}/vesting.js | 0 src/error.js | 4 + 7 files changed, 137 insertions(+), 118 deletions(-) create mode 100644 src/base/vesting/Vesting.svelte rename src/{ => base/vesting}/state.js (85%) rename src/{ => base/vesting}/vesting.js (100%) diff --git a/public/index.css b/public/index.css index 6f4b1f77d..ec2d770b0 100644 --- a/public/index.css +++ b/public/index.css @@ -166,3 +166,40 @@ input[type="text"]::placeholder { input.wide { width: 44ch; } + +.modal { + padding: 2rem; + border: 1px solid var(--color-secondary); + box-shadow: 8px 8px 64px var(--color-secondary-2); + min-width: 480px; + text-align: center; +} +.modal-title { + font-size: 1.75rem; + margin-bottom: 1rem; + color: var(--color-secondary); + text-align: center; +} +.modal-body { + margin: 3rem 0; +} +.modal-actions { + margin-top: 2rem; + text-align: center; +} + +table { + table-layout: fixed; + border-collapse: collapse; + width: 100%; + max-width: 480px; +} +td { + text-align: left; +} +td.label { + color: var(--color-secondary); +} +td strong { + font-weight: 600; +} diff --git a/src/App.svelte b/src/App.svelte index 7c00201bf..10df43850 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -1,26 +1,21 @@
- {#await getConfig()} - - {:then config} -
-
- {#if info} - - {:else} -
- Enter your Radicle vesting contract address -
-
- -
- -
-
- -
- {/if} -
-
- {:catch error} - Ethereum wallet not available. - {/await} +
+ +
diff --git a/src/Header.svelte b/src/Header.svelte index f8bec11d4..139ceaf8c 100644 --- a/src/Header.svelte +++ b/src/Header.svelte @@ -2,9 +2,8 @@ // TODO: Shorten tx hash // TODO: Link to correct network on etherscan import { ethers } from "ethers"; - import { STATE, state, error } from "./state.js"; - import { ERROR } from "./error.js"; import { CONNECTION, session, connectWallet, disconnectWallet, shortAddress } from "./session.js"; + import { error } from './error.js'; import Logo from './Logo.svelte'; import Connect from './Connect.svelte'; diff --git a/src/base/vesting/Vesting.svelte b/src/base/vesting/Vesting.svelte new file mode 100644 index 000000000..98a145ff3 --- /dev/null +++ b/src/base/vesting/Vesting.svelte @@ -0,0 +1,89 @@ + + + + +{#await getConfig()} + +{:then config} +
+ {#if info} + + {:else} +
+ Enter your Radicle vesting contract address +
+
+ +
+ +
+
+ +
+ {/if} +
+{:catch error} + Ethereum wallet not available. +{/await} diff --git a/src/state.js b/src/base/vesting/state.js similarity index 85% rename from src/state.js rename to src/base/vesting/state.js index fd6aad0fa..7552c3519 100644 --- a/src/state.js +++ b/src/base/vesting/state.js @@ -11,4 +11,3 @@ export const STATE = { }; export const state = writable(STATE.IDLE); -export const error = writable(null); diff --git a/src/vesting.js b/src/base/vesting/vesting.js similarity index 100% rename from src/vesting.js rename to src/base/vesting/vesting.js diff --git a/src/error.js b/src/error.js index e039152aa..f9f4c0269 100644 --- a/src/error.js +++ b/src/error.js @@ -1,3 +1,7 @@ +import { writable } from "svelte/store"; + export const ERROR = { TRANSACTION_FAILED: 1, }; + +export const error = writable(null);