Skip to content

Commit

Permalink
Sync Merkl-app (#55)
Browse files Browse the repository at this point in the history
* Sync Merkl-app

* lint
  • Loading branch information
hugolxt authored Jan 7, 2025
1 parent a4d757a commit f3d56d3
Show file tree
Hide file tree
Showing 109 changed files with 2,889 additions and 1,510 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/update_production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Trigger production deployment

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

defaults:
run:
shell: bash

jobs:
tag-image:
runs-on: ubuntu-latest
env:
IMAGE_URL: europe-west1-docker.pkg.dev/angle-artifacts/angle-docker-registry/merkl-app
steps:
- uses: 'google-github-actions/auth@v0'
with:
credentials_json: '${{ secrets.GCLOUD_SECRET_ARTIFACTS }}'
- name: Login to Docker
run: gcloud auth configure-docker europe-west1-docker.pkg.dev
- name: Pull and tag image
run: |
export SHORT_SHA=${GITHUB_SHA:0:7}
export VERSION=${GITHUB_REF#refs/tags/}
docker pull $IMAGE_URL:$SHORT_SHA
docker tag $IMAGE_URL:$SHORT_SHA $IMAGE_URL:$VERSION
docker push $IMAGE_URL:$VERSION
trigger-production-deployment:
runs-on: ubuntu-latest
needs: tag-image
steps:
- name: Install dependencies
run: |
sudo snap install yq
- name: Clone deployments repo
uses: actions/checkout@v3
with:
repository: AngleProtocol/deployments
token: ${{ secrets.ACCESS_TOKEN }}
path: deployments
- name: Modify config.production.yaml and push to deployments
run: |
cd deployments
export VERSION=${GITHUB_REF#refs/tags/}
yq -i '.merkl-app.version = strenv(VERSION)' ./config.production.yaml
git config --global user.email "[email protected]"
git config --global user.name "BaptistG"
git add ./config.production.yaml
git commit -m "Update config.production.yaml with merkl-app version $VERSION"
git push
68 changes: 68 additions & 0 deletions .github/workflows/update_staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build image and trigger staging deployment

on:
workflow_dispatch:
push:
branches:
- main

defaults:
run:
shell: bash

jobs:
build-image:
runs-on: ubuntu-latest
env:
IMAGE_URL: europe-west1-docker.pkg.dev/angle-artifacts/angle-docker-registry/merkl-app
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
token: '${{ secrets.ACCESS_TOKEN }}'
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: 'google-github-actions/auth@v0'
with:
credentials_json: '${{ secrets.GCLOUD_SECRET_ARTIFACTS }}'
- name: Login to Docker
run: gcloud auth configure-docker europe-west1-docker.pkg.dev
- name: Build image
run: |
export SHORT_SHA=${GITHUB_SHA:0:7}
docker pull $IMAGE_URL:latest || true
docker build --cache-from $IMAGE_URL:latest --tag $IMAGE_URL:$SHORT_SHA --tag $IMAGE_URL:latest .
- name: Push image
run: |
export SHORT_SHA=${GITHUB_SHA:0:7}
docker push $IMAGE_URL:$SHORT_SHA
trigger-staging-deployment:
runs-on: ubuntu-latest
needs: build-image
steps:
- name: Install dependencies
run: |
sudo snap install yq
- name: Clone deployments repo
uses: actions/checkout@v3
with:
repository: AngleProtocol/deployments
token: ${{ secrets.ACCESS_TOKEN }}
path: deployments
- name: Modify config.staging.yaml and push to deployments
run: |
cd deployments
export SHORT_SHA=${GITHUB_SHA:0:7}
yq -i '.merkl-app.version = strenv(SHORT_SHA)' ./config.staging.yaml
git config --global user.email "[email protected]"
git config --global user.name "BaptistG"
git add ./config.staging.yaml
git commit -m "Update config.staging.yaml with merkl-app version $SHORT_SHA"
git push
6 changes: 4 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"editor.formatOnSave": true,
"editor.formatOnType": false,
"editor.foldingImportsByDefault": true,
"editor.foldingHighlight": true,
"editor.foldingStrategy": "auto",
"files.eol": "\n"
"files.eol": "\n",
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
}
}
Binary file modified bun.lockb
Binary file not shown.
89 changes: 74 additions & 15 deletions merkl.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { createConfig } from "src/config/type";
import hero from "src/customer/assets/images/hero.jpg?url";
import { v4 as uuidv4 } from "uuid";
import { http, createClient, custom } from "viem";

import {
arbitrum,
astar,
Expand Down Expand Up @@ -41,16 +40,54 @@ import {
zksync,
} from "viem/chains";
import { eip712WalletActions } from "viem/zksync";
import { coinbaseWallet, walletConnect } from "wagmi/connectors";
import { walletConnect } from "wagmi/connectors";

export default createConfig({
appName: "Merkl",
modes: ["dark", "light"],
defaultTheme: "ignite",
tags: [],
opportunityNavigationMode: "direct",
rewardsNavigationMode: "chain",
tokenSymbolPriority: ["ZK", "USDC", "USDC.e", "ETH", "WETH", "WBTC", "wstETH", "USDT", "USDe", "weETH", "DAI"],
opportunityCellHideTags: ["token", "action"],
opportunityLibraryDefaultView: "table",
// opportunityLibraryExcludeFilters: ["protocol","action"],
opprtunityPercentage: true,
hideLayerMenuHomePage: false,
supplyCredits: [],
deposit: true,
walletOptions: {
hideInjectedWallets: ["phantom", "coinbase wallet"],
sponsorTransactions: true,
client(c) {
if (c.chain?.id === zksync.id) return c.extend(eip712WalletActions());
},
},
chains: [],
opportunity: {
featured: {
enabled: false,
length: 6,
},
},
bridge: {
helperLink: "",
},
dashboard: {
liquidityTab: {
enabled: false,
},
},
tagsDetails: {
token: {
visitOpportunities: {
enabled: true,
},
},
},
decimalFormat: {
dollar: "$0,0.##a",
},
themes: {
ignite: {
base: createColoring(["#1755F4", "#FF7900", "#0D1530"], ["#1755F4", "#FF7900", "#FFFFFF"]),
Expand Down Expand Up @@ -86,6 +123,8 @@ export default createConfig({
spacing: { xs: 2, sm: 4, md: 8, lg: 12, xl: 16 },
radius: { xs: 3, sm: 6, md: 9, lg: 12, xl: 15 },
},
alwaysShowTestTokens: true,
showCopyOpportunityIdToClipboard: true,
images: {
hero: hero,
},
Expand All @@ -100,16 +139,16 @@ export default createConfig({
route: "/opportunities",
key: uuidv4(),
},
// protocols: {
// icon: "RiVipCrown2Fill",
// route: "/protocols",
// key: uuidv4(),
// },
// bridge: {
// icon: "RiCompassesLine",
// route: "/bridge",
// key: uuidv4(),
// },
protocols: {
icon: "RiVipCrown2Fill",
route: "/protocols",
key: uuidv4(),
},
bridge: {
icon: "RiCompassesLine",
route: "/bridge",
key: uuidv4(),
},
docs: {
icon: "RiFile4Fill",
external: true,
Expand All @@ -132,6 +171,27 @@ export default createConfig({
// key: uuidv4(),
// },
},
header: {
searchbar: {
enabled: true,
},
opportunities: {
enabled: false,
},
bridge: {
enabled: false,
},
// terms: {
// icon: "RiCompassesLine",
// route: "/terms",
// key: uuidv4(),
// },
// privacy: {
// icon: "RiInformationFill",
// route: "/privacy",
// key: uuidv4(),
// },
},
socials: {
discord: "",
telegram: "https://t.me/+2T0RNabX2ANkMzAx",
Expand Down Expand Up @@ -192,14 +252,13 @@ export default createConfig({
},
ssr: true,
connectors: [
coinbaseWallet(),
walletConnect({
customStoragePrefix: "wagmi",
projectId: "26c912aadd2132cd869a5edc00aeea0f",
metadata: {
name: "Merkl Lite",
description: "Merkl Lite",
url: "https://app.merkl.xyz.com",
url: "https://app.merkl.xyz",
icons: [],
},
}),
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"@ariakit/react": "^0.4.12",
"@elysiajs/eden": "^1.1.3",
"@emotion/css": "^11.13.4",
"@merkl/api": "0.10.188",
"@lifi/widget": "^3.13.1",
"@merkl/api": "0.10.262",
"@radix-ui/react-accordion": "^1.2.1",
"@radix-ui/react-scroll-area": "^1.2.0",
"@remix-run/dev": "^2.11.2",
Expand All @@ -42,15 +43,16 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-responsive": "^10.0.0",
"react-toastify": "^11.0.2",
"remix-utils": "^7.7.0",
"save": "^2.9.0",
"tailwindcss": "^3.4.12",
"tailwindcss-animate": "^1.0.7",
"typedoc": "^0.26.7",
"uuid": "^11.0.3",
"viem": "2.21.54",
"viem": "2.21.33",
"vite-plugin-dts": "^4.2.1",
"wagmi": "^2.12.29",
"wagmi": "^2.14.6",
"zustand": "^5.0.0-rc.2"
},
"devDependencies": {
Expand Down
24 changes: 24 additions & 0 deletions src/I18n/en.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const en = {
pages: {
home: {
depositInformation: "",
},
opportunities: {
title: "Explore opportunities",
description: "Browse opportunities, compare rewards, and earn tokens",
},
campaings: {
title: "Explore opportunities",
description: "Browse opportunities, compare rewards, and earn tokens",
},
bridge: {
helper: "",
},
dashboard: {
explanation:
"Pending rewards are updated approximately every 4 hours, but are claimable onchain once every week.\nIf you don’t claim your rewards from a week, you may always claim them at a later time.",
},
},
};

export default en;
34 changes: 34 additions & 0 deletions src/I18n/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import en from "./en";

type LanguageFiles = typeof en;

/**
* I18n class to handle translations
*/
export class I18n {
public static readonly trad: I18n = new I18n(en);

private primary: LanguageFiles;
// private secondary: LanguageFiles;

public get: LanguageFiles;

constructor(primary: LanguageFiles) {
this.primary = primary;
// this.secondary = secondary;
this.get = this.createProxy(this.primary);
}

// proxy to handle typing autocompletion
private createProxy<T extends object>(obj: T): T {
return new Proxy(obj, {
get: (target, prop) => {
const value = target[prop as keyof T];
if (typeof value === "object" && value !== null) {
return this.createProxy(value as object);
}
return value;
},
});
}
}
Loading

0 comments on commit f3d56d3

Please sign in to comment.