- React
- Typescript
- Gatsby
- GraphQL
- Design system GOV.cz
- Prettier
- Eslint
- Jest
-
Install Gatsby CLI
yarn global add gatsby-cli
-
Install dependencies
yarn install
-
Run dev server
yarn dev
- Upon running the gatsby build/dev, it first downloads all of the data from Drupal prod env (you will see the requests in your console).
(it will only download the data once, and that use those until you clean Gatsby cache by
yarn dev:clean
, or set your env variableSHOULD_REFRESH_DRUPAL_DATA
to1
if you always want to have fresh Drupal data) - Gatsby then stores this data locally and offers a GraphQL on top of that data.
- You can browse all of the data to be used in components later in GraphiQL
- Sometimes the dev env halts, solution is usually to stop and run
yarn dev
again. We will eventually fix that, but feel free to fix it and create a PR 🤗
We try to localize all of the strings in this app. All of the strings are translated on Drupal side and then we only request those on Gatsby side.
- Request a translation for a certain string in the Drupal slack channel.
- You will receive a translation key e.g.
related_measures
- Use the translation:
import { useTranslation } from '@/components/i18n';
const Header: React.FC<Props> = () => {
const { t } = useTranslation();
//...
<h3>{t('related_measures')}</h3>;
//...