Skip to content

Commit 85af3b3

Browse files
feat: refinements to article with authors (#1645)
Co-authored-by: gabriel miranda <[email protected]>
1 parent 6612726 commit 85af3b3

File tree

14 files changed

+186
-194
lines changed

14 files changed

+186
-194
lines changed

apps/web/components/article-with-multiple-authors/inline-styles.tsx

Lines changed: 96 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -11,126 +11,130 @@ import { Layout } from "../_components/layout";
1111

1212
export const component = (
1313
<Row>
14-
<Hr style={{ borderColor: "#CCCCCC", margin: "16px 0" }} />
14+
<Hr style={{ borderColor: "rgb(209,213,219)", margin: "16px 0 0 0" }} />
1515
<Section>
1616
{[
1717
{
18-
name: "Zeno Rocha",
18+
name: "Steve Jobs",
1919
title: "Co-Founder & CEO",
20-
imgSrc: "/static/zeno-rocha.jpeg",
20+
imgSrc: "/static/steve-jobs.jpg",
2121
showDivider: true,
2222
},
2323
{
24-
name: "Bu Kinoshita",
24+
name: "Steve Wozniak",
2525
title: "Co-Founder & CTO",
26-
imgSrc: "/static/bu-kinoshita.jpeg",
26+
imgSrc: "/static/steve-wozniak.jpg",
2727
showDivider: false,
2828
},
2929
].map((author, index) => (
30-
<Section
31-
align="left"
32-
key={index}
33-
style={{
34-
width: "50%",
35-
paddingLeft: author.showDivider ? "0" : "16px",
36-
borderRight: author.showDivider ? "1px solid #CCCCCC" : "none",
37-
}}
38-
>
30+
<>
3931
<Section
40-
style={{
41-
display: "inline-block",
42-
marginTop: "5px",
43-
maxHeight: "48px",
44-
maxWidth: "48px",
45-
textAlign: "left",
46-
}}
32+
align="left"
33+
key={index}
34+
style={{ marginTop: "16px", maxWidth: "288px" }}
4735
>
48-
<Img
49-
alt={author.name}
50-
src={author.imgSrc}
36+
<Section
5137
style={{
52-
borderRadius: "50%",
53-
display: "block",
54-
height: "48px",
55-
objectFit: "cover",
56-
objectPosition: "center",
57-
width: "48px",
58-
}}
59-
/>
60-
</Section>
61-
<Section
62-
style={{
63-
display: "inline-block",
64-
marginLeft: "18px",
65-
maxWidth: "120px",
66-
textAlign: "left",
67-
verticalAlign: "top",
68-
}}
69-
>
70-
<Heading
71-
as="h3"
72-
style={{
73-
color: "#1A202C",
74-
fontSize: "14px",
75-
fontWeight: 500,
76-
lineHeight: "20px",
77-
margin: 0,
38+
display: "inline-block",
39+
marginTop: "5px",
40+
maxHeight: "48px",
41+
maxWidth: "48px",
42+
textAlign: "left",
7843
}}
7944
>
80-
{author.name}
81-
</Heading>
82-
<Text
45+
<Img
46+
alt={author.name}
47+
height={48}
48+
src={author.imgSrc}
49+
style={{
50+
borderRadius: 9999,
51+
display: "block",
52+
objectFit: "cover",
53+
objectPosition: "center",
54+
width: "48px",
55+
}}
56+
width={48}
57+
/>
58+
</Section>
59+
<Section
8360
style={{
84-
color: "#718096",
85-
fontSize: "12px",
86-
fontWeight: 500,
87-
lineHeight: "14px",
88-
margin: 0,
61+
display: "inline-block",
62+
marginLeft: "18px",
63+
maxWidth: "120px",
64+
textAlign: "left",
65+
verticalAlign: "top",
8966
}}
9067
>
91-
{author.title}
92-
</Text>
93-
<Section style={{ marginTop: "4px" }}>
94-
<Link
95-
href="#"
68+
<Heading
69+
as="h3"
9670
style={{
97-
color: "#9CA3AF",
98-
height: "12px",
99-
width: "12px",
71+
color: "#1A202C",
72+
fontSize: "14px",
73+
fontWeight: 500,
74+
lineHeight: "20px",
75+
margin: 0,
10076
}}
10177
>
102-
<svg
103-
fill="currentColor"
104-
height="12"
105-
viewBox="0 0 16 16"
106-
width="12"
107-
xmlns="http://www.w3.org/2000/svg"
108-
>
109-
<path d="M12.6.75h2.454l-5.36 6.142L16 15.25h-4.937l-3.867-5.07-4.425 5.07H.316l5.733-6.57L0 .75h5.063l3.495 4.633L12.601.75Zm-.86 13.028h1.36L4.323 2.145H2.865z" />
110-
</svg>
111-
</Link>
112-
<Link
113-
href="#"
78+
{author.name}
79+
</Heading>
80+
<Text
11481
style={{
115-
color: "#9CA3AF",
116-
height: "12px",
117-
marginLeft: "8px",
118-
width: "12px",
82+
color: "rgb(107,114,128)",
83+
fontSize: "12px",
84+
fontWeight: 500,
85+
lineHeight: "14px",
86+
margin: 0,
11987
}}
12088
>
121-
<svg
122-
fill="currentColor"
123-
height="12"
124-
viewBox="0 0 16 16"
125-
width="12"
126-
xmlns="http://www.w3.org/2000/svg"
89+
{author.title}
90+
</Text>
91+
<Section style={{ marginTop: "4px" }}>
92+
<Link
93+
href="#"
94+
style={{
95+
display: "inline-flex",
96+
height: "12px",
97+
width: "12px",
98+
}}
99+
>
100+
<Img
101+
alt="X"
102+
src="/static/x-icon.png"
103+
style={{ height: "12px", width: "12px" }}
104+
/>
105+
</Link>
106+
<Link
107+
href="#"
108+
style={{
109+
display: "inline-flex",
110+
height: "12px",
111+
marginLeft: "8px",
112+
width: "12px",
113+
}}
127114
>
128-
<path d="M0 1.146C0 .513.526 0 1.175 0h13.65C15.474 0 16 .513 16 1.146v13.708c0 .633-.526 1.146-1.175 1.146H1.175C.526 16 0 15.487 0 14.854zm4.943 12.248V6.169H2.542v7.225zm-1.2-8.212c.837 0 1.358-.554 1.358-1.248-.015-.709-.52-1.248-1.342-1.248S2.4 3.226 2.4 3.934c0 .694.521 1.248 1.327 1.248zm4.908 8.212V9.359c0-.216.016-.432.08-.586.173-.431.568-.878 1.232-.878.869 0 1.216.662 1.216 1.634v3.865h2.401V9.25c0-2.22-1.184-3.252-2.764-3.252-1.274 0-1.845.7-2.165 1.193v.025h-.016l.016-.025V6.169h-2.4c.03.678 0 7.225 0 7.225z" />
129-
</svg>
130-
</Link>
115+
<Img
116+
alt="LinkedIn"
117+
src="/static/in-icon.png"
118+
style={{ height: "12px", width: "12px" }}
119+
/>
120+
</Link>
121+
</Section>
131122
</Section>
132123
</Section>
133-
</Section>
124+
{author.showDivider ? (
125+
<Hr
126+
style={{
127+
border: "none",
128+
backgroundColor: "rgb(209,213,219)",
129+
display: "inline-block",
130+
float: "left",
131+
height: "58px",
132+
marginRight: "16px",
133+
width: "1px",
134+
}}
135+
/>
136+
) : null}
137+
</>
134138
))}
135139
</Section>
136140
</Row>

apps/web/components/article-with-multiple-authors/tailwind.tsx

Lines changed: 54 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -11,71 +11,73 @@ import { Layout } from "../_components/layout";
1111

1212
export const component = (
1313
<Row>
14-
<Hr className="my-4 border-gray-300" />
15-
<Section className="flex">
14+
<Hr className="mb-[0px] mt-[16px] !border-gray-300" />
15+
<Section>
1616
{[
1717
{
18-
name: "Zeno Rocha",
18+
name: "Steve Jobs",
1919
title: "Co-Founder & CEO",
20-
imgSrc: "/static/zeno-rocha.jpeg",
20+
imgSrc: "/static/steve-jobs.jpg",
2121
showDivider: true,
2222
},
2323
{
24-
name: "Bu Kinoshita",
24+
name: "Steve Wozniak",
2525
title: "Co-Founder & CTO",
26-
imgSrc: "/static/bu-kinoshita.jpeg",
26+
imgSrc: "/static/steve-wozniak.jpg",
2727
showDivider: false,
2828
},
2929
].map((author, index) => (
30-
<Section
31-
className={`w-1/2 pl-${author.showDivider ? "0" : "4"} ${
32-
author.showDivider ? "border-r border-gray-300" : ""
33-
}`}
34-
key={index}
35-
>
36-
<Section className="mt-1.5 inline-block max-h-12 max-w-12 text-left">
37-
<Img
38-
alt={author.name}
39-
className="block h-12 w-12 rounded-full object-cover object-center"
40-
src={author.imgSrc}
41-
/>
42-
</Section>
43-
<Section className="ml-4 inline-block max-w-[120px] text-left align-top">
44-
<Heading
45-
as="h3"
46-
className="m-0 text-sm font-medium leading-5 text-gray-900"
47-
>
48-
{author.name}
49-
</Heading>
50-
<Text className="m-0 text-xs font-medium leading-4 text-gray-500">
51-
{author.title}
52-
</Text>
53-
<Section className="mt-1">
54-
<Link className="h-3 w-3 text-gray-400" href="#">
55-
<svg
56-
fill="currentColor"
57-
height="12"
58-
viewBox="0 0 16 16"
59-
width="12"
60-
xmlns="http://www.w3.org/2000/svg"
61-
>
62-
<path d="M12.6.75h2.454l-5.36 6.142L16 15.25h-4.937l-3.867-5.07-4.425 5.07H.316l5.733-6.57L0 .75h5.063l3.495 4.633L12.601.75Zm-.86 13.028h1.36L4.323 2.145H2.865z" />
63-
</svg>
64-
</Link>
65-
<Link className="ml-2 h-3 w-3 text-gray-400" href="#">
66-
<svg
67-
fill="currentColor"
68-
height="12"
69-
viewBox="0 0 16 16"
70-
width="12"
71-
xmlns="http://www.w3.org/2000/svg"
30+
<>
31+
<Section align="left" className="mt-[16px] max-w-[288px]" key={index}>
32+
<Section className="mt-[5px] inline-block max-h-[48px] max-w-[48px] text-left">
33+
<Img
34+
alt={author.name}
35+
className="block rounded-full object-cover object-center"
36+
height={48}
37+
src={author.imgSrc}
38+
width={48}
39+
/>
40+
</Section>
41+
<Section className="ml-[18px] inline-block max-w-[120px] text-left align-top">
42+
<Heading
43+
as="h3"
44+
className="m-0 text-[14px] font-medium leading-[20px] text-gray-900"
45+
>
46+
{author.name}
47+
</Heading>
48+
<Text className="m-0 text-[12px] font-medium leading-[14px] text-gray-500">
49+
{author.title}
50+
</Text>
51+
<Section className="mt-[4px]">
52+
<Link className="inline-flex h-[12px] w-[12px]" href="#">
53+
<Img
54+
alt="X"
55+
height={12}
56+
src="/static/x-icon.png"
57+
width={12}
58+
/>
59+
</Link>
60+
<Link
61+
className="ml-[8px] inline-flex h-[12px] w-[12px]"
62+
href="#"
7263
>
73-
<path d="M0 1.146C0 .513.526 0 1.175 0h13.65C15.474 0 16 .513 16 1.146v13.708c0 .633-.526 1.146-1.175 1.146H1.175C.526 16 0 15.487 0 14.854zm4.943 12.248V6.169H2.542v7.225zm-1.2-8.212c.837 0 1.358-.554 1.358-1.248-.015-.709-.52-1.248-1.342-1.248S2.4 3.226 2.4 3.934c0 .694.521 1.248 1.327 1.248zm4.908 8.212V9.359c0-.216.016-.432.08-.586.173-.431.568-.878 1.232-.878.869 0 1.216.662 1.216 1.634v3.865h2.401V9.25c0-2.22-1.184-3.252-2.764-3.252-1.274 0-1.845.7-2.165 1.193v.025h-.016l.016-.025V6.169h-2.4c.03.678 0 7.225 0 7.225z" />
74-
</svg>
75-
</Link>
64+
<Img
65+
alt="LinkedIn"
66+
height={12}
67+
src="/static/in-icon.png"
68+
width={12}
69+
/>
70+
</Link>
71+
</Section>
7672
</Section>
7773
</Section>
78-
</Section>
74+
{author.showDivider ? (
75+
<Hr
76+
className="mr-[16px] inline-block h-[58px] w-[1px] border-none bg-gray-300"
77+
style={{ float: "left" }}
78+
/>
79+
) : null}
80+
</>
7981
))}
8082
</Section>
8183
</Row>

0 commit comments

Comments
 (0)