Giter Club home page Giter Club logo

alchemix-v2-frontend's Introduction

Alchemix V2 UI

Repository for the v2 UI of Alchemix.

Setup

git clone https://github.com/alchemix-finance/alchemix-v2-frontend
cd alchemix-v2-frontend
cp .env.demo .env
yarn install

Fill the .env file with the required secrets.

Start local development server using yarn dev to fetch latest contract artifacts, or use yarn dev:noabi to skip that.

The app should be accessible on localhost:5005 by default.

Contributing

Branches

This repository is using two main branches for deployments:

New branches, when pushed, will also be built using our Vercel CI/CD pipeline, so minimize unneccessary pushes to tracked branches.

In general the process to contribute to the codebase looks like this:

  • Find issue or new feature you want to work on
  • Branch off of staging and use that as your working branch
  • Once ready, a pull request is supposed to be opened to merge your branch into staging

With the next deployment cycle, staging and all changes in it will be merged into prod.

Use descriptive language in your commit messages. Nobody likes to chase down changes to understand what is supposed to be changed.

Codestyle

To make it easier for all contributors, please respect the codestyle rules.

Disable hard wrapping on save in your editor for markdown files.

Note: this requires you to have done the steps in Setup first.

Webstorm

Open Webstorm settings and navigate to Preferences/Languages & Frameworks/JavaScript/Prettier, select the Prettier install from the local node_modules directory, add svelte to the glob pattern and enable Run on save for files.

Source: prettier.io docs

Next, navigate to Editor & Code Style, select Project in the scheme dropdown, click the Formatter tab and add *.md to the 'Do not Format' list.

VS Code

Using Svelte extension (recommended)

Install the svelte-vscode extension either through the marketplace, or by using the quick open command and pasting ext install JamesBirtles.svelte-vscode. Make sure VS Code settings includes

{
  "[svelte]": {
    "editor.defaultFormatter": "svelte.svelte-vscode"
  }
}

Source: svelte-vscode marketplace

Using Prettier extension

Install the prettier-vscode extension either through the marketplace, or by using the quick open command and pasting ext install esbenp.prettier-vscode. Make sure VS Code settings includes

{
  "editor.defaultFormatter": "esbenp.prettier-vscode"
}

You may also adjust that setting on a per language basis.

Source: prettier-vscode Github

alchemix-v2-frontend's People

Contributors

aleem-ahmed avatar butleratts avatar chiuzon avatar hone1er avatar n4n0gh avatar patcito avatar thegreatgildo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

alchemix-v2-frontend's Issues

i18n support

User Story

  • As an <audience/user>: user
  • I want to <action/task>: select my preferred language
  • so that <outcome/goal/benefit>: I can understand the entire application without getting lost in translation

Description

Enabling users to select their preferred language is a matter of inclusion and opening the application to a wider audience of non-english-speaking people.

Definition of Done

  • All static text and labels are located inside a dictionary file, one for each language
  • All places where static text and labels are included contain placeholders
  • Placeholders are dynamically filled based on the user's selected locale
  • The user can select a locale in the settings

Attach files or screenshots if it's helpful for this issue.

Onboard Modal Z-Index Overlap

Describe the bug

When using the onboard modal to connect a user's wallet, the z-index of the modal is the same or lower than some of the on-page content which results in content that should be covered by the modal being rendered on top of the modal instead.

Steps to Reproduce

  1. Open page
  2. Click "connect wallet"
  3. Notice that some '$' signs and other text is rendered on top of the modal

What do you believe the expected behavior is

The modal should cover all content and not have underlying content be rendered on top of it.

Relevant screenshots

Screen Shot 2021-08-04 at 1 09 05 AM

Platform details

macOS Big Sur using Chrome 92

Pie Chart Component

User Story

  • As an <audience/user>: user
  • I want to <action/task>: see a pie chart that represents either collateral or debt/credit positions
  • so that <outcome/goal/benefit>: I can get a quick overview over my accounts' balances

Description

The pie chart serves to provide a quick visual representation of the user's collateral or debt/credit positions. It puts into relation the core parts of each position (i.e. Withdrawable and Liquidatable on the collateral position).

Definition of Done

  • The component is an element component
  • The colors are exposed via props
  • The data needed to render the content is passed via props
  • The component is modelled after the figma design

Attach files or screenshots if it's helpful for this issue.

Screen Shot 2021-08-06 at 11 26 00 PM
https://www.figma.com/file/jisMpcU4jKHS712qECEPEq/Alchemxi-v2.4?node-id=0%3A1

Explore use of https://www.chartjs.org/ or other charting tools.

Port Components to Storybook

User Story

  • As an <audience/user>: developer
  • I want to <action/task>: see all available components inside the storybook instance
  • so that <outcome/goal/benefit>: I can test each of them in isolated environments

Description

Storybook is a tool that helps build new components in an isolated environment. We introduced this after we already had a bunch of components made, so now they need to be ported into the storybook.

Definition of Done

  • The stories are located inside the src/stories directory, mimicking their location inside the src/components directory
  • The stories use the LocaleWrapper if needed
  • The stories mount, render and work as intended
  • The stories contain a documentation on their intended usecase

[CORE] Action test

Describe the core feature
A clear and concise description of what the feature is supposed to do.

Additional context
Links to figma, screenshots, anything to help illustrate the feature.

Topbar

User Story

  • As an <audience/user>: user
  • I want to <action/task>: see a top bar which contains some elements
  • so that <outcome/goal/benefit>: I can see the logo of the project and interact with the elements contained within

Description

The topbar contains at minimum the Alchemix logo as well as a switch for the currency conversion (USD/EUR/etc...). Other elements may be included into it at a later time as per figma design.

Definition of Done

  • The topbar is modelled after the figma design
  • The topbar is a composed component
  • The topbar contains the Alchemix logo on the left end
  • The topbar contains a drop-down for currency conversion (mocked) on the right end

Attach files or screenshots if it's helpful for this issue.

Screen Shot 2021-07-29 at 3 01 06 PM
https://www.figma.com/file/jisMpcU4jKHS712qECEPEq/Alchemxi-v2.4?node-id=0%3A1

Sanitize Wallet Selection on Onboard

User Story

  • As an <audience/user>: developer
  • I want to <action/task>: straighten out the amount of wallets the user can sign up with
  • so that <outcome/goal/benefit>: it is easier to troubleshoot wallet connection issues

Description

In the beginning Alchemix v2 should focus on supporting a limited set of major wallets, such as Metamask, WalletConnect as well as hardware wallet integration through Trezor and Ledger.

Definition of Done

  • The walletManager helper file is extended to include a setup list for the wallets explicitely supported
  • Signing on with any of the supplied choices will work

Attach files or screenshots if it's helpful for this issue.

See https://docs.blocknative.com/onboard#wallet-modules

Toast Component

User Story

  • As an <audience/user>: user
  • I want to <action/task>: see a small toast pop up after an action is confirmed
  • so that <outcome/goal/benefit>: I can visually clarify that the process is finished

Description

The toast serves as a notification for the user to inform them about the status of the last action they've taken.

Definition of Done

  • The toast component is an element component
  • Success/Failure colors are exposed through prop success which is of type boolean
  • Showing/Hiding of an icon with loading indicator is exposed through props icon of type string and timer of type number
  • Textual content is exposed through props of type string
  • A button to check a transaction on etherscan is automatically displayed in the top right, next to the close button, if the toast context is a transaction
  • A close button is located in the top and right most corner, clicking it will dismiss the toast
  • The toast will automatically dismiss after n seconds
  • Dismiss function will dispatch an event that the parent reacts to, to hide the toast accordingly

Attach files or screenshots if it's helpful for this issue.

Screen Shot 2021-08-07 at 12 15 50 AM
Screen Shot 2021-08-07 at 12 15 53 AM
Screen Shot 2021-08-07 at 12 15 58 AM
https://www.figma.com/file/jisMpcU4jKHS712qECEPEq/Alchemxi-v2.4?node-id=0%3A1

Snapshot Governance Integration

Blocked by #12

User Story

  • As an <audience/user>: user
  • I want to <action/task>: see all ongoing governance proposals
  • so that <outcome/goal/benefit>: I can read and vote on each of them

Description

Until the DAO is ready Alchemix is using Snapshot votes to facilitate governance decisions. Instead of having to redirect users to an external page (snapshot.org) we will facilitate snapshot's API to display all open proposals on the Alchemix app instead and enable users to vote on each proposal just like they would do on snapshot's own interface.

Definition of Done

  • All open proposals are queried from snapshot's API upon mount of the governance view
  • API return is stored in state (temporary)
  • A button on the top enables users to go to the snapshot page
  • Each proposal is rendered inside a table and shows the data for title, start, end, snapshot, IPFS hash and a button to view details
  • Clicking the snapshot number will open etherscan's block explorer with that block
  • Clicking the IPFS hash will open the file on IPFS
  • Clicking the "View Details" button will reveal a detailed view of the proposal inline
  • The detailed view can be dismissed by either clicking on the same button which is now labeled "Hide Details" or by clicking the "x" in the top left of the container
  • The detailed view shows data for the description, voting options and current results (percentage and total amount of ALCX)
  • Outside of the container at the bottom left is a button to view the proposal on snapshot
  • Outside of the container at the bottom right is a button/selector combination
  • The selector includes all voting options
  • Clicking the "Cast Vote" button executes the snapshot API signing
  • The button is outlined red if no vote is selected and will not trigger if no vote is selected
  • Snapshot branding is included in the footer
  • The page is modelled after the figma design

Attach files or screenshots if it's helpful for this issue.

API
https://docs.snapshot.org/snapshot.js
snapshot-labs/snapshot.js#341

Branding
https://github.com/snapshot-labs/brand/blob/master/logo/logo.png

Design
https://www.figma.com/file/25xkwdTXwAXAHTd87KAYZJ/Alchemxi-v2.4-(n4n0-edits)?node-id=0%3A1
Screen Shot 2021-08-20 at 10 31 12 AM
Screen Shot 2021-08-20 at 10 30 46 AM

Ultrawide screens space content too far apart

Describe the bug

When using an ultrawide screen and viewing the app in a full-size window the content stretches way too far apart.

Steps to Reproduce

  1. Load app on an ultrawide screen
  2. Maximize browser window

What do you believe the expected behavior is

The content should stay closer together so elements are easier and quicker to reach

Relevant screenshots

Screen Shot 2021-08-20 at 12 42 09 PM

Additional context

Zapper and many other sites handle this by simply choosing a max-width for the entire view and then centering the content if the viewport is larger than the content max-width.
Screen Shot 2021-08-20 at 12 42 53 PM

Wallet connect

User Story

  • As an <audience/user>: user
  • I want to <action/task>: be able to use a button to easily interact with my wallet
  • so that <outcome/goal/benefit>: I can connect, disconnect and manage the wallet from within the application

Description

DAPPs feature a button to connect to and disconnect from your wallet. Alchemix is no different to this mechanic as a wallet connection is required to interact with the application.

Definition of Done

  • The container is modelled after the figma design
  • The container is a composed component
  • The container includes a button and the wallet content from #9
  • The headline shows a cog-wheel on the right
  • Clicking the cog-wheel exposes a drop down menu
  • The drop down menu should contain the entries Settings (mock), Help (mock) and Disconnect (functional)
  • The button shows a circular shape on the left with a red dot and a label "Connect Wallet" when disconnected
  • The button shows a circular avatar (blockies) with a green dot and a label with the wallet's address when connected
  • The wallet address is shortened and only shows the first and last 6 digits, connected with '...'
  • When connected, the container area extends and displays the wallet content from #9
  • The local state will only be written if the user successfully connected the wallet

Attach files or screenshots if it's helpful for this issue.

Screen Shot 2021-07-29 at 3 33 03 PM
Screen Shot 2021-07-29 at 3 33 18 PM
https://www.figma.com/file/jisMpcU4jKHS712qECEPEq/Alchemxi-v2.4?node-id=0%3A1

Settings Page

User Story

  • As an <audience/user>: user
  • I want to <action/task>: be able to visit a settings page
  • so that <outcome/goal/benefit>: I can configure the app with some defaults to my liking

Description

The settings page should incorporate some options to configure the Alchemix app to a user's liking with regards to locale settings and default suggested gas for transactions, as well as enable users to revoke active permissions on tokens. Accessing the page is done via the cogwheel and then selecting 'Settings', which means that users should be able to easily go back from where they came when they're done with the configuration.

Definition of Done

  • The settings page is a view component
  • The page is modelled after the figma design
  • A button left of the title allows users to jump back in history by 1 step
  • Zapper's API is integrated to show three gas levels
  • User settings persist even after reloading the page
  • User settings get rehydrated if persistent state exists, otherwise uses defaults (USD, English, standard gas)
  • #31

Attach files or screenshots if it's helpful for this issue.

Screen Shot 2021-08-12 at 11 32 19 AM
https://www.figma.com/file/25xkwdTXwAXAHTd87KAYZJ/Alchemxi-v2.4-(n4n0-edits)?node-id=0%3A1

Storybook integration

User Story

  • As an <audience/user>: developer
  • I want to <action/task>: create components in an isolated environment
  • so that <outcome/goal/benefit>: I can test their individual behavior extensively and ensure functionality

Description

Storybook is a component library viewer with integrated unit and visual test options. Using this will allow us to not only create proper component libraries, but also share them with UI/UX designers to enable quick and easy crosschecks (deployment via vercel).

Definition of Done

  • Storybook is installed and usable with our Svelte codebase
  • Existing components are included in the Storybook

Attach files or screenshots if it's helpful for this issue.

https://storybook.js.org/
https://storybook.js.org/docs/svelte/get-started/introduction

Accounts Page

The accounts page serves as a hub of the users finances

User Story

  • As an <audience/user>: user
  • I want to <action/task>: see an overview of my account
  • so that <outcome/goal/benefit>: I can make quick and informed decisions on what to do next

Description

The accounts page serves to display detailed information about the current stats of Alchemix (mintable debt, tvl, debt, alcx price, etc.), as well as an overview over the user's deposit and credit balances and their individual composition. Furthermore an overview over all currently running strategies chosen by the user is displayed as well, giving key informations for further decisions as well as allowing direct interactions.

Definition of Done

  • The accounts page is a view component
  • The accounts page is modelled after the figma design
  • An assortment of informations regarding Alchemix is displayed on top
  • A dropdown selector to choose specific collateral types is available, defaulting to "all"
  • Selecting a collateral type from the dropdown will redirect the user to the vault page of that collateral
  • The APY and estimated maturity of outstanding loans is displayed
  • If no loan is taken, only APY is shown
  • A box containing a pie-chart for the collateral is displayed according to the figma design (#23)
  • A box containing a pie-chart for the debt/credit is displayed according to the figma design (#23)
  • The list of strategies is displayed at the bottom, extending to the bottom as needed
  • If no strategy is active, show a button "add a strategy" instead of the strategy table

Attach files or screenshots if it's helpful for this issue.

Screen Shot 2021-08-06 at 11 14 03 PM
https://www.figma.com/file/jisMpcU4jKHS712qECEPEq/Alchemxi-v2.4?node-id=0%3A1

Using Zapper, many of the needed datum could be extracted easily, including historic data.

Landing Page

User Story

  • As an <audience/user>: user
  • I want to <action/task>: be presented with a limited set of information upon visiting the main url of the project
  • so that <outcome/goal/benefit>: I can decide what I want to do next

Description

A landing page welcomes the user and guides them to further steps like connecting their wallets or checking out whatever information is available for them.

Definition of Done

  • The landing page is modelled after the figma design
  • The landing page is a view component
  • The landing page showcases a short intro text
  • The landing page shows info cards for all collateral types containing the name, price, and logo
  • The landing page has a button that when clicked connects the user's wallet and redirects them to their dashboard

Attach files or screenshots if it's helpful for this issue.

Screen Shot 2021-07-29 at 11 53 17 AM
https://www.figma.com/file/jisMpcU4jKHS712qECEPEq/Alchemxi-v2.4?node-id=0%3A1

Table Component

A table component that holds arbitrary data and can display it

User Story

  • As an <audience/user>: user
  • I want to <action/task>: see content rendered inside a table
  • so that <outcome/goal/benefit>: it's easier to compare stats and other things between the contents rendered in each row

Description

The table component should enable arbitrary content to be placed inside it, offering a sorting function for each column with a column at the end that doesn't include a table header and only includes the button component. Each row should allow for a limited amount of interaction through the use of a button

Definition of Done

  • The table is a composed component
  • The component is modelled after the figma design
  • The columns allow for sorting by default/ascending/descending order
  • The last column doesn't allow for sorting and has no title
  • The last column contains arbitrary content
  • The table may include a '+' button in the front under certain circumstances
  • Each row may expand to reveal further content of arbitrary length and height
  • A configurable last row containing a 'submit' button and dynamic info may be rendered

Attach files or screenshots if it's helpful for this issue.

Screen Shot 2021-08-04 at 1 10 44 AM

Screen Shot 2021-08-04 at 1 14 54 AM

Screen Shot 2021-08-04 at 1 18 00 AM

https://www.figma.com/file/jisMpcU4jKHS712qECEPEq/Alchemxi-v2.4?version-id=1012140218&node-id=87%3A6

Manual Table Column Width

User Story

  • As an <audience/user>: developer
  • I want to <action/task>: specify the width of a column inside the table component
  • so that <outcome/goal/benefit>: I can control the overall size of a cell

Description

Right now the table component renders each column with the same width in respect to the overall columns it has to include. This results in cells that are sized way too large for their content.

Definition of Done

  • Colums inside the table component accept a manual sizing (may be limited to tailwind's flex/grid sizes)

Attach files or screenshots if it's helpful for this issue.

Screen Shot 2021-09-30 at 1 50 57 PM

[CORE] Better Routing

Describe the core feature
URLs should be easy to remember and not make use of # for anything else than anchors.

Additional context
Currently URLs are structured like this: https://host.tld/#/path/subpath

Sidebar

User Story

  • As an <audience/user>: user
  • I want to <action/task>: see a sidebar with interactive content
  • so that <outcome/goal/benefit>: I can navigate around the application and get an overview of some data

Description

The sidebar contains the main navigation of the application and as such is a crucial element for the entire UI.

Definition of Done

  • The sidebar is modelled after the figma design
  • The sidebar is a composed component
  • The sidebar contains a wallet connect button as per figma design
  • The sidebar contains a list of pages the user can navigate to within the app
  • Each link in the sidebar will only direct the user to the right page if the user has connected their wallet

Attach files or screenshots if it's helpful for this issue.

Screen Shot 2021-07-29 at 2 58 08 PM
https://www.figma.com/file/jisMpcU4jKHS712qECEPEq/Alchemxi-v2.4?node-id=0%3A1

Footer

User Story

  • As an <audience/user>: user
  • I want to <action/task>: see a footer area with links and contact info
  • so that <outcome/goal/benefit>: I can easier get in touch with the team or community, or access other websites from the Alchemix ecosystem

Description

The footer area is a place where easy to access links are put that users can use to quickly get in touch with the community, the team, check out documentations, audit reports or other pages from/for Alchemix. It is an expected element on websites nowadays and shouldn't be left out.

Definition of Done

Attach files or screenshots if it's helpful for this issue.

Screen Shot 2021-07-29 at 3 04 55 PM
https://www.figma.com/file/jisMpcU4jKHS712qECEPEq/Alchemxi-v2.4?node-id=0%3A1

Wallet balance list

User Story

  • As an <audience/user>: user
  • I want to <action/task>: see my wallet's balances in the sidebar
  • so that <outcome/goal/benefit>: I always keep track of my wallet's contents

Description

A list of all Tokens and their amount on the user's currently connected wallet.

Definition of Done

  • The list is modelled after the figma design
  • The list is a composed component
  • The list features each entry as a 3 column row with an icon on the left, the ticker and name next to it and the amount on the right
  • The list extends accordingly to match the content's of the wallet

Attach files or screenshots if it's helpful for this issue.

Screen Shot 2021-07-29 at 3 37 47 PM
https://www.figma.com/file/jisMpcU4jKHS712qECEPEq/Alchemxi-v2.4?node-id=0%3A1

Storybook integration fails with svelte-i18n

Describe the bug

Loading any component into the storybook integration that uses svelte-i18n functionality will result in an error that prevents the component from being rendered.

Steps to Reproduce

  1. Start up storybook
  2. Open a component that uses svelte-i18n (i.e. GasCards)
  3. See the error message

What do you believe the expected behavior is

The component should be rendered regularly like it is done on other components that don't use svelte-i18n.

Relevant screenshots

Screen Shot 2021-09-02 at 12 44 34 PM

Separate currency numbers with the correct commas

User Story

  • As an dash user:
  • I want to see currency values with the expected comma dlimitations:
  • so that the values of collateral/assets are easy to understand:

Description

Definition of Done

For example, instead of $3000, we should display $3,000

Attach files or screenshots if it's helpful for this issue.

Screen Shot 2021-08-29 at 4 23 48 PM

Create BarChart component to use on Accounts page

Screen Shot 2021-11-05 at 10 45 40 AM

User Story

  • As an <audience/user>:
  • I want to <action/task>:
  • so that <outcome/goal/benefit>:

Description

Definition of Done

  • The component is modelled after the figma design
  • The component is a (view/composed/element) component
  • The component is embedded in storybook
  • The component uses svelte-i18n for all text and labels
  • The english dictionary is extended if needed
  • More...

Attach files or screenshots if it's helpful for this issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.