@@ -15,8 +15,6 @@ const MainContent = styled.div`
1515 font-size: 1.25em;
1616 line-height: 1.75em;
1717`
18- // const PostTitle = styled.h2`
19- // `
2018const PostDescription = styled . p `
2119 font-size: 1.3em;
2220 font-weight: 600;
@@ -45,8 +43,9 @@ const Pre = styled.pre`
4543 font-size: .80em;
4644 overflow: auto;
4745 text-align: left;
48- margin: 1em 0 ;
46+ margin: 0 0 1em ;
4947 padding: 0.5em;
48+ background-color: ${ ( { theme } ) => theme . asideBackground } ;
5049 /* TODO: is this really doing much? */
5150 & .token-line {
5251 line-height: 1.4em;
@@ -99,16 +98,21 @@ const H3 = styled.h3`
9998 margin-top: 1.5em;
10099 font-family: 'Cuprum', sans-serif;
101100`
101+ const H4 = styled . h4 `
102+ font-size: 1.25em;
103+ font-weight: bold;
104+ margin: 1.5em 0 0;
105+ font-family: 'Cuprum', sans-serif;
106+ `
102107const UL = styled . ul `
103108 margin-bottom: 15px;
104109`
105-
106110const InfoIcon = styled . img `
107111 float: left;
108112 margin: 0 15px 0 0;
109113 border-radius: 50%;
110114 background-color: ${ ( { theme } ) => theme . secondaryColor } ;
111- box-shadow: ${ ( { theme } ) => `0 0 15px ${ theme . secondaryColor } ` } ;
115+ box-shadow: ${ ( { theme } ) => `0 0 20px ${ theme . secondaryColor } ` } ;
112116 @media screen and (max-width: 600px) {
113117 margin: 0 5px 0 0;
114118 }
@@ -120,6 +124,7 @@ const ListItem = styled.li`
120124 list-style-type: square;
121125 color: ${ ( { theme } ) => theme . text } ;
122126`
127+
123128function Post ( props ) {
124129 const [ articleBtmPos , setArticleBtmPos ] = useState ( 0 )
125130 // console.log('Post props: ', props)
@@ -189,6 +194,9 @@ function Post(props) {
189194 else if ( section . style === 'h3' ) {
190195 blockContent . push ( < H3 key = { section . _key } > { section . children [ 0 ] . text } </ H3 > )
191196 }
197+ else if ( section . style === 'h4' ) {
198+ blockContent . push ( < H4 key = { section . _key } > { section . children [ 0 ] . text } </ H4 > )
199+ }
192200 // unformatted text block
193201 else {
194202 blockContent . push ( section . children [ i ] . text )
@@ -303,17 +311,17 @@ function Post(props) {
303311 </ Highlight >
304312 )
305313 }
306-
314+ // TODO: test if list rendering works correctly with multiple lists in post
307315 let list = [ ]
308316 props . body && props . body . forEach ( section => {
309- // console.log('section._type: ', section._type)
310317 if ( section . listItem ) {
311318 list . push (
312- < ListItem > { formatListItem ( section . children ) } </ ListItem >
319+ < ListItem key = { section . _key } > { formatListItem ( section . children ) } </ ListItem >
313320 )
314321 } else {
315322 if ( list . length > 0 ) {
316323 postContent . push (
324+ // TODO: why is React key error being thrown here?
317325 < UL > { list } </ UL >
318326 )
319327 list = [ ]
@@ -353,7 +361,6 @@ function Post(props) {
353361 }
354362 } )
355363
356-
357364 return (
358365 < Layout
359366 onToggleThemeClick = { props . onToggleThemeClick }
0 commit comments