Skip to content

Commit 2efb469

Browse files
author
Vikas Agarwal
committed
Fixed issues with last refactoring
1 parent bbb897c commit 2efb469

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

src/components/FAQ/FAQContainer.jsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
import React, { Component, Fragment } from 'react'
1+
import React, { Component } from 'react'
22
import FAQItem from './FAQItem'
33
import { getEntry } from '../../api/contentful'
44
import spinnerWhileLoading from '../../components/LoadingSpinner'
55
import './FAQContainer.scss'
66

77

88
const 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

2020
const 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
)

src/components/FAQ/FAQContainer.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
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;

0 commit comments

Comments
 (0)