-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReferencesSection.tsx
More file actions
82 lines (71 loc) · 2.31 KB
/
Copy pathReferencesSection.tsx
File metadata and controls
82 lines (71 loc) · 2.31 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
import { css, Theme, useTheme } from '@emotion/react';
import { Markup } from 'interweave';
import { DividedSection } from '../components/DividedSection';
const sectionStyle = (theme: Theme) => css`
background-color: ${theme.whiteColor};
.software-references,
.company-references {
display: grid;
gap: var(${theme.variables.gutter});
grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
> * {
padding: var(${theme.variables.gutter});
background-color: ${theme.backgroundColor};
}
}
.software-references {
.reference-box {
img {
display: block;
height: 8rem;
width: auto;
margin-inline: auto;
margin-bottom: var(${theme.variables.gutter});
}
h3 {
min-height: 7rem;
}
}
}
.company-references {
margin-top: 3rem;
a {
text-align: center;
img {
display: block;
margin-inline: auto;
height: 3rem;
width: auto;
margin-bottom: var(${theme.variables.gutter});
}
}
}
`;
type Props = {
softwareReferences: Queries.IndexPageQuery['softwareReferences'];
companyReferences: Queries.IndexPageQuery['companyReferences'];
};
export function ReferencesSection({ softwareReferences, companyReferences }: Props) {
const theme = useTheme();
return (
<DividedSection upperColor={theme.whiteColor} lowerColor={theme.backgroundColor} flipVertically css={sectionStyle}>
<div className="software-references">
{softwareReferences.nodes.map((reference, i) => (
<div className="reference-box" key={reference.frontmatter?.title || i}>
<img src={reference.frontmatter?.icon?.publicURL ?? ''} alt={reference.frontmatter?.title ?? ''} />
<h3>{reference.frontmatter?.title}</h3>
<Markup content={reference.html} />
</div>
))}
</div>
<div className="company-references">
{companyReferences.nodes.map((reference, i) => (
<a href={reference.frontmatter?.link ?? ''} target="_blank" key={reference.frontmatter?.title || i} rel="noreferrer">
<img src={reference.frontmatter?.logo?.publicURL ?? ''} alt={reference.html?.toString()} />
<Markup content={reference.html} />
</a>
))}
</div>
</DividedSection>
);
}