Last active
April 23, 2021 10:59
-
-
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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