Skip to content

Commit ec95ef6

Browse files
committed
update github links, add badges
1 parent 2b1b460 commit ec95ef6

6 files changed

Lines changed: 78 additions & 8 deletions

File tree

src/components/Footer/Footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const Footer = () => {
3131
npm
3232
</Link>
3333
<Link
34-
href="https://github.com/dfsyncjs/dfsync"
34+
href="https://github.com/dfsyncjs/dfsync/tree/main/packages/client"
3535
target="_blank"
3636
rel="noreferrer"
3737
underline="hover"

src/components/Header/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const Header = () => {
3333
</Button>
3434
<Button
3535
color="inherit"
36-
href="https://github.com/dfsyncjs/dfsync"
36+
href="https://github.com/dfsyncjs/dfsync/tree/main/packages/client"
3737
target="_blank"
3838
rel="noreferrer"
3939
startIcon={<GitHubIcon />}

src/components/Hero/Hero.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import OpenInNewIcon from '@mui/icons-material/OpenInNew';
2+
import ListIcon from '@mui/icons-material/List';
23
import { Box, Button, Chip, Container, Stack, Typography } from '@mui/material';
4+
import { Link as RouterLink } from 'react-router-dom';
35
import { InstallCommand } from '../InstallCommand/InstallCommand';
6+
import { ProjectBadges } from '../ProjectBadges/ProjectBadges.tsx';
47

58
export const Hero = () => {
69
return (
@@ -37,6 +40,8 @@ export const Hero = () => {
3740
}}
3841
/>
3942

43+
<ProjectBadges />
44+
4045
<Typography
4146
variant="h6"
4247
color="text.secondary"
@@ -64,12 +69,11 @@ export const Hero = () => {
6469
View on npm
6570
</Button>
6671
<Button
72+
component={RouterLink}
6773
variant="outlined"
6874
size="medium"
69-
href="https://github.com/dfsyncjs/dfsync/blob/main/packages/client/README.md"
70-
target="_blank"
71-
rel="noreferrer"
72-
endIcon={<OpenInNewIcon />}
75+
to="/docs"
76+
startIcon={<ListIcon />}
7377
>
7478
Documentation
7579
</Button>
@@ -82,7 +86,7 @@ export const Hero = () => {
8286
mt: 3,
8387
width: '100%',
8488
p: { xs: 3, md: 4 },
85-
borderRadius: 4,
89+
borderRadius: 1,
8690
bgcolor: 'background.paper',
8791
border: '1px solid',
8892
borderColor: 'divider',

src/components/InstallCommand/InstallCommand.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const InstallCommand = () => {
2323
bgcolor: 'background.paper',
2424
border: '1px solid',
2525
borderColor: 'divider',
26-
borderRadius: 3,
26+
borderRadius: 1,
2727
px: 3,
2828
py: 2,
2929
maxWidth: 500,
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import { Stack, Box, Link } from '@mui/material';
2+
3+
const packageName = '@dfsync/client';
4+
const repoName = 'dfsyncjs/dfsync';
5+
6+
export const ProjectBadges = () => {
7+
return (
8+
<Stack direction="row" spacing={1.5} alignItems="center" flexWrap="wrap" sx={{ mt: 2 }}>
9+
{/* npm version */}
10+
<Link
11+
href={`https://www.npmjs.com/package/${packageName}`}
12+
target="_blank"
13+
rel="noreferrer"
14+
underline="none"
15+
sx={{ lineHeight: 1 }}
16+
>
17+
<Box
18+
component="img"
19+
src={`https://img.shields.io/npm/v/${encodeURI(packageName)}`}
20+
alt="npm version"
21+
sx={{ height: 20 }}
22+
/>
23+
</Link>
24+
25+
{/* npm weekly downloads */}
26+
<Link
27+
href={`https://www.npmjs.com/package/${packageName}`}
28+
target="_blank"
29+
rel="noreferrer"
30+
underline="none"
31+
sx={{ lineHeight: 1 }}
32+
>
33+
<Box
34+
component="img"
35+
src={`https://img.shields.io/npm/dw/${encodeURI(packageName)}`}
36+
alt="npm downloads"
37+
sx={{ height: 20 }}
38+
/>
39+
</Link>
40+
41+
{/* github stars */}
42+
<Link
43+
href={`https://github.com/${repoName}/tree/main/packages/client`}
44+
target="_blank"
45+
rel="noreferrer"
46+
underline="none"
47+
sx={{ lineHeight: 1 }}
48+
>
49+
<Box
50+
component="img"
51+
src={`https://img.shields.io/github/stars/${repoName}`}
52+
alt="github stars"
53+
sx={{ height: 20 }}
54+
/>
55+
</Link>
56+
57+
<Box
58+
component="img"
59+
src={`https://img.shields.io/github/license/${repoName}`}
60+
alt="license"
61+
sx={{ height: 20 }}
62+
/>
63+
</Stack>
64+
);
65+
};

src/components/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ export { Features } from './Features/Features';
22
export { Footer } from './Footer/Footer';
33
export { Header } from './Header/Header';
44
export { Hero } from './Hero/Hero';
5+
export { ProjectBadges } from './ProjectBadges/ProjectBadges';

0 commit comments

Comments
 (0)