Skip to content

Commit

Permalink
arbitrum rewards dashboard (#650)
Browse files Browse the repository at this point in the history
* ard

* setup CI deployment

* center

* fix copy

* add WC PROJECT ID param

* update readme, etc

* remove react svg

* make sync

---------

Co-authored-by: Sebastian Scatularo <[email protected]>
  • Loading branch information
elee1766 and sebastianscatularo authored Jan 9, 2024
1 parent 38a8e7d commit 89f2730
Show file tree
Hide file tree
Showing 48 changed files with 12,382 additions and 7 deletions.
37 changes: 36 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,36 @@ jobs:
with:
name: build-redirects
path: apps/redirects/dist

rewards-dashboard:
name: "Rewards Dashboard"
runs-on: "ubuntu-latest"
concurrency:
group: ${{ github.ref }}-${{inputs.name}}-rewards-dashboard
cancel-in-progress: true
environment: ${{inputs.environment}}
steps:
- name: Set up Node environment
uses: actions/setup-node@v3
with:
node-version: v18.17.1
- name: Checkout Rewards Dashboard
uses: actions/checkout@v3
with:
ref: ${{ inputs.project-branch }}
- name: Build Rewards Dashboard
env:
PUBLIC_URL: ${{ inputs.public-url }}
VITE_APP_WALLET_CONNECT_PROJECT_ID: ${{ secrets.REACT_APP_WALLET_CONNECT_PROJECT_ID }}
run: |
pushd apps/rewards-dashboard
npm ci
npm run build
- name: Upload Rewards Dashboard Artifact
uses: actions/upload-artifact@v3
with:
name: build-rewards-dashboard
path: apps/rewards-dashboard/dist

usdc-bridge:
name: "USDC Bridge"
runs-on: "ubuntu-latest"
Expand Down Expand Up @@ -272,6 +301,7 @@ jobs:
- advanced-tools
- usdc-bridge
- token-bridge
- rewards-dashboard
- redirects
- docs
runs-on: "ubuntu-latest"
Expand Down Expand Up @@ -301,6 +331,11 @@ jobs:
with:
name: build-docs
path: docs
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: build-rewards-dashboard
path: rewards-dashboard
- name: Download Artifact
uses: actions/download-artifact@v3
with:
Expand Down
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.PHONY: all advanced-tools redirects usdc-bridge token-bridge


all:
act --artifact-server-path /tmp/act-artifacts pull_request -s GITHUB_TOKEN=${GITHUB_TOKEN} -P=xlabs-large-runner=catthehacker/ubuntu:act-latest --container-options "--memory=10G"
advanced-tools:
act --artifact-server-path /tmp/act-artifacts pull_request -j advanced-tools -s GITHUB_TOKEN=${GITHUB_TOKEN} -P=xlabs-large-runner=catthehacker/ubuntu:act-latest --container-options "--memory=12g"
redirects:
act --artifact-server-path /tmp/act-artifacts pull_request -j redirects
usdc-bridge:
act --artifact-server-path /tmp/act-artifacts pull_request -j usdc-bridge -s GITHUB_TOKEN=${GITHUB_TOKEN}
token-bridge:
act --artifact-server-path /tmp/act-artifacts pull_request -j token-bridge -s GITHUB_TOKEN=${GITHUB_TOKEN}
rewards-dashboard:
act --artifact-server-path /tmp/act-artifacts pull_request -j rewards-dashboard -s GITHUB_TOKEN=${GITHUB_TOKEN}
4 changes: 2 additions & 2 deletions apps/connect/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion apps/connect/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const MAINNET_RPCS = {
}
}


// https://vitejs.dev/config/
export default defineConfig({
base: process.env.PUBLIC_URL || '',
Expand All @@ -34,7 +35,7 @@ export default defineConfig({
}
},
plugins: [
react(),
react(),
viteStaticCopy({
targets: [
{
Expand Down
3 changes: 2 additions & 1 deletion apps/connect/vite.token-bridge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ export default defineConfig({
...viteConfig?.define,
navBar: [
{ label: "Home", active: true, href: `${PUBLIC_URL}/` },
{ label: "USDC", href: USDC_BRIDGE_HREF }
{ label: "USDC", href: USDC_BRIDGE_HREF },
{ label: "Rewards", href: `${PUBLIC_URL}/rewards-dashboard` }
],
redirects: {
source: [
Expand Down
3 changes: 2 additions & 1 deletion apps/connect/vite.usdc-bridge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export default defineConfig({
...viteConfig?.define,
navBar: [
{ label: "Home", href: `${PUBLIC_URL}/` },
{ label: "USDC", active: true, href: `${PUBLIC_URL}/usdc-bridge` }
{ label: "USDC", active: true, href: `${PUBLIC_URL}/usdc-bridge` },
{ label: "Rewards", href: `${PUBLIC_URL}/rewards-dashboard` }
],
wormholeConnectConfig: {
...viteConfig?.define?.wormholeConnectConfig,
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/docs/faqs/_liquid-markets/matic-sol.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
| Token (origin) | Token (target) | Markets | Contract address | Notes |
|----------------|------------------|-----------------------------------------------------------|----------------------------------------------|--------|
| USDC.e | USDCpo(Wormhole) | [Saber](https://app.saber.so), [Jupiter](https://jup.ag/) | E2VmbootbVCBkMNNxKQgCLMS1X3NoGMaYAsufaAsf7M | wpUSDC |
| USDC | USDCpo(Wormhole) | [Saber](https://app.saber.so), [Jupiter](https://jup.ag/) | E2VmbootbVCBkMNNxKQgCLMS1X3NoGMaYAsufaAsf7M | wpUSDC |
| USDT | USDTpo(Wormhole) | [Saber](https://app.saber.so), [Jupiter](https://jup.ag/) | 5goWRao6a3yNC4d6UjMdQxonkCMvKBwdpubU3qhfcdf1 | wpUSDT |
18 changes: 18 additions & 0 deletions apps/rewards-dashboard/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
24 changes: 24 additions & 0 deletions apps/rewards-dashboard/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
1 change: 1 addition & 0 deletions apps/rewards-dashboard/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
legacy-peer-deps = true
1 change: 1 addition & 0 deletions apps/rewards-dashboard/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/locales/*
13 changes: 13 additions & 0 deletions apps/rewards-dashboard/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": false,
"quoteProps": "as-needed",
"jsxSingleQuote": false,
"trailingComma": "es5",
"bracketSpacing": true,
"bracketSameLine": false,
"arrowParens": "always"
}
21 changes: 21 additions & 0 deletions apps/rewards-dashboard/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Arbitrum Rewards Dashboard


This is the source for the arbitrum rewards dashboard site.

It is a vite+react app with tailwindcss, using lingui as a local cms

setup:
```
npm i
```

dev server:
```
npm run dev
```

generate lingui:
```
npm run lingui:extract
```
15 changes: 15 additions & 0 deletions apps/rewards-dashboard/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Arb Rewards Dashboard</title>
</head>
<body class="min-h-screen w-screen bg-[#010619] flex flex-col overflow-x-hidden overflow-y-hidden" >
<div id="root" class="
w-screen max-w-[1440px] grow flex flex-col overflow-y-auto h-screen
px-4 md:px-8
"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
13 changes: 13 additions & 0 deletions apps/rewards-dashboard/lingui.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { LinguiConfig } from "@lingui/conf";

const config: LinguiConfig = {
locales: ["en"],
catalogs: [
{
path: "<rootDir>/src/locales/{locale}",
include: ["src"],
},
],
};

export default config;
Loading

0 comments on commit 89f2730

Please sign in to comment.