From ca057ee73ed17970dd252f1ea1a7bf991d5c49dd Mon Sep 17 00:00:00 2001 From: yogesh0509 Date: Sat, 9 Mar 2024 22:39:09 +0530 Subject: [PATCH] solved linting issues, code preview and sync with main --- .github/workflows/ci.yml | 27 +-------- .github/workflows/codepreview.yml | 60 +++---------------- .../molecules/CoinCard/CoinCard.jsx | 12 +++- .../molecules/ReservesCard/ReservesCard.jsx | 4 +- src/utils/helpers.js | 2 +- 5 files changed, 21 insertions(+), 84 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d36644be..7a7ee50a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ permissions: contents: read # for checkout jobs: - build-milkomeda: + build: runs-on: ubuntu-latest steps: @@ -39,28 +39,3 @@ jobs: - name: Prepare production build run: npm run build:milkomeda-c1-testnet - - build-sepolia: - runs-on: ubuntu-latest - - steps: - - name: checkout - uses: actions/checkout@v2 - - - name: setup-node - uses: actions/setup-node@v3 - with: - node-version: 16 - - - name: Install dependencies - run: npm ci - - - name: Lint - run: npm run lint - - # TODO: Enable me once the tests are passing - # - name: Test - # run: npm run test - - - name: Prepare production build - run: npm run build:sepolia-testnet diff --git a/.github/workflows/codepreview.yml b/.github/workflows/codepreview.yml index 8bb480ee..31a57c37 100644 --- a/.github/workflows/codepreview.yml +++ b/.github/workflows/codepreview.yml @@ -2,9 +2,9 @@ name: Create preview environment on: pull_request: - branches: [main, milkomeda-c1-testnet, sepolia-testnet] + branches: [main, milkomeda-c1-testnet] push: - branches: [main, milkomeda-c1-testnet, sepolia-testnet] + branches: [main, milkomeda-c1-testnet] concurrency: # The preview script can't handle concurrent deploys @@ -17,7 +17,7 @@ concurrency: # contents: read # for checkout jobs: - preview-milkomeda: + preview: runs-on: ubuntu-latest steps: @@ -40,61 +40,15 @@ jobs: if: ${{ (github.head_ref || github.ref_name) != 'main' }} run: CI=false npm run build:milkomeda-c1-testnet - - name: Prepare build (main) - if: ${{ (github.head_ref || github.ref_name) == 'main' }} - run: CI=false npm run build:milkomeda-c1 - - - name: Create SSH key - run: | - mkdir -p ~/.ssh/ - echo "$CODEPREVIEW_PRIVATE_KEY" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - echo "StrictHostKeyChecking=no" > ~/.ssh/config - shell: bash - env: - CODEPREVIEW_PRIVATE_KEY: ${{secrets.CODEPREVIEW_PRIVATE_KEY}} - - - name: Create codepreview scripts - run: | - rm -rf ./infra - curl -u "github:$CODEPREVIEW_TOKEN" -O https://djed.codepreview.io/djed.zip - unzip djed.zip -d . - chmod +x ./infra/scripts/*.sh - shell: bash - env: - CODEPREVIEW_TOKEN: ${{secrets.CODEPREVIEW_TOKEN}} - - - name: Create preview env - run: cd infra && ./scripts/deploy-preview.sh - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - PR_NUMBER: ${{ github.event.number }} - - preview-sepolia: - runs-on: ubuntu-latest - - steps: - - name: Install ansible - run: python3 -m pip install --user ansible - - - name: checkout - uses: actions/checkout@v2 - - - uses: actions/setup-node@v3 - with: - node-version: 16 - cache: "npm" - - - name: Install dependencies - run: npm ci - + # CI=false disables reporting warnings as errors - name: Prepare build (pr) if: ${{ (github.head_ref || github.ref_name) != 'main' }} run: CI=false npm run build:sepolia-testnet + # CI=false disables reporting warnings as errors - name: Prepare build (main) if: ${{ (github.head_ref || github.ref_name) == 'main' }} - run: CI=false npm run build:sepolia + run: CI=false npm run build:milkomeda-c1 - name: Create SSH key run: | @@ -120,4 +74,4 @@ jobs: run: cd infra && ./scripts/deploy-preview.sh env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - PR_NUMBER: ${{ github.event.number }} + PR_NUMBER: ${{ github.event.number }} \ No newline at end of file diff --git a/src/components/molecules/CoinCard/CoinCard.jsx b/src/components/molecules/CoinCard/CoinCard.jsx index 8f3bce06..f23d253f 100644 --- a/src/components/molecules/CoinCard/CoinCard.jsx +++ b/src/components/molecules/CoinCard/CoinCard.jsx @@ -24,14 +24,20 @@ const CoinCard = ({ {sellPriceAmount && priceAmount !== sellPriceAmount ? (
Current Buy Price -

{priceAmount} {CHAIN_COIN}

+

+ {priceAmount} {CHAIN_COIN} +

Current Sell Price -

{sellPriceAmount} {CHAIN_COIN}

+

+ {sellPriceAmount} {CHAIN_COIN} +

) : (
Current Price -

{priceAmount} {CHAIN_COIN}

+

+ {priceAmount} {CHAIN_COIN} +

)}
diff --git a/src/components/molecules/ReservesCard/ReservesCard.jsx b/src/components/molecules/ReservesCard/ReservesCard.jsx index a3b46c20..3c4bdca1 100644 --- a/src/components/molecules/ReservesCard/ReservesCard.jsx +++ b/src/components/molecules/ReservesCard/ReservesCard.jsx @@ -21,7 +21,9 @@ const ReservesCard = ({
BaseCoin ({CHAIN_COIN}) Reserves -

{priceAmount} {CHAIN_COIN}

+

+ {priceAmount} {CHAIN_COIN} +

≈ {equivalence}

diff --git a/src/utils/helpers.js b/src/utils/helpers.js index 05596670..cb1a4896 100644 --- a/src/utils/helpers.js +++ b/src/utils/helpers.js @@ -14,7 +14,7 @@ export function buildTx(from_, to_, value_, data_, setGasLimit = true) { to: to_, from: from_, value: "0x" + new BN(value_).toString(16), - data: data_, + data: data_ }; if (setGasLimit) { tx.gasLimit = 500_000;