From d2d16042763e66b96a004190d942e2da91dcd931 Mon Sep 17 00:00:00 2001 From: neverland Date: Mon, 15 Nov 2021 19:32:29 +0800 Subject: [PATCH] perf: minify svg icons (#9869) --- packages/vant/src/empty/Network.tsx | 51 +++++------------ .../test/__snapshots__/index.spec.ts.snap | 55 ++++++------------- .../src/number-keyboard/NumberKeyboardKey.tsx | 4 +- .../test/__snapshots__/demo.spec.ts.snap | 16 +++--- .../test/__snapshots__/demo.spec.ts.snap | 4 +- 5 files changed, 43 insertions(+), 87 deletions(-) diff --git a/packages/vant/src/empty/Network.tsx b/packages/vant/src/empty/Network.tsx index aab8eaaea..8bb2e356e 100644 --- a/packages/vant/src/empty/Network.tsx +++ b/packages/vant/src/empty/Network.tsx @@ -6,11 +6,11 @@ const renderStop = (color: string, offset: number, opacity?: number) => ( export const Network = ( - + {renderStop('#FFF', 0, 0.5)} {renderStop('#F2F3F5', 100)} - + {renderStop('#EBEDF0', 0)} {renderStop('#DCDEE0', 100, 0)} @@ -18,18 +18,14 @@ export const Network = ( {renderStop('#EAEDF0', 0)} {renderStop('#DCDEE0', 100)} - - {renderStop('#EAEDF0', 0)} - {renderStop('#DCDEE0', 100)} - {renderStop('#EBEDF0', 0)} {renderStop('#FFF', 100, 0)} @@ -37,49 +33,30 @@ export const Network = ( - - + + - + + - - + - - + + diff --git a/packages/vant/src/empty/test/__snapshots__/index.spec.ts.snap b/packages/vant/src/empty/test/__snapshots__/index.spec.ts.snap index 10f2b9dcf..b60cf694c 100644 --- a/packages/vant/src/empty/test/__snapshots__/index.spec.ts.snap +++ b/packages/vant/src/empty/test/__snapshots__/index.spec.ts.snap @@ -36,9 +36,9 @@ exports[`should render svg when image is network 1`] = ` - - - - - - - - - - - - - - - @@ -171,7 +150,7 @@ exports[`should render svg when image is network 1`] = ` y="8" width="80" height="18" - rx="1.114" + rx="1.1" > diff --git a/packages/vant/src/number-keyboard/NumberKeyboardKey.tsx b/packages/vant/src/number-keyboard/NumberKeyboardKey.tsx index cd0036c68..88d820ac4 100644 --- a/packages/vant/src/number-keyboard/NumberKeyboardKey.tsx +++ b/packages/vant/src/number-keyboard/NumberKeyboardKey.tsx @@ -8,7 +8,7 @@ const [name, bem] = createNamespace('key'); const CollapseIcon = ( @@ -17,7 +17,7 @@ const CollapseIcon = ( const DeleteIcon = ( diff --git a/packages/vant/src/number-keyboard/test/__snapshots__/demo.spec.ts.snap b/packages/vant/src/number-keyboard/test/__snapshots__/demo.spec.ts.snap index 6c7864012..ae956ed9c 100644 --- a/packages/vant/src/number-keyboard/test/__snapshots__/demo.spec.ts.snap +++ b/packages/vant/src/number-keyboard/test/__snapshots__/demo.spec.ts.snap @@ -178,7 +178,7 @@ exports[`should render demo and match snapshot 1`] = ` - @@ -201,7 +201,7 @@ exports[`should render demo and match snapshot 1`] = ` - @@ -316,7 +316,7 @@ exports[`should render demo and match snapshot 1`] = ` - @@ -444,7 +444,7 @@ exports[`should render demo and match snapshot 1`] = ` - @@ -567,7 +567,7 @@ exports[`should render demo and match snapshot 1`] = ` - @@ -690,7 +690,7 @@ exports[`should render demo and match snapshot 1`] = ` - @@ -795,7 +795,7 @@ exports[`should render demo and match snapshot 1`] = ` - @@ -818,7 +818,7 @@ exports[`should render demo and match snapshot 1`] = ` - diff --git a/packages/vant/src/password-input/test/__snapshots__/demo.spec.ts.snap b/packages/vant/src/password-input/test/__snapshots__/demo.spec.ts.snap index 7902ebbdb..a0d1feb54 100644 --- a/packages/vant/src/password-input/test/__snapshots__/demo.spec.ts.snap +++ b/packages/vant/src/password-input/test/__snapshots__/demo.spec.ts.snap @@ -233,7 +233,7 @@ exports[`should render demo and match snapshot 1`] = ` - @@ -256,7 +256,7 @@ exports[`should render demo and match snapshot 1`] = ` -