Skip to content

Commit

Permalink
qs 2.0 ui (#910)
Browse files Browse the repository at this point in the history
* Initial commit (via bun create)

* bun-qs

* update readme for bun

* remove broken query call

* add export

* add deploy work flow

* update deploy.yml

* update deploy.yml

* syntax error

* add homepage

* fix module exports

* fix module export path  for gh pages

* change image paths for gh pages

* center return button

* organize modal structure

* fix balance
prepare qs queries

* add bun server for potential backend
add initial bun test

* add

* remove yarn lock

* *change network select menu *fix nav menu selection color change

* * Follow [issue](oven-sh/bun#5891)

* remove useless ignore

* *swap to testnet
*begin steaking tx

* rough swap to grpcGatewayClient

* add state management for intent tx

* deploy test

* deployment test

* ignore errors

* ts ignore

* add apr fetch

* - add zone query
- add data points

* - staking fixes

* fix inputs

* working staking tx

* fix intent memo

* - fix input number handling

* finish stakingTx

* - custom weight updates
- unstaking data points

* - finish unstaking tx
- fix broken step 4 on staking modal
- fix intent weight state managment

* - start mobile
- fix app layout
- add side header socials

* - makeshit usechains
- wallet connect button style

* - staking ui updates

* - add mobile menu

* - gov revert
- pre merge

* update todo

* update actions branch

* finish gov reversion

* - loading state ideas

* add rough assets page

* finish assets mock

* - asset page components
- asset page queries

* portfolio box queries

* fix portfolio percentages

* portfolio stuff

* move into folder that is now empty in qs repo

* add chalabi's work with the commit history

---------

Co-authored-by: Joseph Chalabi <[email protected]>
  • Loading branch information
faddat and chalabi2 authored Dec 19, 2023
1 parent 923493d commit 6d7488c
Show file tree
Hide file tree
Showing 221 changed files with 83,214 additions and 1 deletion.
1 change: 0 additions & 1 deletion .github/workflows/buildtest.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# This is a basic workflow that is manually triggered

name: build and test

# Controls when the action will run. Workflow runs when manually triggered using the UI
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/testuideploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Test Deploy to GitHub Pages

on:
push:
paths:
- web-ui/**

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest # or specify a version

- name: Install Dependencies
run: bun install

- name: Build Project
run: bun run build

- name: Export Project
run: bun export

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./out
12 changes: 12 additions & 0 deletions web-ui/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
NEXT_PUBLIC_CHAIN_ENV="preprod"
NEXT_PUBLIC_QUICKSILVER_API="https://lcd.quicksilver.zone"
NEXT_PUBLIC_QUICKSILVER_DATA_API="https://data.quicksilver.zone"
ZONE_URL="quicksilver.zone"
REACT_APP_WHITELISTED_ZONES="osmosis-1,stargaze-1,regen-1,cosmoshub-4,sommelier-3"
REACT_APP_ENABLE_UNBONDING="true"
REACT_APP_ENABLE_SET_INTENT="true"
REACT_APP_ENABLE_CLAIMS="true"
APY_ZONES_ENDPOINT = "https://chains.cosmos.directory"
NEXT_PUBLIC_OSMOSIS_API="https://api.osmosis.zone"
NEXT_PUBLIC_WHITELISTED_DENOM="uatom,ustars,uosmo,usomm,uregen"
NEXT_PUBLIC_WHITELISTED_ZONES="osmosis-1,stargaze-1,regen-1,cosmoshub-4,sommelier-3"
21 changes: 21 additions & 0 deletions web-ui/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": "next/core-web-vitals",
"plugins": ["import"],
"rules": {
"import/order": [
"error",
{
"groups": [
["builtin", "external"],
"internal",
["parent", "sibling", "index"]
],
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
]
}
}
37 changes: 37 additions & 0 deletions web-ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local
.vscode

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
7 changes: 7 additions & 0 deletions web-ui/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 140,
"tabWidth": 2
}
19 changes: 19 additions & 0 deletions web-ui/LISCENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Unauthorized production use of this software, via any platform, is strictly prohibited.

Proprietary and confidential.

Terms and Conditions:

1. You may not use, modify, copy, or distribute this software with the intent to launch it publicly without express written permission from the author.

2. You may not reverse-engineer, decompile, or disassemble the software.

3. You may not sublicense or create derivative works based on the software.

4. Use of this software without agreement to these terms is unauthorized use and subject to legal action.

5. The author makes no warranties or representations about the software's fitness for any particular purpose. You use the software at your own risk.

Contact Information:

For permission to use the software or any other inquiries, contact the author at [email protected].
64 changes: 64 additions & 0 deletions web-ui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
This is the Quicksilver Liquid Staking App bootstrapped with [`create-cosmos-app`](https://github.com/cosmology-tech/create-cosmos-app) and re-templated to work with Bun.

## Getting Started

First, install the packages and run the development server:

```bash
bun install && bun run dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the webpage.

## Making Contributions

Please work on a branch with a title that reflects what you aim to contribute and open a pull request to the `main` branch.

### Dependencies

Please use this Prettier config to format your code before opening a pull request.

```
{
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 80,
"tabWidth": 2
}
```

Please ensure your IDE is configured to use Typescript v4.9.3

### Development ToDo

**Staking Page**

- figure out a better way to fit the custom weight Ui into the modal.

- need to handle number displays better, sometimes they show NaN or undefined but quickly render

- need to update any QS endpoints that will potentially be outdated with the coming of 1.4

**UI/UX**

- customize wallet connect modal

- threejs liquid metal sphere landing page

- Mobile breakpoints

**Defi**

- design

- build

**Assets**

- design

- build

**Mobile Menu**
Binary file added web-ui/bun.lockb
Binary file not shown.
174 changes: 174 additions & 0 deletions web-ui/components/Assets/assetsGrid.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
import { Box, SimpleGrid, VStack, Text, Button, Divider, useColorModeValue, HStack, Flex, Grid, GridItem } from '@chakra-ui/react';
import React from 'react';

interface AssetCardProps {
assetName: string;
balance: string;
apy: string;
nativeAssetName: string;
}

const AssetCard: React.FC<AssetCardProps> = ({ assetName, balance, apy, nativeAssetName }) => {
return (
<VStack bg={'rgba(255,255,255,0.1)'} p={4} boxShadow="lg" align="center" spacing={4} borderRadius="lg">
<VStack w="full" align="center" alignItems={'center'} spacing={3}>
<HStack w="full" justify="space-between">
<Text fontWeight="bold" fontSize={'xl'} isTruncated>
{assetName}
</Text>
<HStack>
<Text fontSize="xs" fontWeight="light" isTruncated>
APY:
</Text>
<Text fontSize="md" fontWeight="bold" isTruncated>
{apy}
</Text>
</HStack>
</HStack>
<Divider />
<Grid mt={4} templateColumns="repeat(2, 1fr)" gap={4} w="full">
<GridItem>
<Text fontSize="md" textAlign="left">
ON QUICKSILVER:
</Text>
</GridItem>
<GridItem>
<Text fontSize="md" textAlign="right" fontWeight="semibold">
{balance}
</Text>
</GridItem>
<GridItem>
<Text fontSize="md" textAlign="left">
NON-NATIVE:
</Text>
</GridItem>
<GridItem>
<Text fontSize="md" textAlign="right" fontWeight="semibold">
{balance}
</Text>
</GridItem>
</Grid>
</VStack>

<HStack borderBottom="1px" borderBottomColor="complimentary.900" w="full" pb={4} pt={4} spacing={2}>
<Button
_active={{
transform: 'scale(0.95)',
color: 'complimentary.800',
}}
_hover={{
bgColor: 'rgba(255,128,0, 0.25)',
color: 'complimentary.300',
}}
color="white"
flex={1}
size="sm"
variant="outline"
>
Deposit
</Button>
<Button
_active={{
transform: 'scale(0.95)',
color: 'complimentary.800',
}}
_hover={{
bgColor: 'rgba(255,128,0, 0.25)',
color: 'complimentary.300',
}}
color="white"
flex={1}
size="sm"
variant="outline"
>
Withdraw
</Button>
</HStack>
<HStack w="full" justify="space-between">
<VStack>
<Text fontWeight="bold" fontSize={'xl'} isTruncated>
{nativeAssetName}
</Text>
<Divider />
</VStack>
<VStack>
<Text fontSize="md" fontWeight="bold" isTruncated></Text>
<Text fontSize="xs" fontWeight="light" isTruncated></Text>
</VStack>
</HStack>
<Grid templateColumns="repeat(2, 1fr)" gap={4} w="full">
<GridItem>
<Text fontSize="md" textAlign="left">
ON QUICKSILVER:
</Text>
</GridItem>
<GridItem>
<Text fontSize="md" textAlign="right" fontWeight="semibold">
{balance}
</Text>
</GridItem>
</Grid>
<HStack w="full" pb={4} pt={4} spacing={2}>
<Button
_active={{
transform: 'scale(0.95)',
color: 'complimentary.800',
}}
_hover={{
bgColor: 'rgba(255,128,0, 0.25)',
color: 'complimentary.300',
}}
flex={1}
size="sm"
variant="solid"
>
Deposit
</Button>
<Button
_active={{
transform: 'scale(0.95)',
color: 'complimentary.800',
}}
_hover={{
bgColor: 'rgba(255,128,0, 0.25)',
color: 'complimentary.300',
}}
flex={1}
size="sm"
variant="solid"
>
Withdraw
</Button>
</HStack>
</VStack>
);
};

const AssetsGrid = () => {
const assets = [
{ name: 'qATOM', balance: '0.123', apy: '12.34%', native: 'ATOM' },
{ name: 'qREGEN', balance: '0.123', apy: '12.34%', native: 'REGEN' },
{ name: 'qOSMO', balance: '0.123', apy: '12.34%', native: 'OSMO' },
{ name: 'qSTARS', balance: '0.123', apy: '12.34%', native: 'STARS' },
{ name: 'qSOMM', balance: '0.123', apy: '12.34%', native: 'SOMM' },
];

return (
<>
<Text fontSize="xl" fontWeight="bold" color="white" mb={4}>
Assets (qAssets + Native Balance)
</Text>
<Box overflowX="auto" w="full">
<Flex gap="8">
{assets.map((asset, index) => (
<Box key={index} minW="350px">
{' '}
<AssetCard assetName={asset.name} nativeAssetName={asset.native} balance={asset.balance} apy={asset.apy} />
</Box>
))}
</Flex>
</Box>
</>
);
};
export default AssetsGrid;
Loading

0 comments on commit 6d7488c

Please sign in to comment.