Skip to content

Commit

Permalink
solved linting issues, code preview and sync with main
Browse files Browse the repository at this point in the history
  • Loading branch information
yogesh0509 committed Mar 9, 2024
1 parent 61ca7d5 commit ca057ee
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 84 deletions.
27 changes: 1 addition & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ permissions:
contents: read # for checkout

jobs:
build-milkomeda:
build:
runs-on: ubuntu-latest

steps:
Expand All @@ -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
60 changes: 7 additions & 53 deletions .github/workflows/codepreview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -17,7 +17,7 @@ concurrency:
# contents: read # for checkout

jobs:
preview-milkomeda:
preview:
runs-on: ubuntu-latest

steps:
Expand All @@ -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: |
Expand All @@ -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 }}
12 changes: 9 additions & 3 deletions src/components/molecules/CoinCard/CoinCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,20 @@ const CoinCard = ({
{sellPriceAmount && priceAmount !== sellPriceAmount ? (
<div className="PriceInfo">
<span>Current Buy Price</span>
<h3>{priceAmount} {CHAIN_COIN}</h3>
<h3>
{priceAmount} {CHAIN_COIN}
</h3>
<span>Current Sell Price</span>
<h3>{sellPriceAmount} {CHAIN_COIN}</h3>
<h3>
{sellPriceAmount} {CHAIN_COIN}
</h3>
</div>
) : (
<div className="PriceInfo">
<span>Current Price</span>
<h3>{priceAmount} {CHAIN_COIN}</h3>
<h3>
{priceAmount} {CHAIN_COIN}
</h3>
</div>
)}
<div className="AdditionalInfo">
Expand Down
4 changes: 3 additions & 1 deletion src/components/molecules/ReservesCard/ReservesCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ const ReservesCard = ({
<div className="Content">
<div className="BaseReserves">
<span>BaseCoin ({CHAIN_COIN}) Reserves</span>
<h3>{priceAmount} {CHAIN_COIN}</h3>
<h3>
{priceAmount} {CHAIN_COIN}
</h3>
<p>{equivalence}</p>
</div>
<div className="ReservesRatio">
Expand Down
2 changes: 1 addition & 1 deletion src/utils/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ca057ee

Please sign in to comment.