-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into hot-fix-fixed-nav
- Loading branch information
Showing
5 changed files
with
121 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<script lang="ts"> | ||
import Connect from '$components/Connect.svelte'; | ||
import Capacity from '$components/Capacity.svelte'; | ||
import Provider from '$components/Provider.svelte'; | ||
import KeySelection from '$components/KeySelection.svelte'; | ||
import ProviderActions from '$components/ProviderActions.svelte'; | ||
import ChainStatus from '$components/ChainStatus.svelte'; | ||
import type { ChainInfo } from '$lib/storeTypes'; | ||
import { | ||
storeBlockNumber, | ||
storeChainInfo, | ||
storeConnected, | ||
storeMsaInfo, | ||
storeToken, | ||
storeValidAccounts, | ||
transactionSigningAddress, | ||
} from '$lib/stores'; | ||
const onChangeTxnSigningAddress = (evt: Event) => { | ||
let option = evt.target as HTMLOptionElement; | ||
storeMsaInfo.set({ isProvider: false, msaId: 0, providerName: '' }); | ||
transactionSigningAddress.set(option.value); | ||
}; | ||
let token = ''; | ||
storeToken.subscribe((val) => (token = val)); | ||
let blockNumber = 0n; | ||
let epochNumber = 0n; | ||
let connected = false; | ||
let validAccounts = {}; | ||
// TODO: put all this in chainInfo and update how it's stored. | ||
storeBlockNumber.subscribe((val) => (blockNumber = val)); | ||
storeConnected.subscribe((val) => (connected = val)); | ||
storeValidAccounts.subscribe((val) => (validAccounts = val)); | ||
storeChainInfo.subscribe((info: ChainInfo) => (epochNumber = info.epochNumber)); | ||
</script> | ||
|
||
<ChainStatus {blockNumber} {connected} {token} {epochNumber} /> | ||
<div class="flex justify-center"> | ||
<Provider /> | ||
<Capacity bind:token /> | ||
</div> | ||
<div class="mt-8 text-white"> | ||
<form id="setupForm"> | ||
<Connect /> | ||
<div class:hidden={!connected} class="mt-8"> | ||
<KeySelection | ||
component="TransactionSigningKey" | ||
selectLabel="Choose a Wallet Address" | ||
selectedOption={''} | ||
onSelect={onChangeTxnSigningAddress} | ||
{validAccounts} | ||
/> | ||
</div> | ||
</form> | ||
<ProviderActions {validAccounts} /> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<script lang="ts"> | ||
export let label: string; | ||
export let id: string = ''; | ||
export let options: Record<string, string>; | ||
export let selected: string = ''; | ||
export let placeholder: string = ''; | ||
export let onChange = () => {}; | ||
export let onSelect = () => {}; | ||
export let required = false; | ||
export let disabled = false; | ||
</script> | ||
|
||
<label class="label block mb-3.5" for={id}>{label}</label> | ||
<select {id} bind:value={selected} {required} {disabled} on:change={onChange} on:select={onSelect}> | ||
{#if placeholder !== ''} | ||
<option class="text-disabled" value="" disabled selected>{placeholder}</option> | ||
{/if} | ||
{#each Object.entries(options) as [key, value]} | ||
<option value={key} class="bg-base">{key}: {value}</option> | ||
{/each} | ||
</select> | ||
|
||
<style> | ||
option[value=''][disabled] { | ||
display: none; | ||
} | ||
</style> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,17 @@ | ||
<script lang="ts"> | ||
import { | ||
storeBlockNumber, | ||
storeChainInfo, | ||
storeConnected, | ||
storeMsaInfo, | ||
storeToken, | ||
storeValidAccounts, | ||
transactionSigningAddress, | ||
} from '$lib/stores'; | ||
import Connect from '$components/Connect.svelte'; | ||
import Capacity from '$components/Capacity.svelte'; | ||
import Provider from '$components/Provider.svelte'; | ||
import KeySelection from '$components/KeySelection.svelte'; | ||
import ProviderActions from '$components/ProviderActions.svelte'; | ||
import ChainStatus from '$components/ChainStatus.svelte'; | ||
import type { ChainInfo, MsaInfo } from '$lib/storeTypes'; | ||
import bottomleft from '$lib/assets/bottom-left-bars.png'; | ||
import Dashboard from '$components/Dashboard.svelte'; | ||
import RequestToBeProvider from '$components/RequestToBeProvider.svelte'; | ||
import ProviderLogin from '$components/ProviderLogin.svelte'; | ||
import { pageContent, PageContent } from '$lib/stores'; | ||
let token = ''; | ||
let blockNumber = 0n; | ||
let epochNumber = 0n; | ||
let connected = false; | ||
let validAccounts = {}; | ||
// TODO: put all this in chainInfo and update how it's stored. | ||
storeBlockNumber.subscribe((val) => (blockNumber = val)); | ||
storeToken.subscribe((val) => (token = val)); | ||
storeConnected.subscribe((val) => (connected = val)); | ||
storeValidAccounts.subscribe((val) => (validAccounts = val)); | ||
storeChainInfo.subscribe((info: ChainInfo) => (epochNumber = info.epochNumber)); | ||
const onChangeTxnSigningAddress = (evt: Event) => { | ||
let option = evt.target as HTMLOptionElement; | ||
storeMsaInfo.set({ isProvider: false, msaId: 0, providerName: '' }); | ||
transactionSigningAddress.set(option.value); | ||
}; | ||
$pageContent = PageContent.Dashboard; | ||
</script> | ||
|
||
<ChainStatus {blockNumber} {connected} {token} {epochNumber} /> | ||
<div class="flex justify-center"> | ||
<Provider /> | ||
<Capacity bind:token /> | ||
</div> | ||
<div class="mt-8 text-white"> | ||
<form id="setupForm"> | ||
<Connect /> | ||
<div class:hidden={!connected} class="mt-8"> | ||
<KeySelection | ||
component="TransactionSigningKey" | ||
selectLabel="Choose a Wallet Address" | ||
selectedOption={''} | ||
onSelect={onChangeTxnSigningAddress} | ||
{validAccounts} | ||
/> | ||
</div> | ||
</form> | ||
<ProviderActions {validAccounts} /> | ||
</div> | ||
{#if $pageContent === PageContent.Dashboard} | ||
<Dashboard /> | ||
{:else if $pageContent === PageContent.Login} | ||
<ProviderLogin /> | ||
{:else if $pageContent === PageContent.BecomeProvider} | ||
<RequestToBeProvider /> | ||
{/if} |