This repository has been archived by the owner on Aug 1, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): project registration flow (#292)
* Set up routes for new project registration form * Match StepCounter colors to the new style * Implement project registration wizard * Improve inner element hover state rounded corners * Add elevation CSS variables * Add styled dropdown * Pre-select project and org dropdowns * Make avatar text style customisable * Remove unused Svelte store * Fix project list context menu copy-to-clipboard * Fix project list context menu button hover background color * Fix context menu stacking order * Add validation * Use <Remote> component for data fetching * Make sure a project is selected before unlocking button * Don't show validations if user hasn't touched the form * Show chosen wallet and transaction subject * Implement "back" button * Use NavigationButtons component for project registration * Extract menu items out of primitive components * Integrate project name availability check * Implement profile avatar "registered" badge * Require user handle registration before project registration * Add error handling for handle validation - don't allow uppercase letters via front-end validations - show proxy errors as notifications Co-authored-by: Alexander Simmerl <a.simmerl@gmail.com>
- Loading branch information
Showing
43 changed files
with
809 additions
and
412 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
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
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,10 @@ | ||
:root { | ||
--elevation-low: 0px 2px 4px rgba(0, 0, 0, 0.12), | ||
0px 0px 1px rgba(0, 0, 0, 0.12); | ||
|
||
--elevation-medium: 0px 4px 8px rgba(0, 0, 0, 0.12), | ||
0px 0px 1px rgba(0, 0, 0, 0.12); | ||
|
||
--elevation-high: 0px 8px 16px rgba(0, 0, 0, 0.12), | ||
0px 0px 1px rgba(0, 0, 0, 0.12); | ||
} |
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
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
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 |
---|---|---|
@@ -0,0 +1,137 @@ | ||
<script> | ||
import { Icon, Text } from "../Primitive"; | ||
import Option from "./Dropdown/Option.svelte"; | ||
export let placeholder = null; | ||
export let options = null; | ||
export let style = null; | ||
export let valid = true; | ||
export let validationMessage = null; | ||
export let validationPending = false; | ||
let expanded = false; | ||
// bind to this prop from the outside | ||
export let value = null; | ||
export let disabled = false; | ||
const toggleMenu = () => { | ||
if (disabled) { | ||
return; | ||
} | ||
expanded = !expanded; | ||
}; | ||
const hideMenu = () => { | ||
expanded = false; | ||
}; | ||
const optionSelectedHandler = event => { | ||
value = event.detail.value; | ||
toggleMenu(); | ||
}; | ||
const disabledColor = () => { | ||
return disabled | ||
? "var(--color-foreground-level-4)" | ||
: "var(--color-foreground-level-6)"; | ||
}; | ||
$: optionByValue = options.find(option => option.value === value); | ||
</script> | ||
|
||
<style> | ||
.dropdown { | ||
position: relative; | ||
cursor: pointer; | ||
} | ||
.dropdown > * { | ||
width: 100%; | ||
} | ||
.button { | ||
height: 40px; | ||
border: 1px solid var(--color-foreground-level-3); | ||
border-radius: 4px; | ||
display: flex; | ||
align-items: center; | ||
user-select: none; | ||
display: flex; | ||
justify-content: space-between; | ||
overflow: hidden; /* hack to make inner option corners rounded */ | ||
} | ||
.button:hover { | ||
box-shadow: 0px 0px 0px 1px var(--color-foreground-level-3); | ||
background-color: var(--color-foreground-level-2); | ||
color: var(--color-foreground); | ||
} | ||
.button[hidden] { | ||
visibility: hidden; | ||
} | ||
.menu { | ||
position: absolute; | ||
top: 0px; | ||
left: 0px; | ||
box-shadow: var(--elevation-medium), | ||
0px 0px 0px 1px var(--color-foreground-level-3); | ||
border: 1px solid var(--color-foreground-level-3); | ||
border-radius: 4px; | ||
user-select: none; | ||
background-color: var(--color-background); | ||
overflow: hidden; /* hack to make inner option corners rounded */ | ||
z-index: 1; | ||
} | ||
.validation-row { | ||
display: flex; | ||
align-items: center; | ||
margin-top: 12px; | ||
margin-left: 12px; | ||
} | ||
.button.invalid { | ||
box-shadow: 0 0 0 1px var(--color-negative); | ||
border: 1px solid var(--color-negative); | ||
} | ||
</style> | ||
|
||
<svelte:window on:click={hideMenu} /> | ||
|
||
<div class="dropdown" {style}> | ||
<div | ||
class="button" | ||
class:invalid={!valid} | ||
on:click|stopPropagation={toggleMenu}> | ||
{#if value && optionByValue} | ||
<Option {...optionByValue} {disabled} /> | ||
{:else} | ||
<Text style={`margin-left: 12px; color: ${disabledColor()}`}> | ||
{placeholder} | ||
</Text> | ||
{/if} | ||
<Icon.Expand | ||
style={`flex-shrink: 0; margin: 0 8px 0 8px; fill: ${disabledColor()}`} /> | ||
</div> | ||
|
||
<div class="menu" hidden={!expanded}> | ||
{#each options as option} | ||
<Option | ||
{...option} | ||
on:selected={optionSelectedHandler} | ||
selected={value === option.value} /> | ||
{/each} | ||
</div> | ||
|
||
{#if !validationPending && !valid && validationMessage} | ||
<div class="validation-row"> | ||
<Text style="color: var(--color-negative); text-align: left;"> | ||
{validationMessage} | ||
</Text> | ||
</div> | ||
{/if} | ||
</div> |
Oops, something went wrong.