From 3ab616d63d0cb85cf591a9dcf00fa1ac7806c791 Mon Sep 17 00:00:00 2001 From: sara Date: Thu, 11 Jan 2024 15:41:04 -0300 Subject: [PATCH] feat: workflow added --- .github/workflows/build.yml | 25 +++++++++++++++++++++++++ package.json | 2 +- src/components/WalletWidget/Balance.tsx | 6 ++++-- 3 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..29d45c6 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,25 @@ +name: Build Check + +on: + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 20.3.1 + + - name: Install dependencies + run: npm install + + - name: Build + run: npm run build || exit 1 diff --git a/package.json b/package.json index 244f91c..aa21942 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "scripts": { - "build": "next build", + "build": "next build || exit 1", "db:push": "prisma db push", "db:studio": "prisma studio", "dev": "next dev", diff --git a/src/components/WalletWidget/Balance.tsx b/src/components/WalletWidget/Balance.tsx index afd0087..75382af 100644 --- a/src/components/WalletWidget/Balance.tsx +++ b/src/components/WalletWidget/Balance.tsx @@ -18,10 +18,12 @@ export const Balance = () => { } }; - const balanceInt = Math.floor(Number(intToDecimal(balance, 6))); + const decimals: string = 6; + + const balanceInt = Math.floor(Number(intToDecimal(balance, decimals))); const balanceDecimals = Number( - balance - (decimalToInt(BigInt(balanceInt), 6) as bigint), + balance - (decimalToInt(BigInt(balanceInt), decimals) as bigint), ); return (