Skip to content

Commit 5a224b5

Browse files
authored
[add] TC39 Member page & ECMA General Assembly representatives (#8)
1 parent 11aff28 commit 5a224b5

File tree

5 files changed

+83
-17
lines changed

5 files changed

+83
-17
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"mobx": "^5.15.7",
2626
"mobx-web-cell": "^0.3.5",
2727
"web-cell": "^2.3.0",
28-
"web-utility": "^2.6.0"
28+
"web-utility": "^2.6.2"
2929
},
3030
"devDependencies": {
3131
"@types/classnames": "^2.3.1",

source/data/members-china.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,37 @@
22
{
33
"name": "三六零科技集团有限公司",
44
"logo": "https://p3.ssl.qhimg.com/t011e94f0b9ed8e66b0.png",
5-
"link": "https://www.360.cn/"
5+
"link": "https://www.360.cn/",
6+
"representatives": ["李智杰", "王先坤"]
67
},
78
{
89
"name": "阿里巴巴(中国)有限公司",
910
"logo": "https://docs.alibabagroup.com/assets2/images/cn/global/logo_header.png",
10-
"link": "https://www.alibabagroup.com/"
11+
"link": "https://www.alibabagroup.com/",
12+
"representatives": ["郑叶飞"]
1113
},
1214
{
1315
"name": "腾讯",
1416
"logo": "https://www.tencent.com/img/index/tencent_logo.png",
15-
"link": "https://www.tencent.com/"
17+
"link": "https://www.tencent.com/",
18+
"representatives": ["郑苏波"]
1619
},
1720
{
1821
"name": "华为技术有限公司",
1922
"logo": "https://www-file.huawei.com/-/media/corporate/images/home/logo/huawei_logo.png",
20-
"link": "https://www.huawei.com/"
23+
"link": "https://www.huawei.com/",
24+
"representatives": ["侯凡", "王亚举"]
2125
},
2226
{
2327
"name": "Sujitech",
2428
"logo": "https://www.ecma-international.org/wp-content/uploads/Sujitech-logo.gif",
25-
"link": "https://sujitech.com/"
29+
"link": "https://sujitech.com/",
30+
"representatives": ["刘怿斯"]
2631
},
2732
{
2833
"name": "北京字节跳动网络技术有限公司",
2934
"logo": "https://www.ecma-international.org/wp-content/uploads/beijing_bytedance-logo.gif",
30-
"link": "https://www.bytedance.com/"
35+
"link": "https://www.bytedance.com/",
36+
"representatives": ["张荣剑"]
3137
}
3238
]

source/page/Main.tsx

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { SpinnerBox } from 'boot-cell/source/Prompt/Spinner';
77
import { Card, CardHeader } from 'boot-cell/source/Content/Card';
88
import { Badge } from 'boot-cell/source/Reminder/Badge';
99

10-
import companies from '../data/members-china.json';
10+
import organizations from '../data/members-china.json';
1111
import { member, proposal, Member, Proposal } from '../model';
1212

1313
const thisYear = new Date().getFullYear();
@@ -25,15 +25,15 @@ export class MainPage extends mixin() {
2525
super.connectedCallback();
2626
}
2727

28-
renderMember = ({
28+
renderMember({
2929
avatar_url,
3030
username,
3131
url,
3232
name,
3333
company,
3434
location,
3535
bio,
36-
}: Member) => {
36+
}: Member) {
3737
return (
3838
<div className="col-12 col-sm-6 col-md-3 my-3">
3939
<Card
@@ -60,7 +60,7 @@ export class MainPage extends mixin() {
6060
</Card>
6161
</div>
6262
);
63-
};
63+
}
6464

6565
renderProposal = ({
6666
link,
@@ -131,7 +131,7 @@ export class MainPage extends mixin() {
131131
return (
132132
<>
133133
<Jumbotron
134-
className="mt-4 text-center"
134+
className="my-5 text-center"
135135
title={
136136
<span className="text-nowrap">
137137
JavaScript&nbsp;
@@ -162,27 +162,32 @@ export class MainPage extends mixin() {
162162
</Button>
163163
</Jumbotron>
164164

165-
<h2 className="mt-4 text-center">TC39 中国会员</h2>
165+
<h2 className="my-5 text-center">TC39 中国会员</h2>
166166

167167
<section className="row">
168-
{companies.map(({ link, logo, name }) => (
168+
{organizations.map(({ link, logo, name }) => (
169169
<a
170-
className="d-flex col-12 col-sm-4 col-md-3 my-3 justify-content-center align-items-center"
170+
className="d-flex col-12 col-sm-4 col-md-3 my-3 flex-column justify-content-between align-items-center text-decoration-none"
171171
target="_blank"
172172
href={link}
173173
>
174174
<Image fluid title={name} src={logo} />
175175
</a>
176176
))}
177+
<footer className="col-12 text-center">
178+
<Button size="sm" outline color="primary" href="members">
179+
查看详情
180+
</Button>
181+
</footer>
177182
</section>
178183

179-
<h2 className="mt-4 text-center">JSCIG 成员</h2>
184+
<h2 className="my-5 text-center">JSCIG 成员</h2>
180185

181186
<SpinnerBox className="row" cover={member.loading}>
182187
{member.list.map(this.renderMember)}
183188
</SpinnerBox>
184189

185-
<h2 className="mt-4 text-center">TC39 既成提案</h2>
190+
<h2 className="my-5 text-center">TC39 既成提案</h2>
186191

187192
<SpinnerBox className="row" cover={proposal.loading}>
188193
{proposal.finishedList.map(this.renderProposal)}

source/page/Organization.tsx

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { createCell, Fragment } from 'web-cell';
2+
import { Image } from 'boot-cell/source/Media/Image';
3+
import { Card, CardFooter } from 'boot-cell/source/Content/Card';
4+
5+
import organizations from '../data/members-china.json';
6+
7+
export function OrganizationPage() {
8+
return (
9+
<>
10+
<h1 className="my-5 text-center">TC39 中国会员单位</h1>
11+
12+
<ul className="list-unstyled row">
13+
{organizations.map(({ logo, link, name, representatives }) => (
14+
<li className="col-12 col-sm-6 col-md-3 px-2 my-2 d-flex">
15+
<Card
16+
className="shadow-sm flex-fill"
17+
image={
18+
<Image
19+
fluid
20+
style={{
21+
height: '5rem',
22+
objectFit: 'contain',
23+
padding: '0.5rem',
24+
}}
25+
src={logo}
26+
/>
27+
}
28+
title={
29+
<a
30+
className="text-decoration-none stretched-link"
31+
target="_blank"
32+
href={link}
33+
>
34+
{name}
35+
</a>
36+
}
37+
>
38+
<CardFooter className="small">
39+
ECMA 大会代表:{representatives.join('、')}
40+
</CardFooter>
41+
</Card>
42+
</li>
43+
))}
44+
</ul>
45+
</>
46+
);
47+
}

source/page/index.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
import { history } from '../model';
1111
import { MainPage } from './Main';
1212
import { ProposalPage } from './Proposal';
13+
import { OrganizationPage } from './Organization';
1314

1415
interface NavMenu extends NavLinkProps {
1516
menu?: DropMenuItemProps[];
@@ -49,12 +50,14 @@ const menu: NavMenu[] = [
4950
routes: Route[] = [
5051
{ paths: [''], component: MainPage },
5152
{ paths: ['proposals'], component: ProposalPage },
53+
{ paths: ['members'], component: OrganizationPage },
5254
];
5355

5456
export function PageFrame() {
5557
return (
5658
<>
5759
<NavBar
60+
fixed="top"
5861
narrow
5962
expand="md"
6063
theme="dark"
@@ -91,6 +94,11 @@ export function PageFrame() {
9194
routes={routes}
9295
/>
9396
<footer className="text-center bg-light py-5">
97+
<img
98+
style={{ width: '2rem', margin: '0 0.25rem' }}
99+
alt="WebCell logo"
100+
src="https://web-cell.dev/WebCell-0.f1ffd28b.png"
101+
/>
94102
自豪地用
95103
<a className="mx-1" target="_blank" href="https://web-cell.dev/">
96104
WebCell v2

0 commit comments

Comments
 (0)