Skip to content

Commit 1acc7a5

Browse files
Render section external links
1 parent 9e1f70b commit 1acc7a5

File tree

2 files changed

+26
-9
lines changed

2 files changed

+26
-9
lines changed

web/components/TopicSection.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ import ShortcutTable from './ShortcutTable'
33
import DescriptiveItem from './DescriptiveItem'
44
// import styled from 'styled-components'
55

6-
// const H3 = styled.h3`
7-
// color: rgb(255, 163, 133);
8-
// margin-bottom: 10px;
9-
// font-weight: 600;
6+
// const LinkList = styled.ul`
7+
// margin-top: 15px;
108
// `
119

1210
export default function TopicSection(props) {
11+
console.log('TS props: ', props);
1312
return (
1413
<section
1514
id={props.section.anchor_id}
@@ -24,14 +23,25 @@ export default function TopicSection(props) {
2423
>
2524
{props.section.name}
2625
</h3>
27-
26+
2827
{props.section.description && (
2928
<p className="section_description">
3029
{props.section.description}
3130
</p>
32-
33-
3431
)}
32+
33+
<ul className="link_list">
34+
{props.section.external_links && (
35+
props.section.external_links.map(link => {
36+
return (
37+
<li key={link._id}>
38+
<a href={link.url}>{link.description}</a>
39+
</li>
40+
)
41+
})
42+
)}
43+
</ul>
44+
3545
</div>
3646

3747
{props.section.type === 'shortcut_table'

web/src/styles/global.css

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,21 @@ h2, h4, thead th {
129129
font-size: .9em;
130130
}
131131

132-
.description_container li a {
132+
.description_container li a,
133+
.link_list {
133134
font-family: 'Work Sans', sans-serif;
134135
}
135136

136-
.description_container li::before {
137+
.description_container li::before,
138+
.link_list li::before {
137139
content: ' \2022 ';
138140
}
139141

142+
.link_list {
143+
margin-top: 15px;
144+
line-height: 1.5em;;
145+
}
146+
140147
table {
141148
width: 100%;
142149
}

0 commit comments

Comments
 (0)