From c31fdf5b9018c62e138c59cc65c6704631377af9 Mon Sep 17 00:00:00 2001 From: Ignacio Date: Tue, 27 Feb 2024 15:49:11 +0800 Subject: [PATCH] fix: add proxy and undelegate message --- .github/workflows/check.yml | 17 ++++++++ .github/workflows/gh-pages.yml | 34 --------------- next.config.mjs | 8 +++- src/app/layout.tsx | 3 +- src/features/staking/components/logged-in.tsx | 15 ++++++- src/features/staking/context/actions.ts | 14 +++++++ src/features/staking/lib/constants.ts | 5 ++- src/features/staking/lib/core.ts | 42 ++++++++++++++++++- 8 files changed, 97 insertions(+), 41 deletions(-) create mode 100644 .github/workflows/check.yml delete mode 100644 .github/workflows/gh-pages.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..1d4294a --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,17 @@ +name: Test +on: push +jobs: + Lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 20 + + - run: yarn --immutable + + - run: yarn lint + - run: yarn test + - run: yarn type-check + - run: yarn build diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml deleted file mode 100644 index a0886e1..0000000 --- a/.github/workflows/gh-pages.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: GitHub Pages - -on: - push: - branches: - - main - -jobs: - deploy: - runs-on: ubuntu-22.04 - permissions: - contents: write - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - steps: - - uses: actions/checkout@v3 - with: - submodules: true # Fetch Hugo themes (true OR recursive) - fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod - - - uses: actions/setup-node@v4 - with: - node-version: 20 - - - name: Build - run: | - npm i - npm run build - - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./out diff --git a/next.config.mjs b/next.config.mjs index cb15c19..deba258 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,9 +1,13 @@ const nextConfig = { - basePath: "/xion-staking", eslint: { ignoreDuringBuilds: process.env.QUICK_BUILD === "true", }, - output: "export", + rewrites: async () => [ + { + destination: "https://rpc.xion-testnet-1.burnt.com:443", + source: "/rpc", + }, + ], typescript: { ignoreBuildErrors: process.env.QUICK_BUILD === "true", }, diff --git a/src/app/layout.tsx b/src/app/layout.tsx index c8b64a3..b0303b5 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -6,7 +6,7 @@ import "@burnt-labs/ui/dist/index.css"; import { Inter } from "next/font/google"; import { StakingProvider } from "@/features/staking/context/provider"; -import { dashboardUrl } from "@/features/staking/lib/constants"; +import { dashboardUrl, rpcEndpoint } from "@/features/staking/lib/constants"; import "./globals.css"; @@ -15,6 +15,7 @@ const inter = Inter({ subsets: ["latin"] }); const abstraxionConfig = { contracts: [], dashboardUrl, + rpcUrl: rpcEndpoint, stake: true, }; diff --git a/src/features/staking/components/logged-in.tsx b/src/features/staking/components/logged-in.tsx index 1f57cdb..0d4622b 100644 --- a/src/features/staking/components/logged-in.tsx +++ b/src/features/staking/components/logged-in.tsx @@ -7,7 +7,7 @@ import Link from "next/link"; import { memo, useState } from "react"; import type { StakingState } from "../context"; -import { stakeValidator } from "../context/actions"; +import { stakeValidator, unstakeValidator } from "../context/actions"; import { useStaking } from "../context/hooks"; import { formatCoin } from "../lib/coins"; import { chainId } from "../lib/constants"; @@ -89,6 +89,19 @@ function StakingPage() {