Skip to content

Commit

Permalink
Merge pull request #838 from Tencent/feat/icon/update
Browse files Browse the repository at this point in the history
feat(Icon): update icon-font
  • Loading branch information
LeeJim authored Sep 5, 2022
2 parents 78bd600 + 922d01b commit 52bce66
Show file tree
Hide file tree
Showing 9 changed files with 369 additions and 164 deletions.
2 changes: 1 addition & 1 deletion script/update-icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require('path');
const fs = require('fs');

const iconFile = path.join(__dirname, '..', 'src/icon/icon.less');
const dataFile = path.join(__dirname, '..', 'example/pages/icon/data.js');
const dataFile = path.join(__dirname, '..', 'src/icon/_example/data.js');
fs.readFile(iconFile, 'utf8', (err, data) => {
if (err) {
console.error(err);
Expand Down
150 changes: 150 additions & 0 deletions src/icon/__test__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1220,6 +1220,21 @@ exports[`Icon Icon base demo works fine 1`] = `
file-excel
</wx-view>
</wx-view>
<wx-view
class="demo__card"
>
<t-icon
data-name="file-icon"
name="file-icon"
size="48rpx"
bind:click="onIconTap"
/>
<wx-view
class="demo__card-name"
>
file-icon
</wx-view>
</wx-view>
<wx-view
class="demo__card"
>
Expand Down Expand Up @@ -1730,6 +1745,21 @@ exports[`Icon Icon base demo works fine 1`] = `
hourglass
</wx-view>
</wx-view>
<wx-view
class="demo__card"
>
<t-icon
data-name="image-error"
name="image-error"
size="48rpx"
bind:click="onIconTap"
/>
<wx-view
class="demo__card-name"
>
image-error
</wx-view>
</wx-view>
<wx-view
class="demo__card"
>
Expand Down Expand Up @@ -2090,6 +2120,51 @@ exports[`Icon Icon base demo works fine 1`] = `
logo-ie
</wx-view>
</wx-view>
<wx-view
class="demo__card"
>
<t-icon
data-name="logo-qq"
name="logo-qq"
size="48rpx"
bind:click="onIconTap"
/>
<wx-view
class="demo__card-name"
>
logo-qq
</wx-view>
</wx-view>
<wx-view
class="demo__card"
>
<t-icon
data-name="logo-wechat"
name="logo-wechat"
size="48rpx"
bind:click="onIconTap"
/>
<wx-view
class="demo__card-name"
>
logo-wechat
</wx-view>
</wx-view>
<wx-view
class="demo__card"
>
<t-icon
data-name="logo-wecom"
name="logo-wecom"
size="48rpx"
bind:click="onIconTap"
/>
<wx-view
class="demo__card-name"
>
logo-wecom
</wx-view>
</wx-view>
<wx-view
class="demo__card"
>
Expand Down Expand Up @@ -2225,6 +2300,21 @@ exports[`Icon Icon base demo works fine 1`] = `
minus-rectangle
</wx-view>
</wx-view>
<wx-view
class="demo__card"
>
<t-icon
data-name="mirror"
name="mirror"
size="48rpx"
bind:click="onIconTap"
/>
<wx-view
class="demo__card-name"
>
mirror
</wx-view>
</wx-view>
<wx-view
class="demo__card"
>
Expand Down Expand Up @@ -2450,6 +2540,21 @@ exports[`Icon Icon base demo works fine 1`] = `
photo
</wx-view>
</wx-view>
<wx-view
class="demo__card"
>
<t-icon
data-name="pin-filled"
name="pin-filled"
size="48rpx"
bind:click="onIconTap"
/>
<wx-view
class="demo__card-name"
>
pin-filled
</wx-view>
</wx-view>
<wx-view
class="demo__card"
>
Expand Down Expand Up @@ -2645,6 +2750,21 @@ exports[`Icon Icon base demo works fine 1`] = `
refresh
</wx-view>
</wx-view>
<wx-view
class="demo__card"
>
<t-icon
data-name="relativity"
name="relativity"
size="48rpx"
bind:click="onIconTap"
/>
<wx-view
class="demo__card-name"
>
relativity
</wx-view>
</wx-view>
<wx-view
class="demo__card"
>
Expand Down Expand Up @@ -2675,6 +2795,21 @@ exports[`Icon Icon base demo works fine 1`] = `
rollback
</wx-view>
</wx-view>
<wx-view
class="demo__card"
>
<t-icon
data-name="rollfront"
name="rollfront"
size="48rpx"
bind:click="onIconTap"
/>
<wx-view
class="demo__card-name"
>
rollfront
</wx-view>
</wx-view>
<wx-view
class="demo__card"
>
Expand All @@ -2690,6 +2825,21 @@ exports[`Icon Icon base demo works fine 1`] = `
root-list
</wx-view>
</wx-view>
<wx-view
class="demo__card"
>
<t-icon
data-name="rotation"
name="rotation"
size="48rpx"
bind:click="onIconTap"
/>
<wx-view
class="demo__card-name"
>
rotation
</wx-view>
</wx-view>
<wx-view
class="demo__card"
>
Expand Down
19 changes: 10 additions & 9 deletions src/icon/_example/base/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import icons from '../data.js';

Component({
data: {
icons: [
Expand Down Expand Up @@ -84,6 +82,7 @@ Component({
'file-add',
'file-copy',
'file-excel',
'file-icon',
'file-image',
'file-paste',
'file-pdf',
Expand Down Expand Up @@ -118,6 +117,7 @@ Component({
'history',
'home',
'hourglass',
'image-error',
'image',
'info-circle-filled',
'info-circle',
Expand All @@ -142,6 +142,9 @@ Component({
'logo-github',
'logo-ie-filled',
'logo-ie',
'logo-qq',
'logo-wechat',
'logo-wecom',
'logo-windows-filled',
'logo-windows',
'logout',
Expand All @@ -151,6 +154,7 @@ Component({
'minus-circle-filled',
'minus-circle',
'minus-rectangle',
'mirror',
'mobile-vibrate',
'mobile',
'money-circle',
Expand All @@ -166,6 +170,7 @@ Component({
'page-last',
'pause-circle-filled',
'photo',
'pin-filled',
'pin',
'play-circle-filled',
'play-circle-stroke',
Expand All @@ -179,9 +184,12 @@ Component({
'queue',
'rectangle',
'refresh',
'relativity',
'remove',
'rollback',
'rollfront',
'root-list',
'rotation',
'round',
'save',
'scan',
Expand Down Expand Up @@ -233,13 +241,6 @@ Component({
],
},

lifetimes: {
attached() {
this.setData({
icons,
});
},
},
methods: {
onIconTap(event) {
console.log();
Expand Down
10 changes: 10 additions & 0 deletions src/icon/_example/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const icons = [
'file-add',
'file-copy',
'file-excel',
'file-icon',
'file-image',
'file-paste',
'file-pdf',
Expand Down Expand Up @@ -114,6 +115,7 @@ const icons = [
'history',
'home',
'hourglass',
'image-error',
'image',
'info-circle-filled',
'info-circle',
Expand All @@ -138,6 +140,9 @@ const icons = [
'logo-github',
'logo-ie-filled',
'logo-ie',
'logo-qq',
'logo-wechat',
'logo-wecom',
'logo-windows-filled',
'logo-windows',
'logout',
Expand All @@ -147,6 +152,7 @@ const icons = [
'minus-circle-filled',
'minus-circle',
'minus-rectangle',
'mirror',
'mobile-vibrate',
'mobile',
'money-circle',
Expand All @@ -162,6 +168,7 @@ const icons = [
'page-last',
'pause-circle-filled',
'photo',
'pin-filled',
'pin',
'play-circle-filled',
'play-circle-stroke',
Expand All @@ -175,9 +182,12 @@ const icons = [
'queue',
'rectangle',
'refresh',
'relativity',
'remove',
'rollback',
'rollfront',
'root-list',
'rotation',
'round',
'save',
'scan',
Expand Down
Loading

0 comments on commit 52bce66

Please sign in to comment.