From 79f360dc24369a4d8a3528d9e2ce924b0b1ab7e3 Mon Sep 17 00:00:00 2001 From: dexturr Date: Mon, 27 Feb 2023 12:10:43 +0000 Subject: [PATCH 1/4] chore: update tranches Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- apps/static/src/assets/mainnet-tranches.json | 53 ++++++++++++-------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/apps/static/src/assets/mainnet-tranches.json b/apps/static/src/assets/mainnet-tranches.json index f759b39d0..5a7d0565d 100644 --- a/apps/static/src/assets/mainnet-tranches.json +++ b/apps/static/src/assets/mainnet-tranches.json @@ -2761,7 +2761,7 @@ "tranche_end": "2023-12-05T00:00:00.000Z", "total_added": "86666.297", "total_removed": "0", - "locked_amount": "66660.1864521651085953168", + "locked_amount": "66600.6885662553549491123", "deposits": [ { "amount": "86666.297", @@ -2827,7 +2827,7 @@ "tranche_end": "2023-06-01T00:00:00.000Z", "total_added": "2500", "total_removed": "0", - "locked_amount": "1287.68044744607225", + "locked_amount": "1284.23843228530725", "deposits": [ { "amount": "2500", @@ -3215,7 +3215,7 @@ "tranche_end": "2023-08-01T00:00:00.000Z", "total_added": "37500", "total_removed": "3295.491386325", - "locked_amount": "32060.042107888275", + "locked_amount": "32008.126630601595", "deposits": [ { "amount": "7500", @@ -3359,7 +3359,7 @@ "tranche_end": "2023-12-05T00:00:00.000Z", "total_added": "129999.45", "total_removed": "0", - "locked_amount": "66599.36741953379042928", + "locked_amount": "66539.923817958609949455", "deposits": [ { "amount": "129999.45", @@ -3425,7 +3425,7 @@ "tranche_end": "2023-09-03T00:00:00.000Z", "total_added": "62600", "total_removed": "0", - "locked_amount": "32199.23383434805018", + "locked_amount": "32156.25787037037408", "deposits": [ { "amount": "10000", @@ -3618,7 +3618,7 @@ "tranche_end": "2023-09-17T00:00:00.000Z", "total_added": "5000", "total_removed": "0", - "locked_amount": "2763.604610603755", + "locked_amount": "2760.1720256215125", "deposits": [ { "amount": "5000", @@ -3829,7 +3829,7 @@ "tranche_end": "2023-04-05T00:00:00.000Z", "total_added": "97499.58", "total_removed": "0", - "locked_amount": "8549.9770497729426934506", + "locked_amount": "8491.6684140496565878092", "deposits": [ { "amount": "97499.58", @@ -3862,7 +3862,7 @@ "tranche_end": "2023-04-05T00:00:00.000Z", "total_added": "135173.4239508", "total_removed": "98230.390980249184455396", - "locked_amount": "11686.34253508108202110958958", + "locked_amount": "11606.644696613363239057508256", "deposits": [ { "amount": "135173.4239508", @@ -3908,7 +3908,7 @@ "tranche_end": "2023-04-05T00:00:00.000Z", "total_added": "32499.86", "total_removed": "0", - "locked_amount": "3596.8276946333941696698", + "locked_amount": "3572.2982585208873489478", "deposits": [ { "amount": "32499.86", @@ -3941,7 +3941,7 @@ "tranche_end": "2023-04-05T00:00:00.000Z", "total_added": "10833.29", "total_removed": "0", - "locked_amount": "1170.7325118133853096759", + "locked_amount": "1162.7484183867779537778", "deposits": [ { "amount": "10833.29", @@ -3974,7 +3974,7 @@ "tranche_end": "2023-04-05T00:00:00.000Z", "total_added": "22749.93", "total_removed": "4720.860935375", - "locked_amount": "4376.4596075425397060448", + "locked_amount": "4346.6132830988218703751", "deposits": [ { "amount": "6500", @@ -4126,7 +4126,7 @@ "tranche_end": "2023-05-01T00:00:00.000Z", "total_added": "22500", "total_removed": "4832.532899775", - "locked_amount": "7799.561176335174675", + "locked_amount": "7768.411889963167125", "deposits": [ { "amount": "7500", @@ -4390,7 +4390,7 @@ "tranche_end": "2023-06-02T00:00:00.000Z", "total_added": "1939928.38", "total_removed": "928642.9598472029154", - "locked_amount": "503547.66972674586634472", + "locked_amount": "502215.87592198306198629", "deposits": [ { "amount": "1852091.69", @@ -36770,7 +36770,7 @@ "tranche_end": "2023-06-05T00:00:00.000Z", "total_added": "3732368.4671", "total_removed": "615950.831401702010493", - "locked_amount": "798278.776421275325414380233", + "locked_amount": "796232.273024709558568810279", "deposits": [ { "amount": "1998.95815", @@ -38118,8 +38118,8 @@ "tranche_start": "2022-06-05T00:00:00.000Z", "tranche_end": "2023-12-05T00:00:00.000Z", "total_added": "15870102.715470999700000001", - "total_removed": "579941.15446796566514452", - "locked_amount": "8130332.8724344144040666925862118737483104", + "total_removed": "581409.88924190582035452", + "locked_amount": "8123076.1027882686093883722947201633400919", "deposits": [ { "amount": "16249.93", @@ -38633,6 +38633,11 @@ "user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b", "tx": "0x2d99d4051c6ac81037db1eebf0f86b335ed9d1957f281134d07da192644a6a8c" }, + { + "amount": "1468.73477394015521", + "user": "0xe3eB4CF43C072658401996b71D43eE26E573562D", + "tx": "0x525f9427c131bc2fdea7f556d16b7781faaa41e09c7735d1c02d1f7585cc49ab" + }, { "amount": "535.4042378778335", "user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b", @@ -41844,6 +41849,12 @@ } ], "withdrawals": [ + { + "amount": "1468.73477394015521", + "user": "0xe3eB4CF43C072658401996b71D43eE26E573562D", + "tranche_id": 2, + "tx": "0x525f9427c131bc2fdea7f556d16b7781faaa41e09c7735d1c02d1f7585cc49ab" + }, { "amount": "1640.93679110232897", "user": "0xe3eB4CF43C072658401996b71D43eE26E573562D", @@ -42086,8 +42097,8 @@ } ], "total_tokens": "150551.801", - "withdrawn_tokens": "71968.00074341356817", - "remaining_tokens": "78583.80025658643183" + "withdrawn_tokens": "73436.73551735372338", + "remaining_tokens": "77115.06548264627662" }, { "address": "0x4d982Ab0823fD2f48e934a7be2bb0a5374a26148", @@ -43861,7 +43872,7 @@ "tranche_end": "2023-05-05T00:00:00.000Z", "total_added": "14597706.0446472999", "total_removed": "5576016.212508497282613906", - "locked_amount": "1784426.168875606617258788877936648", + "locked_amount": "1777726.765473197066260457387430519", "deposits": [ { "amount": "129284.449", @@ -50908,7 +50919,7 @@ "tranche_end": "2023-04-05T00:00:00.000Z", "total_added": "5778205.3912159303", "total_removed": "3055768.040200763217391295", - "locked_amount": "388134.167902190321713268137737088", + "locked_amount": "385487.193100244108102591696423251", "deposits": [ { "amount": "552496.6455", @@ -52947,7 +52958,7 @@ "tranche_end": "2023-06-05T00:00:00.000Z", "total_added": "472355.6199999996", "total_removed": "34416.2282090650685", - "locked_amount": "126491.83527997644210121089142566", + "locked_amount": "126167.555118478468636691490005064", "deposits": [ { "amount": "3000", From 4bb78e98919f566b6f431eaa5af50687a9513a7d Mon Sep 17 00:00:00 2001 From: Maciek Date: Mon, 27 Feb 2023 16:44:48 +0100 Subject: [PATCH 2/4] chore(ui-toolkit): loader no rerender version only (#3011) --- apps/static/src/assets/preloader.css | 108 +++++++++++++ .../components/preloader/preloader.tsx | 2 +- apps/trading/pages/gen-styles.scss | 33 ++-- apps/trading/public/preloader.css | 146 +++++++++--------- .../src/components/loader/loader.tsx | 21 +-- 5 files changed, 202 insertions(+), 108 deletions(-) create mode 100644 apps/static/src/assets/preloader.css diff --git a/apps/static/src/assets/preloader.css b/apps/static/src/assets/preloader.css new file mode 100644 index 000000000..9ea72991c --- /dev/null +++ b/apps/static/src/assets/preloader.css @@ -0,0 +1,108 @@ +.pre-loader { + display: flex; + width: 100%; + min-height: 100vh; + justify-content: center; + align-items: center; +} +.pre-loader .loader-item { + width: 10px; + height: 10px; + background: #000; +} +.pre-loader .pre-loader-center { + align-items: center; + display: flex; + flex-direction: column; +} +.pre-loader .pre-loader-wrapper { + width: 50px; + height: 50px; + display: flex; + flex-wrap: wrap; +} +.loader-item:nth-child(0) { + animation-delay: 0ms; + animation-direction: reverse; +} +.loader-item:first-child { + animation-delay: -0.2s; + animation-direction: alternate; +} +.loader-item:nth-child(2) { + animation-delay: 0.4s; + animation-direction: reverse; +} +.loader-item:nth-child(3) { + animation-delay: -0.15s; + animation-direction: alternate; +} +.loader-item:nth-child(4) { + animation-delay: 0.6s; + animation-direction: reverse; +} +.loader-item:nth-child(5) { + animation-delay: -1s; + animation-direction: alternate; +} +.loader-item:nth-child(6) { + animation-delay: 0.3s; + animation-direction: reverse; +} +.loader-item:nth-child(7) { + animation-delay: -0.35s; + animation-direction: alternate; +} +.loader-item:nth-child(8) { + animation-delay: 2s; + animation-direction: reverse; +} +.loader-item:nth-child(9) { + animation-delay: -0.45s; + animation-direction: alternate; +} +.loader-item:nth-child(10) { + animation-delay: 2s; + animation-direction: reverse; +} +.loader-item:nth-child(11) { + animation-delay: -0.55s; + animation-direction: alternate; +} +.loader-item:nth-child(12) { + animation-delay: 1.2s; + animation-direction: reverse; +} +.loader-item:nth-child(13) { + animation-delay: -2.6s; + animation-direction: alternate; +} +.loader-item:nth-child(14) { + animation-delay: 2.8s; + animation-direction: reverse; +} +.loader-item:nth-child(15) { + animation-delay: -3s; + animation-direction: alternate; +} +.loader-item:nth-child(16) { + animation-delay: 1.6s; + animation-direction: reverse; +} +.loader-item { + animation: flickering 0.4s linear infinite alternate; +} +@keyframes flickering { + 0% { + opacity: 1; + } + 25% { + opacity: 1; + } + 26% { + opacity: 0; + } + to { + opacity: 0; + } +} diff --git a/apps/trading/components/preloader/preloader.tsx b/apps/trading/components/preloader/preloader.tsx index 7ae503363..a973d590b 100644 --- a/apps/trading/components/preloader/preloader.tsx +++ b/apps/trading/components/preloader/preloader.tsx @@ -13,7 +13,7 @@ export const Preloader = () => { `}
- +
); diff --git a/apps/trading/pages/gen-styles.scss b/apps/trading/pages/gen-styles.scss index 6737f9167..c25e95f6a 100644 --- a/apps/trading/pages/gen-styles.scss +++ b/apps/trading/pages/gen-styles.scss @@ -4,17 +4,10 @@ min-height: 100vh; justify-content: center; align-items: center; - - @for $i from 0 through 16 { - .loader-item:nth-child(#{$i}) { - @if $i % 2 == 0 { - animation-delay: #{$i * 50 * random(5)}ms; - animation-direction: reverse; - } @else { - animation-delay: #{$i * -50 * random(5)}ms; - animation-direction: alternate; - } - } + .loader-item { + width: 10px; + height: 10px; + background: black; } .pre-loader-center { align-items: center; @@ -27,13 +20,21 @@ display: flex; flex-wrap: wrap; } - .loader-item { - width: 10px; - height: 10px; - background: black; - animation: flickering 0.4s steps(2, jump-none) alternate infinite; +} +@for $i from 0 through 16 { + .loader-item:nth-child(#{$i}) { + @if $i % 2 == 0 { + animation-delay: #{$i * 50 * random(5)}ms; + animation-direction: reverse; + } @else { + animation-delay: #{$i * -50 * random(5)}ms; + animation-direction: alternate; + } } } +.loader-item { + animation: flickering 0.4s linear alternate infinite; +} @keyframes flickering { 0% { opacity: 1; diff --git a/apps/trading/public/preloader.css b/apps/trading/public/preloader.css index 33afae4ea..9ea72991c 100644 --- a/apps/trading/public/preloader.css +++ b/apps/trading/public/preloader.css @@ -5,73 +5,10 @@ justify-content: center; align-items: center; } -.pre-loader .loader-item:nth-child(0) { - animation-delay: 0ms; - animation-direction: reverse; -} -.pre-loader .loader-item:first-child { - animation-delay: -0.2s; - animation-direction: alternate; -} -.pre-loader .loader-item:nth-child(2) { - animation-delay: 0.1s; - animation-direction: reverse; -} -.pre-loader .loader-item:nth-child(3) { - animation-delay: -0.15s; - animation-direction: alternate; -} -.pre-loader .loader-item:nth-child(4) { - animation-delay: 1s; - animation-direction: reverse; -} -.pre-loader .loader-item:nth-child(5) { - animation-delay: -0.25s; - animation-direction: alternate; -} -.pre-loader .loader-item:nth-child(6) { - animation-delay: 0.3s; - animation-direction: reverse; -} -.pre-loader .loader-item:nth-child(7) { - animation-delay: -1.05s; - animation-direction: alternate; -} -.pre-loader .loader-item:nth-child(8) { - animation-delay: 0.8s; - animation-direction: reverse; -} -.pre-loader .loader-item:nth-child(9) { - animation-delay: -0.9s; - animation-direction: alternate; -} -.pre-loader .loader-item:nth-child(10) { - animation-delay: 0.5s; - animation-direction: reverse; -} -.pre-loader .loader-item:nth-child(11) { - animation-delay: -2.75s; - animation-direction: alternate; -} -.pre-loader .loader-item:nth-child(12) { - animation-delay: 2.4s; - animation-direction: reverse; -} -.pre-loader .loader-item:nth-child(13) { - animation-delay: -0.65s; - animation-direction: alternate; -} -.pre-loader .loader-item:nth-child(14) { - animation-delay: 0.7s; - animation-direction: reverse; -} -.pre-loader .loader-item:nth-child(15) { - animation-delay: -3s; - animation-direction: alternate; -} -.pre-loader .loader-item:nth-child(16) { - animation-delay: 2.4s; - animation-direction: reverse; +.pre-loader .loader-item { + width: 10px; + height: 10px; + background: #000; } .pre-loader .pre-loader-center { align-items: center; @@ -84,11 +21,76 @@ display: flex; flex-wrap: wrap; } -.pre-loader .loader-item { - width: 10px; - height: 10px; - background: #000; - animation: flickering 0.4s steps(2, jump-none) infinite alternate; +.loader-item:nth-child(0) { + animation-delay: 0ms; + animation-direction: reverse; +} +.loader-item:first-child { + animation-delay: -0.2s; + animation-direction: alternate; +} +.loader-item:nth-child(2) { + animation-delay: 0.4s; + animation-direction: reverse; +} +.loader-item:nth-child(3) { + animation-delay: -0.15s; + animation-direction: alternate; +} +.loader-item:nth-child(4) { + animation-delay: 0.6s; + animation-direction: reverse; +} +.loader-item:nth-child(5) { + animation-delay: -1s; + animation-direction: alternate; +} +.loader-item:nth-child(6) { + animation-delay: 0.3s; + animation-direction: reverse; +} +.loader-item:nth-child(7) { + animation-delay: -0.35s; + animation-direction: alternate; +} +.loader-item:nth-child(8) { + animation-delay: 2s; + animation-direction: reverse; +} +.loader-item:nth-child(9) { + animation-delay: -0.45s; + animation-direction: alternate; +} +.loader-item:nth-child(10) { + animation-delay: 2s; + animation-direction: reverse; +} +.loader-item:nth-child(11) { + animation-delay: -0.55s; + animation-direction: alternate; +} +.loader-item:nth-child(12) { + animation-delay: 1.2s; + animation-direction: reverse; +} +.loader-item:nth-child(13) { + animation-delay: -2.6s; + animation-direction: alternate; +} +.loader-item:nth-child(14) { + animation-delay: 2.8s; + animation-direction: reverse; +} +.loader-item:nth-child(15) { + animation-delay: -3s; + animation-direction: alternate; +} +.loader-item:nth-child(16) { + animation-delay: 1.6s; + animation-direction: reverse; +} +.loader-item { + animation: flickering 0.4s linear infinite alternate; } @keyframes flickering { 0% { diff --git a/libs/ui-toolkit/src/components/loader/loader.tsx b/libs/ui-toolkit/src/components/loader/loader.tsx index 47b8e6ede..89ada6310 100644 --- a/libs/ui-toolkit/src/components/loader/loader.tsx +++ b/libs/ui-toolkit/src/components/loader/loader.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import { useEffect, useMemo, useState } from 'react'; +import { useMemo } from 'react'; const pseudoRandom = (seed: number) => { let value = seed; @@ -12,26 +12,9 @@ const pseudoRandom = (seed: number) => { export interface LoaderProps { size?: 'small' | 'large'; forceTheme?: 'dark' | 'light'; - preloader?: boolean; } -export const Loader = ({ - size = 'large', - forceTheme, - preloader, -}: LoaderProps) => { - const [, forceRender] = useState(false); - - useEffect(() => { - const interval = preloader - ? undefined - : setInterval(() => { - forceRender((x) => !x); - }, 100); - - return () => clearInterval(interval); - }, [preloader]); - +export const Loader = ({ size = 'large', forceTheme }: LoaderProps) => { const itemClasses = classNames('loader-item', { 'dark:bg-white bg-black': !forceTheme, 'bg-white': forceTheme === 'dark', From a02100b079e59ffa2abd48b4234325824c1c6ffb Mon Sep 17 00:00:00 2001 From: Maciek Date: Mon, 27 Feb 2023 16:51:50 +0100 Subject: [PATCH 3/4] chore(ui-toolkit): revert: loader no rerender version only --- apps/static/src/assets/preloader.css | 108 ------------- .../components/preloader/preloader.tsx | 2 +- apps/trading/pages/gen-styles.scss | 33 ++-- apps/trading/public/preloader.css | 146 +++++++++--------- .../src/components/loader/loader.tsx | 21 ++- 5 files changed, 108 insertions(+), 202 deletions(-) delete mode 100644 apps/static/src/assets/preloader.css diff --git a/apps/static/src/assets/preloader.css b/apps/static/src/assets/preloader.css deleted file mode 100644 index 9ea72991c..000000000 --- a/apps/static/src/assets/preloader.css +++ /dev/null @@ -1,108 +0,0 @@ -.pre-loader { - display: flex; - width: 100%; - min-height: 100vh; - justify-content: center; - align-items: center; -} -.pre-loader .loader-item { - width: 10px; - height: 10px; - background: #000; -} -.pre-loader .pre-loader-center { - align-items: center; - display: flex; - flex-direction: column; -} -.pre-loader .pre-loader-wrapper { - width: 50px; - height: 50px; - display: flex; - flex-wrap: wrap; -} -.loader-item:nth-child(0) { - animation-delay: 0ms; - animation-direction: reverse; -} -.loader-item:first-child { - animation-delay: -0.2s; - animation-direction: alternate; -} -.loader-item:nth-child(2) { - animation-delay: 0.4s; - animation-direction: reverse; -} -.loader-item:nth-child(3) { - animation-delay: -0.15s; - animation-direction: alternate; -} -.loader-item:nth-child(4) { - animation-delay: 0.6s; - animation-direction: reverse; -} -.loader-item:nth-child(5) { - animation-delay: -1s; - animation-direction: alternate; -} -.loader-item:nth-child(6) { - animation-delay: 0.3s; - animation-direction: reverse; -} -.loader-item:nth-child(7) { - animation-delay: -0.35s; - animation-direction: alternate; -} -.loader-item:nth-child(8) { - animation-delay: 2s; - animation-direction: reverse; -} -.loader-item:nth-child(9) { - animation-delay: -0.45s; - animation-direction: alternate; -} -.loader-item:nth-child(10) { - animation-delay: 2s; - animation-direction: reverse; -} -.loader-item:nth-child(11) { - animation-delay: -0.55s; - animation-direction: alternate; -} -.loader-item:nth-child(12) { - animation-delay: 1.2s; - animation-direction: reverse; -} -.loader-item:nth-child(13) { - animation-delay: -2.6s; - animation-direction: alternate; -} -.loader-item:nth-child(14) { - animation-delay: 2.8s; - animation-direction: reverse; -} -.loader-item:nth-child(15) { - animation-delay: -3s; - animation-direction: alternate; -} -.loader-item:nth-child(16) { - animation-delay: 1.6s; - animation-direction: reverse; -} -.loader-item { - animation: flickering 0.4s linear infinite alternate; -} -@keyframes flickering { - 0% { - opacity: 1; - } - 25% { - opacity: 1; - } - 26% { - opacity: 0; - } - to { - opacity: 0; - } -} diff --git a/apps/trading/components/preloader/preloader.tsx b/apps/trading/components/preloader/preloader.tsx index a973d590b..7ae503363 100644 --- a/apps/trading/components/preloader/preloader.tsx +++ b/apps/trading/components/preloader/preloader.tsx @@ -13,7 +13,7 @@ export const Preloader = () => { `}
- +
); diff --git a/apps/trading/pages/gen-styles.scss b/apps/trading/pages/gen-styles.scss index c25e95f6a..6737f9167 100644 --- a/apps/trading/pages/gen-styles.scss +++ b/apps/trading/pages/gen-styles.scss @@ -4,10 +4,17 @@ min-height: 100vh; justify-content: center; align-items: center; - .loader-item { - width: 10px; - height: 10px; - background: black; + + @for $i from 0 through 16 { + .loader-item:nth-child(#{$i}) { + @if $i % 2 == 0 { + animation-delay: #{$i * 50 * random(5)}ms; + animation-direction: reverse; + } @else { + animation-delay: #{$i * -50 * random(5)}ms; + animation-direction: alternate; + } + } } .pre-loader-center { align-items: center; @@ -20,21 +27,13 @@ display: flex; flex-wrap: wrap; } -} -@for $i from 0 through 16 { - .loader-item:nth-child(#{$i}) { - @if $i % 2 == 0 { - animation-delay: #{$i * 50 * random(5)}ms; - animation-direction: reverse; - } @else { - animation-delay: #{$i * -50 * random(5)}ms; - animation-direction: alternate; - } + .loader-item { + width: 10px; + height: 10px; + background: black; + animation: flickering 0.4s steps(2, jump-none) alternate infinite; } } -.loader-item { - animation: flickering 0.4s linear alternate infinite; -} @keyframes flickering { 0% { opacity: 1; diff --git a/apps/trading/public/preloader.css b/apps/trading/public/preloader.css index 9ea72991c..33afae4ea 100644 --- a/apps/trading/public/preloader.css +++ b/apps/trading/public/preloader.css @@ -5,10 +5,73 @@ justify-content: center; align-items: center; } -.pre-loader .loader-item { - width: 10px; - height: 10px; - background: #000; +.pre-loader .loader-item:nth-child(0) { + animation-delay: 0ms; + animation-direction: reverse; +} +.pre-loader .loader-item:first-child { + animation-delay: -0.2s; + animation-direction: alternate; +} +.pre-loader .loader-item:nth-child(2) { + animation-delay: 0.1s; + animation-direction: reverse; +} +.pre-loader .loader-item:nth-child(3) { + animation-delay: -0.15s; + animation-direction: alternate; +} +.pre-loader .loader-item:nth-child(4) { + animation-delay: 1s; + animation-direction: reverse; +} +.pre-loader .loader-item:nth-child(5) { + animation-delay: -0.25s; + animation-direction: alternate; +} +.pre-loader .loader-item:nth-child(6) { + animation-delay: 0.3s; + animation-direction: reverse; +} +.pre-loader .loader-item:nth-child(7) { + animation-delay: -1.05s; + animation-direction: alternate; +} +.pre-loader .loader-item:nth-child(8) { + animation-delay: 0.8s; + animation-direction: reverse; +} +.pre-loader .loader-item:nth-child(9) { + animation-delay: -0.9s; + animation-direction: alternate; +} +.pre-loader .loader-item:nth-child(10) { + animation-delay: 0.5s; + animation-direction: reverse; +} +.pre-loader .loader-item:nth-child(11) { + animation-delay: -2.75s; + animation-direction: alternate; +} +.pre-loader .loader-item:nth-child(12) { + animation-delay: 2.4s; + animation-direction: reverse; +} +.pre-loader .loader-item:nth-child(13) { + animation-delay: -0.65s; + animation-direction: alternate; +} +.pre-loader .loader-item:nth-child(14) { + animation-delay: 0.7s; + animation-direction: reverse; +} +.pre-loader .loader-item:nth-child(15) { + animation-delay: -3s; + animation-direction: alternate; +} +.pre-loader .loader-item:nth-child(16) { + animation-delay: 2.4s; + animation-direction: reverse; } .pre-loader .pre-loader-center { align-items: center; @@ -21,76 +84,11 @@ display: flex; flex-wrap: wrap; } -.loader-item:nth-child(0) { - animation-delay: 0ms; - animation-direction: reverse; -} -.loader-item:first-child { - animation-delay: -0.2s; - animation-direction: alternate; -} -.loader-item:nth-child(2) { - animation-delay: 0.4s; - animation-direction: reverse; -} -.loader-item:nth-child(3) { - animation-delay: -0.15s; - animation-direction: alternate; -} -.loader-item:nth-child(4) { - animation-delay: 0.6s; - animation-direction: reverse; -} -.loader-item:nth-child(5) { - animation-delay: -1s; - animation-direction: alternate; -} -.loader-item:nth-child(6) { - animation-delay: 0.3s; - animation-direction: reverse; -} -.loader-item:nth-child(7) { - animation-delay: -0.35s; - animation-direction: alternate; -} -.loader-item:nth-child(8) { - animation-delay: 2s; - animation-direction: reverse; -} -.loader-item:nth-child(9) { - animation-delay: -0.45s; - animation-direction: alternate; -} -.loader-item:nth-child(10) { - animation-delay: 2s; - animation-direction: reverse; -} -.loader-item:nth-child(11) { - animation-delay: -0.55s; - animation-direction: alternate; -} -.loader-item:nth-child(12) { - animation-delay: 1.2s; - animation-direction: reverse; -} -.loader-item:nth-child(13) { - animation-delay: -2.6s; - animation-direction: alternate; -} -.loader-item:nth-child(14) { - animation-delay: 2.8s; - animation-direction: reverse; -} -.loader-item:nth-child(15) { - animation-delay: -3s; - animation-direction: alternate; -} -.loader-item:nth-child(16) { - animation-delay: 1.6s; - animation-direction: reverse; -} -.loader-item { - animation: flickering 0.4s linear infinite alternate; +.pre-loader .loader-item { + width: 10px; + height: 10px; + background: #000; + animation: flickering 0.4s steps(2, jump-none) infinite alternate; } @keyframes flickering { 0% { diff --git a/libs/ui-toolkit/src/components/loader/loader.tsx b/libs/ui-toolkit/src/components/loader/loader.tsx index 89ada6310..47b8e6ede 100644 --- a/libs/ui-toolkit/src/components/loader/loader.tsx +++ b/libs/ui-toolkit/src/components/loader/loader.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import { useMemo } from 'react'; +import { useEffect, useMemo, useState } from 'react'; const pseudoRandom = (seed: number) => { let value = seed; @@ -12,9 +12,26 @@ const pseudoRandom = (seed: number) => { export interface LoaderProps { size?: 'small' | 'large'; forceTheme?: 'dark' | 'light'; + preloader?: boolean; } -export const Loader = ({ size = 'large', forceTheme }: LoaderProps) => { +export const Loader = ({ + size = 'large', + forceTheme, + preloader, +}: LoaderProps) => { + const [, forceRender] = useState(false); + + useEffect(() => { + const interval = preloader + ? undefined + : setInterval(() => { + forceRender((x) => !x); + }, 100); + + return () => clearInterval(interval); + }, [preloader]); + const itemClasses = classNames('loader-item', { 'dark:bg-white bg-black': !forceTheme, 'bg-white': forceTheme === 'dark', From 4eb6e09bd49f8d78b9c628c9855cd8ef2eb88020 Mon Sep 17 00:00:00 2001 From: "m.ray" <16125548+MadalinaRaicu@users.noreply.github.com> Date: Mon, 27 Feb 2023 13:04:13 -0500 Subject: [PATCH 4/4] fix(trading): condense deal ticket & market info price range snags (#3012) --- .../app/components/markets/market-details.tsx | 5 +- libs/assets/src/lib/asset-details-dialog.tsx | 2 +- .../deal-ticket/deal-ticket-button.tsx | 2 +- .../deal-ticket/deal-ticket-fee-details.tsx | 2 +- .../deal-ticket/deal-ticket-limit-amount.tsx | 2 +- .../deal-ticket/deal-ticket-market-amount.tsx | 4 +- .../components/deal-ticket/deal-ticket.tsx | 12 +- .../components/market-info/info-market.tsx | 110 ++++++++++-------- .../src/lib/format/number.spec.tsx | 18 +++ .../src/components/form-group/form-group.tsx | 2 +- .../key-value-table/key-value-table.tsx | 6 +- 11 files changed, 96 insertions(+), 69 deletions(-) diff --git a/apps/explorer/src/app/components/markets/market-details.tsx b/apps/explorer/src/app/components/markets/market-details.tsx index 405f354a9..2b642a6d3 100644 --- a/apps/explorer/src/app/components/markets/market-details.tsx +++ b/apps/explorer/src/app/components/markets/market-details.tsx @@ -184,9 +184,8 @@ export const MarketDetails = ({ content: ( <>

- {`For liquidity orders count towards a commitment they have to be - within either the liquidity or price monitoring bounds (whichever is - tighter).`} + {`For liquidity orders to count towards a commitment, they must be + within the liquidity monitoring bounds.`}

{`The liquidity price range is a ${liquidityPriceRange} difference from the mid diff --git a/libs/assets/src/lib/asset-details-dialog.tsx b/libs/assets/src/lib/asset-details-dialog.tsx index 4c581df8f..a45789b3a 100644 --- a/libs/assets/src/lib/asset-details-dialog.tsx +++ b/libs/assets/src/lib/asset-details-dialog.tsx @@ -98,7 +98,7 @@ export const AssetDetailsDialog = ({ }} > {content} -

+

{t( 'There is 1 unit of the settlement asset (%s) to every 1 quote unit.', [assetSymbol] diff --git a/libs/deal-ticket/src/components/deal-ticket/deal-ticket-button.tsx b/libs/deal-ticket/src/components/deal-ticket/deal-ticket-button.tsx index 5960612bd..1eae3d5a6 100644 --- a/libs/deal-ticket/src/components/deal-ticket/deal-ticket-button.tsx +++ b/libs/deal-ticket/src/components/deal-ticket/deal-ticket-button.tsx @@ -12,7 +12,7 @@ export const DealTicketButton = ({ disabled, variant }: Props) => { const { pubKey, isReadOnly } = useVegaWallet(); const isDisabled = !pubKey || isReadOnly || disabled; return ( -

+