-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHero.tsx
More file actions
141 lines (132 loc) · 4.38 KB
/
Hero.tsx
File metadata and controls
141 lines (132 loc) · 4.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
import OpenInNewIcon from '@mui/icons-material/OpenInNew';
import ListIcon from '@mui/icons-material/List';
import { Box, Button, Chip, Container, Stack, Typography } from '@mui/material';
import { Link as RouterLink } from 'react-router-dom';
import { InstallCommand } from '../InstallCommand/InstallCommand';
import { ProjectBadges } from '../ProjectBadges/ProjectBadges.tsx';
import { createTrackedLinkHandler } from '../../services/analytics-handlers.ts';
export const Hero = () => {
return (
<Box
component="section"
sx={{
py: { xs: 6, md: 12 },
background: 'radial-gradient(circle at top, rgba(56,189,248,0.15), transparent 40%)',
}}
>
<Container maxWidth="lg">
<Stack spacing={4} alignItems="flex-start">
<Chip label="Open-source toolkit for backend communication" color="primary" />
<Box>
<Typography
variant="h1"
sx={{
fontSize: { xs: '2.5rem', md: '4.5rem' },
lineHeight: 1.05,
maxWidth: 900,
textWrap: 'wrap',
}}
>
Reliable toolkit for service-to-service communication
</Typography>
<Chip
label="Built for microservices, internal APIs, integrations, and background workers"
color="primary"
variant="outlined"
sx={{ mt: 1, mb: 1, display: { xs: 'none', sm: 'inline-flex' } }}
/>
<Chip
label="Built for modern backend systems"
color="primary"
variant="outlined"
sx={{ mt: 1, mb: 1, display: { xs: 'inline-flex', sm: 'none' } }}
/>
<ProjectBadges />
<Typography
variant="h6"
color="text.secondary"
sx={{
mt: 3,
maxWidth: 760,
fontWeight: 400,
lineHeight: 1.6,
}}
>
The first package, <strong>@dfsync/client</strong>, provides a lightweight and
reliable HTTP client for service-to-service communication in Node.js, with built-in
retry, authentication, and lifecycle hooks.
</Typography>
</Box>
<Stack
direction={{ xs: 'column', sm: 'row' }}
spacing={2}
sx={{ width: { xs: '100%', md: 'auto' } }}
>
<Button
fullWidth
variant="contained"
size="medium"
href="https://www.npmjs.com/package/@dfsync/client"
target="_blank"
rel="noreferrer"
endIcon={<OpenInNewIcon />}
onClick={createTrackedLinkHandler('npm', {
location: 'hero',
url: 'https://github.com/dfsyncjs/dfsync',
label: 'View on npm',
})}
>
View on npm
</Button>
<Button
fullWidth
component={RouterLink}
variant="outlined"
size="medium"
to="/docs"
startIcon={<ListIcon />}
onClick={createTrackedLinkHandler('docs', {
location: 'hero',
url: 'https://github.com/dfsyncjs/dfsync',
label: 'Documentation',
})}
>
Documentation
</Button>
</Stack>
<InstallCommand />
<Box
sx={{
mt: 3,
width: '100%',
p: { xs: 3, md: 4 },
borderRadius: 1,
bgcolor: 'background.paper',
border: '1px solid',
borderColor: 'divider',
overflowX: 'auto',
}}
>
<Typography
component="pre"
sx={{
m: 0,
fontFamily: 'ui-monospace, SFMono-Regular, Menlo, monospace',
fontSize: 14,
lineHeight: 1.7,
color: 'text.primary',
}}
>
{`import { createClient } from "@dfsync/client";
const client = createClient({
baseURL: "https://api.example.com",
retry: { attempts: 3 }
});
const users = await client.get("/users");`}
</Typography>
</Box>
</Stack>
</Container>
</Box>
);
};