forked from mui/material-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathReferences.tsx
54 lines (50 loc) · 1.51 KB
/
References.tsx
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
import * as React from 'react';
import dynamic from 'next/dynamic';
import { useInView } from 'react-intersection-observer';
import Box from '@mui/material/Box';
import Container from '@mui/material/Container';
import Typography from '@mui/material/Typography';
import {
CORE_CUSTOMERS,
ADVANCED_CUSTOMERS,
DESIGNKITS_CUSTOMERS,
TEMPLATES_CUSTOMERS,
} from 'docs/src/components/home/CompaniesGrid';
export { CORE_CUSTOMERS, ADVANCED_CUSTOMERS, DESIGNKITS_CUSTOMERS, TEMPLATES_CUSTOMERS };
const CompaniesGrid = dynamic(() => import('./CompaniesGrid'));
const References = ({
companies,
}: {
companies:
| typeof CORE_CUSTOMERS
| typeof ADVANCED_CUSTOMERS
| typeof DESIGNKITS_CUSTOMERS
| typeof TEMPLATES_CUSTOMERS;
}) => {
const { ref, inView } = useInView({
triggerOnce: true,
threshold: 0,
});
return (
<Container ref={ref} sx={{ py: { xs: 4, sm: 6, md: 10 } }}>
<Box sx={{ minHeight: { xs: 236, sm: 144, md: 52 } }}>
{inView && <CompaniesGrid data={companies} />}
</Box>
<Typography
color={(theme) => (theme.palette.mode === 'dark' ? 'grey.500' : 'grey.800')}
textAlign="center"
variant="body2"
sx={{
minHeight: 42, // hard-coded to reduce CLS (layout shift)
mt: 4,
mx: 'auto',
maxWidth: 400,
}}
>
From startups to Fortune 500s, the world's best product teams use MUI to build their
UIs.
</Typography>
</Container>
);
};
export default References;