File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed
Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 1- import React , { Component , Fragment } from 'react'
1+ import React , { Component } from 'react'
22import FAQItem from './FAQItem'
33import { getEntry } from '../../api/contentful'
44import spinnerWhileLoading from '../../components/LoadingSpinner'
55import './FAQContainer.scss'
66
77
88const FAQList = ( { entry } ) => (
9- < Fragment >
9+ < div styleName = "faq-list-container" >
1010 {
1111 entry . fields . items . map ( ( item , idx ) => {
1212 return (
1313 < FAQItem key = { idx } item = { item } />
1414 ) }
1515 )
1616 }
17- </ Fragment >
17+ </ div >
1818)
1919
2020const EnhancedFAQContainer = spinnerWhileLoading ( props => {
@@ -25,25 +25,26 @@ class FAQContainer extends Component {
2525 constructor ( props ) {
2626 super ( props )
2727 this . state = {
28- faqs : null
28+ faqs : null ,
29+ isLoading : true
2930 }
3031 }
3132
3233 componentWillMount ( ) {
3334 getEntry ( this . props . contentKey ) . then ( ( entry ) => {
34- this . setState ( { faqs : entry } )
35+ this . setState ( { faqs : entry , isLoading : false } )
3536 } )
3637 }
3738
3839 render ( ) {
3940 const { pageTitle } = this . props
40- const { faqs } = this . state
41+ const { faqs, isLoading } = this . state
4142
4243 return (
4344 < div styleName = "main" >
4445 < h1 styleName = "title" > { pageTitle } </ h1 >
4546 < div styleName = "content" >
46- < EnhancedFAQContainer entry = { faqs } />
47+ < EnhancedFAQContainer entry = { faqs } isLoading = { isLoading } />
4748 </ div >
4849 </ div >
4950 )
Original file line number Diff line number Diff line change 11@import ' ~tc-ui/src/styles/tc-includes' ;
22@import " ../../styles/includes" ;
33
4+
5+ .faq-list-container {
6+
7+ }
8+
49.accordion {
510 & + & {
611 margin-top : 2 * $base-unit ;
You can’t perform that action at this time.
0 commit comments