-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathdevBio.js
More file actions
99 lines (94 loc) · 2.52 KB
/
devBio.js
File metadata and controls
99 lines (94 loc) · 2.52 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
import React, { useState } from "react"
import { Box, Flex, Image, Text } from "theme-ui"
import {
faBehance,
faGithub,
faLinkedinIn,
faTwitter,
} from "@fortawesome/free-brands-svg-icons"
import { faEnvelope, faLink } from "@fortawesome/free-solid-svg-icons"
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
import useDefaultThumbnail from "../hooks/useDefaultThumbnail"
const CONTACT_ICON_MAP = {
website: faLink,
email: faEnvelope,
linkedin: faLinkedinIn,
github: faGithub,
twitter: faTwitter,
behance: faBehance,
}
const DevBio = ({
dev: { avatar, name, title, company, blurb, skills = [], contacts = [] },
}) => {
const defaultThumbnail = useDefaultThumbnail()
const [image, setImage] = useState(avatar)
return (
<Flex color="white" flexDirection={["row", "column"]}>
<Image
width={["25%", "100%"]}
height="100%"
mb={[0, 2]}
mr={[2, 0]}
src={image}
onError={() => setImage(defaultThumbnail)}
/>
<Box width={["75%", "100%"]}>
<Text
as="p"
color="lightBlue"
fontSize={2}
fontWeight="hero"
sx={{ textTransform: "uppercase" }}
>
{name}
</Text>
<Text
as="p"
mb={1}
letterSpacing="0.1em"
fontSize={0}
color="gold"
sx={{ textTransform: "uppercase" }}
>
{[title, company].filter(Boolean).join(", ")}
</Text>
<Text as="p" mb={1}>
{blurb}
</Text>
<Box as="ul" mb={1}>
{skills.slice(0, 5).map((skill) => (
<Box
as="li"
display="inline-block"
letterSpacing="0.1em"
fontSize={0}
sx={{
textTransform: "uppercase",
"&:not(:last-child)::after": {
display: "inline-block",
content: "'×'",
mx: "0.4rem",
},
}}
>
{skill}
</Box>
))}
</Box>
<ul>
{contacts.slice(0, 5).map((contact) => (
<Box as="li" display="inline-block" mr={1}>
<a href={contact.url} target="_blank" rel="noreferrer noopener">
<FontAwesomeIcon
icon={CONTACT_ICON_MAP[contact.type]}
color="gold"
/>
</a>
</Box>
))}
</ul>
</Box>
</Flex>
)
}
export default DevBio