Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into issue-#1448
Browse files Browse the repository at this point in the history
  • Loading branch information
GrandSchtroumpf committed Sep 11, 2024
2 parents f8ff4b3 + 40f56e7 commit 01e108b
Show file tree
Hide file tree
Showing 13 changed files with 220 additions and 265 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
name: 'Commit Screenshots'
needs: e2e
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false && github.base_ref == 'main'
if: github.event.pull_request.draft == false && github.base_ref == 'main' && !startsWith(github.event.head_commit.message, '[CI]')
permissions:
contents: write
steps:
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/screenshots/strategy/overlapping/Overlapping/create/form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"vite-plugin-svgr": "^2.4.0",
"vite-tsconfig-paths": "^4.2.1",
"vitest": "^1.6.0",
"wagmi": "2.10.9",
"wagmi": "2.12.8",
"web-vitals": "^2.1.0"
},
"scripts": {
Expand Down Expand Up @@ -131,4 +131,4 @@
"devDependencies": {
"@types/d3": "^7.4.3"
}
}
}
2 changes: 1 addition & 1 deletion src/components/strategies/common/InputLimit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const InputLimit: FC<InputLimitProps> = (props) => {

const setMarket = (e: MouseEvent<HTMLElement>) => {
e.stopPropagation();
onChange(marketPrice?.toString() ?? '');
onChange(formatNumber(marketPrice?.toString() ?? ''));
};

return (
Expand Down
4 changes: 2 additions & 2 deletions src/components/strategies/common/InputRange.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const InputRange: FC<InputRangeProps> = ({

const setMinMarket = (e: MouseEvent<HTMLElement>) => {
e.stopPropagation();
onMinChange(marketPrice?.toString() ?? '');
onMinChange(formatNumber(marketPrice?.toString() ?? ''));
};

const onMaxFocus = (e: FocusEvent<HTMLInputElement>) => {
Expand All @@ -134,7 +134,7 @@ export const InputRange: FC<InputRangeProps> = ({

const setMaxMarket = (e: MouseEvent<HTMLElement>) => {
e.stopPropagation();
onMaxChange(marketPrice?.toString() ?? '');
onMaxChange(formatNumber(marketPrice?.toString() ?? ''));
};

return (
Expand Down
3 changes: 3 additions & 0 deletions src/utils/helpers/number.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,5 +417,8 @@ describe('Test helpers', () => {
expect(roundSearchParam('0.000000012345600001')).toBe('0.0000000123456');
expect(roundSearchParam('0.100000012345678901234567890')).toBe('0.1');
});
test('Should remove scientific number price', () => {
expect(roundSearchParam('1.1e-6')).toBe('0.0000011');
});
});
});
7 changes: 4 additions & 3 deletions src/utils/helpers/number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,12 @@ const lastZero = new RegExp(/0+$/);

/** Round to 6 decimals after leading zeros */
export const roundSearchParam = (param?: string | number) => {
if (!param || Number(param) === 0 || isNaN(Number(param))) return '';
const [radix, decimals] = param.toString().split('.');
const value = Number(param);
if (!param || value === 0 || isNaN(value)) return '';
const [radix, decimals] = value.toFixed(100).split('.');
if (!decimals) return param.toString();
let maxDecimals = 6;
if (Number(param) < 1) {
if (value < 1) {
maxDecimals += decimals.match(firstZero)?.[0].length ?? 0;
}
const roundedDecimals = decimals.slice(0, maxDecimals).replace(lastZero, '');
Expand Down
463 changes: 207 additions & 256 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 01e108b

Please sign in to comment.