-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into sov-3013/voting-next-step
- Loading branch information
Showing
199 changed files
with
11,900 additions
and
418 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,12 @@ | ||
name: 'Pinata Unpin Content' | ||
description: 'Get a list of pinned content and unpin those content' | ||
description: 'Get a list of all pinned content and unpin it' | ||
inputs: | ||
pinataKey: | ||
description: "Pinata Key" | ||
description: 'Pinata Key' | ||
required: true | ||
pinataSecret: | ||
description: "Pinata Secret" | ||
required: true | ||
pinName: | ||
description: 'Pin Name in metadata' | ||
required: true | ||
pinEndTimestamp: | ||
description: 'Pin End Timestamp' | ||
pinataSecret: | ||
description: 'Pinata Secret' | ||
required: true | ||
runs: | ||
using: 'node16' | ||
main: 'index.js' | ||
main: 'index.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,38 @@ | ||
name: Release Frontend build to IPFS | ||
|
||
on: | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
inputs: | ||
require_unpin_previous_builds: | ||
type: boolean | ||
description: "Unpin previous builds" | ||
description: 'Unpin previous builds' | ||
|
||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
jobs: | ||
unpin_previous_builds: | ||
name: Unpin Previous Builds | ||
if: ${{ inputs.require_unpin_previous_builds }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Install Dependencies | ||
run: yarn install | ||
- name: Call Pinata API to unpin previous builds | ||
uses: ./.github/workflows/pinata_unpin_content | ||
with: | ||
pinataKey: ${{ secrets.PINATA_KEY }} | ||
pinataSecret: ${{ secrets.PINATA_SECRET }} | ||
upload_build: | ||
name: Upload Frontend Build To IPFS | ||
name: Upload Frontend Build To IPFS | ||
needs: unpin_previous_builds | ||
runs-on: ubuntu-latest | ||
outputs: | ||
outputs: | ||
commit_short_hash: ${{ steps.commit.outputs.short }} | ||
build_timestamp: ${{ steps.get_build_timestamp.outputs.build_timestamp }} | ||
cidv0: ${{ steps.upload_frontend_build.outputs.hash }} | ||
cidv1: ${{ steps.cidv0_to_cidv1.outputs.cidv1 }} | ||
cidv1: ${{ steps.cidv0_to_cidv1.outputs.cidv1 }} | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
|
@@ -33,7 +48,7 @@ jobs: | |
id: get_build_timestamp | ||
run: echo "build_timestamp=$(date +%s)" >> "$GITHUB_OUTPUT" | ||
- name: Build | ||
run: REACT_APP_IPFS_BUILD=true yarn build | ||
run: REACT_APP_IPFS_BUILD=true yarn build | ||
- name: Upload Frontend Build to IPFS via Pinata | ||
id: upload_frontend_build | ||
uses: aquiladev/ipfs-action@master | ||
|
@@ -50,23 +65,6 @@ jobs: | |
uses: Uniswap/[email protected] | ||
with: | ||
cidv0: ${{ steps.upload_frontend_build.outputs.hash }} | ||
unpin_previous_builds: | ||
name: Unpin Previous Builds | ||
needs: upload_build | ||
if: ${{ inputs.require_unpin_previous_builds }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Install Dependencies | ||
run: yarn install | ||
- name: Call Pinata API to unpin previous builds | ||
uses: ./.github/workflows/pinata_unpin_content | ||
with: | ||
pinataKey: ${{ secrets.PINATA_KEY }} | ||
pinataSecret: ${{ secrets.PINATA_SECRET }} | ||
pinName: Sovryn DAPP Frontend | ||
pinEndTimestamp: ${{ needs.upload_build.outputs.build_timestamp }} | ||
pin_build_cidv1: | ||
name: Pin Frontend Build CIDv1 | ||
needs: upload_build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
apps/frontend/src/app/2_molecules/AmountRenderer/AmountRenderer.utils.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Decimalish } from '@sovryn/utils'; | ||
|
||
import { decimalic } from '../../../utils/math'; | ||
|
||
export const isValueBetweenZeroAndOne = (value: number) => | ||
value > 0 && value < 1; | ||
|
||
export const calculateDecimalPlaces = ( | ||
value: Decimalish, | ||
precision: number, | ||
) => { | ||
const decimalValue = decimalic(value).toString(); | ||
const [, decimals = ''] = decimalValue.split('.'); | ||
const nonZeroIndex = decimals.search(/[^0]/); | ||
return nonZeroIndex !== -1 | ||
? Math.max(nonZeroIndex + 1, precision) | ||
: precision; | ||
}; |
Oops, something went wrong.