Skip to content

Instantly share code, notes, and snippets.

@landsman
Last active April 23, 2021 10:59
Show Gist options
  • Save landsman/55f7560ebc055811b0545b00b5d137a9 to your computer and use it in GitHub Desktop.
Save landsman/55f7560ebc055811b0545b00b5d137a9 to your computer and use it in GitHub Desktop.
draft how to handle faq data for multiple countries on company site
//
// this is my wanna be database
//
// a) I can turn off/on every faq item for each individual country
// b) all locales are by default handled via lingui, and there are no duplicates
// c) it can be easily refactored to API response in future :)
//
export const faqItems = [
{
id: 'whenMoney',
heading: t`faq.merchant.whenMoney.question`,
content: t`faq.merchant.whenMoney.content`,
countries: {
cz: false,
es: true,
it: true
}
},
{
id: 'howProcess',
heading: t`faq.merchant.howProcess.question`,
content: t`faq.merchant.howProcess.content`,
countries: {
cz: true,
es: true,
it: true
}
}
];
// here I will map this object and filter it by each country, some util function for that would be good ...
// so all be in components, exported and imported to each country page files, right? :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment