-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
/
QuickWord.js
67 lines (63 loc) · 1.79 KB
/
QuickWord.js
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
import React from 'react';
import { useSelector } from 'react-redux';
import { makeStyles } from '@material-ui/core/styles';
import Typography from '@material-ui/core/Typography';
import NoSsr from '@material-ui/core/NoSsr';
import Link from 'docs/src/modules/components/Link';
const backers = [
{
href:
'https://tidelift.com/subscription/pkg/npm-material-ui?utm_source=npm-material-ui&utm_medium=referral&utm_campaign=homepage',
alt: 'tidelift',
title: 'Tidelift — Enterprise-ready open source software',
},
{
href: 'https://bit.dev',
alt: 'bitsrc',
title: 'Bitsrc — The fastest way to share code',
},
{
href: 'https://www.call-em-all.com',
alt: 'callemall',
title: 'Call-Em-All - The easy way to message your group',
},
{
href: 'https://octopus.com/?utm_source=materialui&utm_medium=referral',
alt: 'octopus',
title: 'Octopus - Repeatable, reliable deployments',
},
];
const useStyles = makeStyles(
(theme) => ({
root: {
textAlign: 'center',
minHeight: 60,
paddingBottom: theme.spacing(2),
},
}),
{ name: 'QuickWord' },
);
export default function QuickWord() {
const classes = useStyles();
const t = useSelector((state) => state.options.t);
const backer = backers[Math.floor(backers.length * Math.random())];
return (
<div className={classes.root}>
<Typography variant="caption">{t('homeQuickWord')}</Typography>
<NoSsr defer>
<Link
variant="body2"
display="block"
data-ga-event-category="sponsor"
data-ga-event-action="quick-word"
data-ga-event-label={backer.alt}
href={backer.href}
target="_blank"
rel="noopener nofollow"
>
{backer.title}
</Link>
</NoSsr>
</div>
);
}