Skip to content

Instantly share code, notes, and snippets.

@zilahir
Last active May 8, 2018 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zilahir/0a7e4af0d00a067c5667110a035b5e4b to your computer and use it in GitHub Desktop.
Save zilahir/0a7e4af0d00a067c5667110a035b5e4b to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
import { Grid, Row, Col } from 'react-flexbox-grid';
import { Cta } from './';
import Api from './../../data';
import ApiHun from './../../dataHun';
class Faq extends Component {
componentDidMount() {
let language = this.props.lang;
if (language === 'en') {
console.log(language);
}
}
render() {
return() {
<Col>
{
Api.getFaqText().map(b => {
if (b.id === 1)
return <BHead textClass={b.classname} key={b.id} title={(<div dangerouslySetInnerHTML={{__html: b.title}} />)} />
})
}
</Col>
}
}
}
export { Faq };
//data.js
const Data = { ... } // some json
export default Data;
//dataHun.js --> the same
//the question: how can i change the map function based on the props?
//this is notwirking:
/*
{
if (language === 'en')
{
Api.getFaqText().map(b => {
if (b.id === 1)
return <BHead textClass={b.classname} key={b.id} title={(<div dangerouslySetInnerHTML={{__html: b.title}} />)} />
})
}
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment