Skip to content

Commit 270b8a9

Browse files
committed
Remove block.tsx
1 parent 0842e4d commit 270b8a9

11 files changed

Lines changed: 140 additions & 362 deletions

File tree

src/AppHost.tsx

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
import './AppHost.scss';
22

3-
import { Col, Layout, Result, Row, Typography } from 'antd';
3+
import { Col, Layout, Result, Row } from 'antd';
44
import ErrorBoundary from 'antd/lib/alert/ErrorBoundary';
55
import React from 'react';
66
import { useRecoilValue } from 'recoil';
77

88
import { LoadingOutlined } from '@ant-design/icons';
99

1010
import { s_apps, s_currentApp } from './apps/Apps';
11-
import Block from './apps/components/block/block';
1211
import Link from './Link';
12+
import { Flex } from '@src/utils/components/flex';
1313

1414
const { Header, Content } = Layout;
15-
const { Title } = Typography;
1615

1716
export default function AppHost() {
1817
const apps = useRecoilValue(s_apps);
@@ -21,33 +20,24 @@ export default function AppHost() {
2120
return (
2221
<Layout>
2322
<Header>
24-
<Block
25-
baseColumns={1}
26-
tablet={{ baseColumns: 3 }}
27-
laptop={{ baseColumns: Math.min(apps.length, 6) }}
28-
align="center"
29-
gap={0.5}
30-
>
23+
<Flex height={64} justifySelf="center" align="stretch" gap={16}>
3124
{apps.map(app => (
3225
<Link
3326
key={app.absolutePath}
3427
to={app.overrideLink ?? app.absolutePath}
3528
absolute
3629
>
37-
<Block
38-
align="center"
39-
textAlign="center"
30+
<div
4031
className={`animate textglow-hover ${
4132
app === currentApp?.app ? 'underglow' : 'underglow-hover'
4233
}`}
43-
padding={{ left: 0.5, right: 0.5 }}
44-
height={4}
34+
style={{ padding: '0 8px', alignContent: 'center' }}
4535
>
46-
<Title level={4}>{app.name}</Title>
47-
</Block>
36+
<h4>{app.name}</h4>
37+
</div>
4838
</Link>
4939
))}
50-
</Block>
40+
</Flex>
5141
</Header>
5242
<Content>
5343
<Row justify="center">

src/apps/about/about-app.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Markdown from 'markdown-to-jsx';
22

33
import readmeMD from '../../../README.md?raw';
44
import { AppDefinition } from '../AppDefinition';
5-
import Block from '../components/block/block';
5+
import { Flex } from '@src/utils/components/flex';
66

77
const AboutApp: AppDefinition = {
88
name: 'About',
@@ -14,13 +14,8 @@ export default AboutApp;
1414

1515
function AboutPage() {
1616
return (
17-
<Block
18-
className="markdown"
19-
mobile={{ width: '100%' }}
20-
tablet={{ width: '75%' }}
21-
laptop={{ width: '50%' }}
22-
>
17+
<Flex down className="markdown">
2318
<Markdown children={readmeMD} />
24-
</Block>
19+
</Flex>
2520
);
2621
}

src/apps/changelog/changelog-app.tsx

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { Card, Col, Row, Timeline, Typography } from 'antd';
1+
import { Card, Timeline, Typography } from 'antd';
22
import React from 'react';
33

44
import { AppDefinition } from '../AppDefinition';
5-
import Block from '../components/block/block';
65
import changeLog from './changelog';
6+
import { Flex } from '@src/utils/components/flex';
77

88
const ChangeLogApp: AppDefinition = {
99
name: 'ChangeLog',
@@ -15,32 +15,30 @@ export default ChangeLogApp;
1515

1616
function ChangeLogPage() {
1717
return (
18-
<Row style={{ paddingTop: 16 }} justify="center">
19-
<Col xs={24} lg={{ span: 16 }}>
20-
<Timeline mode="left" style={{ width: '100%' }}>
21-
{changeLog.map((item, idx) => (
22-
<Timeline.Item style={{ paddingBottom: 60 }} key={idx}>
23-
<Card
24-
style={{ padding: 16, paddingBottom: 16 }}
25-
title={
26-
<Typography.Title level={2}>
27-
{item.date.toDateString()}
28-
</Typography.Title>
29-
}
30-
>
31-
<Block>
32-
<RenderCategory name="Added" data={item.added} />
33-
<RenderCategory name="Changed" data={item.changed} />
34-
<RenderCategory name="Fixed" data={item.fixed} />
35-
<RenderCategory name="Removed" data={item.removed} />
36-
<RenderCategory name="Code" data={item.code} />
37-
</Block>
38-
</Card>
39-
</Timeline.Item>
40-
))}
41-
</Timeline>
42-
</Col>
43-
</Row>
18+
<Flex down justifySelf="center" align="center" maxWidth={1000}>
19+
<Timeline mode="left" style={{ width: '100%' }}>
20+
{changeLog.map((item, idx) => (
21+
<Timeline.Item style={{ paddingBottom: 60 }} key={idx}>
22+
<Card
23+
style={{ padding: 16, paddingBottom: 16 }}
24+
title={
25+
<Typography.Title level={2}>
26+
{item.date.toDateString()}
27+
</Typography.Title>
28+
}
29+
>
30+
<Flex down>
31+
<RenderCategory name="Added" data={item.added} />
32+
<RenderCategory name="Changed" data={item.changed} />
33+
<RenderCategory name="Fixed" data={item.fixed} />
34+
<RenderCategory name="Removed" data={item.removed} />
35+
<RenderCategory name="Code" data={item.code} />
36+
</Flex>
37+
</Card>
38+
</Timeline.Item>
39+
))}
40+
</Timeline>
41+
</Flex>
4442
);
4543
}
4644

src/apps/components/block/block.scss

Lines changed: 0 additions & 36 deletions
This file was deleted.

src/apps/components/block/block.tsx

Lines changed: 0 additions & 180 deletions
This file was deleted.

src/apps/components/hero-avatar/hero-avatar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Avatar } from 'antd';
22

33
import { Hero } from '../../../api/heroes/heroes';
4-
import Block from '../block/block';
4+
import { Flex } from '@src/utils/components/flex';
55

66
export default function HeroAvatar(props: {
77
hero: Hero;
@@ -14,12 +14,12 @@ export default function HeroAvatar(props: {
1414
else if (props.onClick) classes.push('hoverable');
1515

1616
return (
17-
<Block onClick={props.onClick} className={classes.join(' ')}>
17+
<Flex slim onClick={props.onClick} className={classes.join(' ')}>
1818
<Avatar
1919
className={classes.join(' ')}
2020
style={{ height: props.size ?? 80, width: props.size ?? 80 }}
2121
src={props.hero.icon}
2222
/>
23-
</Block>
23+
</Flex>
2424
);
2525
}

0 commit comments

Comments
 (0)