Skip to content

Commit 7d43a26

Browse files
committed
[optimize] several UI details
[optimize] upgrade Upstream packages
1 parent 415affa commit 7d43a26

File tree

8 files changed

+59
-50
lines changed

8 files changed

+59
-50
lines changed

.husky/pre-commit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
. "$(dirname "$0")/_/husky.sh"
4+
5+
npm test

.husky/pre-push

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
. "$(dirname "$0")/_/husky.sh"
4+
5+
npm run build

ReadMe.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ https://web-cell.dev/mobile/
99
[![NPM Dependency](https://david-dm.org/EasyWebApp/mobile.svg)][1]
1010
[![CI & CD](https://github.com/EasyWebApp/mobile/workflows/CI%20&%20CD/badge.svg)][2]
1111

12+
[![Open in Visual Studio Code](https://open.vscode.dev/badges/open-in-vscode.svg)][3]
13+
1214
## Technology stack
1315

14-
- Language: [TypeScript v4][3]
15-
- Component engine: [WebCell v2][4]
16-
- Component suite: [Material Cell v2][5]
17-
- PWA framework: [Workbox v6][6]
18-
- Package bundler: [Parcel v1][7]
19-
- CI / CD: GitHub [Actions][8] + [Pages][9]
16+
- Language: [TypeScript v4][4]
17+
- Component engine: [WebCell v2][5]
18+
- Component suite: [Material Cell v2][6]
19+
- PWA framework: [Workbox v6][7]
20+
- Package bundler: [Parcel v1][8]
21+
- CI / CD: GitHub [Actions][9] + [Pages][10]
2022

2123
## Development
2224

@@ -34,10 +36,11 @@ npm run build
3436

3537
[1]: https://david-dm.org/EasyWebApp/mobile
3638
[2]: https://github.com/EasyWebApp/mobile/actions
37-
[3]: https://typescriptlang.org
38-
[4]: https://web-cell.dev/
39-
[5]: https://material.web-cell.dev/
40-
[6]: https://developers.google.com/web/tools/workbox
41-
[7]: https://parceljs.org
42-
[8]: https://github.com/features/actions
43-
[9]: https://pages.github.com/
39+
[3]: https://open.vscode.dev/EasyWebApp/mobile
40+
[4]: https://typescriptlang.org
41+
[5]: https://web-cell.dev/
42+
[6]: https://material.web-cell.dev/
43+
[7]: https://developers.google.com/web/tools/workbox
44+
[8]: https://parceljs.org
45+
[9]: https://github.com/features/actions
46+
[10]: https://pages.github.com/

package.json

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,27 @@
1212
"url": "https://github.com/EasyWebApp/mobile/issues"
1313
},
1414
"dependencies": {
15-
"@material/mwc-button": "^0.20.0",
16-
"@material/mwc-drawer": "^0.20.0",
17-
"@material/mwc-icon-button": "^0.20.0",
18-
"@material/mwc-list": "^0.20.0",
19-
"@material/mwc-top-app-bar": "^0.20.0",
15+
"@material/mwc-button": "^0.22.1",
16+
"@material/mwc-drawer": "^0.22.1",
17+
"@material/mwc-icon-button": "^0.22.1",
18+
"@material/mwc-list": "^0.22.1",
19+
"@material/mwc-top-app-bar-fixed": "^0.22.1",
2020
"browser-unhandled-rejection": "^1.0.2",
2121
"cell-router": "^2.0.4",
22-
"koajax": "^0.6.4",
23-
"material-cell": "^2.0.0-rc.2",
22+
"koajax": "^0.7.0",
23+
"material-cell": "^2.0.0-rc.3",
2424
"mobx": "5.15.7",
25-
"mobx-web-cell": "^0.3.4",
26-
"web-cell": "^2.3.0-rc.2",
27-
"web-utility": "^2.4.4"
25+
"mobx-web-cell": "^0.3.5",
26+
"web-cell": "^2.3.0",
27+
"web-utility": "^2.6.0"
2828
},
2929
"devDependencies": {
30-
"husky": "^4.3.7",
31-
"lint-staged": "^10.5.3",
32-
"parcel-bundler": "^1.12.4",
33-
"prettier": "^2.2.1",
34-
"typescript": "^4.1.3",
35-
"workbox-cli": "^6.0.2"
30+
"husky": "^7.0.1",
31+
"lint-staged": "^11.0.1",
32+
"parcel-bundler": "^1.12.5",
33+
"prettier": "^2.3.2",
34+
"typescript": "^4.3.5",
35+
"workbox-cli": "^6.1.5"
3636
},
3737
"prettier": {
3838
"singleQuote": true,
@@ -44,15 +44,10 @@
4444
"*.{html,md,css,less,json,yml,js,ts,tsx}": "prettier --write"
4545
},
4646
"scripts": {
47+
"prepare": "husky install",
4748
"test": "lint-staged",
4849
"start": "parcel src/index.html --open",
4950
"pack": "parcel build src/index.html --public-url .",
5051
"build": "rm -rf dist/ && npm run pack && workbox generateSW"
51-
},
52-
"husky": {
53-
"hooks": {
54-
"pre-commit": "npm test",
55-
"pre-push": "npm run build"
56-
}
5752
}
5853
}

src/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@
1919
></script>
2020
<script src="https://cdn.jsdelivr.net/npm/@webcomponents/[email protected]/webcomponents-bundle.min.js"></script>
2121
<script src="https://cdn.jsdelivr.net/npm/@webcomponents/[email protected]/custom-elements-es5-adapter.js"></script>
22-
<script src="https://cdn.jsdelivr.net/npm/[email protected].1/dist/index.min.js"></script>
22+
<script src="https://cdn.jsdelivr.net/npm/[email protected].40/dist/index.min.js"></script>
2323
<link
2424
rel="stylesheet"
25-
href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css"
25+
href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css"
2626
/>
2727
<link
2828
rel="stylesheet"
2929
href="https://fonts.loli.net/css?family=Material+Icons&display=block"
3030
/>
3131
<link
3232
rel="stylesheet"
33-
href="https://cdn.jsdelivr.net/npm/@material/card@9.0.0/dist/mdc.card.min.css"
33+
href="https://cdn.jsdelivr.net/npm/@material/card@11.0.0/dist/mdc.card.min.css"
3434
/>
3535
<script src="index.tsx" async></script>
3636
</head>

src/page/CompanyList.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class CompanyList extends mixin<CompanyListProps>() {
2626
type: WorkType = '996';
2727

2828
connectedCallback() {
29-
this.classList.add('row');
29+
this.classList.add('row', 'm-0', 'py-2');
3030

3131
company.getList(this.type);
3232

@@ -38,8 +38,11 @@ export class CompanyList extends mixin<CompanyListProps>() {
3838

3939
return list.map(
4040
({ name, url, city, rule, evidences, date, comment_url }) => (
41-
<div className="col-12 col-sm-6 col-md-4 col-lg-3" key={name}>
42-
<div className="mdc-card mx-3 my-2">
41+
<div
42+
className="col-12 col-sm-6 col-md-4 col-lg-3 my-2"
43+
key={name}
44+
>
45+
<div className="mdc-card h-100">
4346
<h3 className="h5 text-truncate pt-3 px-3">
4447
{url ? (
4548
<a target="_blank" href={url}>
@@ -61,7 +64,7 @@ export class CompanyList extends mixin<CompanyListProps>() {
6164
</li>
6265
))}
6366
</ol>
64-
<div className="mdc-card__actions justify-content-between px-3">
67+
<div className="mdc-card__actions flex-fill align-items-end justify-content-between px-3">
6568
<time>{date}</time>
6669
<a
6770
className="text-decoration-none"

src/page/index.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { CellRouter } from 'cell-router/source';
44
import type {} from 'material-cell';
55
import '@material/mwc-drawer';
66
import '@material/mwc-list';
7-
import '@material/mwc-top-app-bar';
7+
import '@material/mwc-top-app-bar-fixed';
88
import '@material/mwc-icon-button';
99

1010
import { history } from '../model';
@@ -40,19 +40,17 @@ export function PageBox() {
4040
</mwc-list-item>
4141
</mwc-list>
4242

43-
<div slot="appContent">
44-
<mwc-top-app-bar>
45-
<mwc-icon-button slot="navigationIcon" icon="menu" />
46-
<div slot="title">Anti 996</div>
47-
</mwc-top-app-bar>
43+
<mwc-top-app-bar-fixed slot="appContent">
44+
<mwc-icon-button slot="navigationIcon" icon="menu" />
45+
<div slot="title">Anti 996</div>
4846

4947
<CellRouter
5048
history={history}
5149
routes={[
5250
{ paths: ['', 'companies'], component: CompanyList }
5351
]}
5452
/>
55-
</div>
53+
</mwc-top-app-bar-fixed>
5654
</mwc-drawer>
5755
);
5856
}

workbox-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module.exports = {
33
globPatterns: ['**/*.{html,css,js,json,ico,gif,jpg,jpeg,png,webp}'],
44
swDest: 'dist/sw.js',
55
importScripts: [
6-
'https://cdn.jsdelivr.net/npm/workbox-sw@6.0.2/build/workbox-sw.min.js'
6+
'https://cdn.jsdelivr.net/npm/workbox-sw@6.1.5/build/workbox-sw.min.js'
77
],
88
clientsClaim: true,
99
cleanupOutdatedCaches: true

0 commit comments

Comments
 (0)