This file contains hidden or 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
| { | |
| "name": "project-name", | |
| "version": "1.0.0", | |
| "description": "", | |
| "main": "n/a", | |
| "scripts": { | |
| "serve": "gatsby develop -p 5000", | |
| "dev": "cross-env node $NODE_DEBUG_OPTION ./node_modules/.bin/gatsby develop -p 5000", | |
| } | |
| } |
This file contains hidden or 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
| const yargs = require('yargs') | |
| const csv = require('csvtojson/v2') | |
| const contentful = require('contentful-management') | |
| const { config } = require('dotenv') | |
| const axois = require('axios') | |
| const { min } = require('lodash') | |
| // keep script alive | |
| setTimeout(() => {}, 99999999) |
This file contains hidden or 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
| import React, {FC, Fragment, useEffect, useState} from 'react'; | |
| import { injectIntl } from 'react-intl'; | |
| import { | |
| Container, | |
| Row, | |
| Col, | |
| } from 'reactstrap'; | |
| import classNames from 'classnames'; |
This file contains hidden or 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
| export const updateQueryStringParameter = (uri, key, value) => { | |
| const re = new RegExp(`([?&])${key}=.*?(&|$)`, 'i'); | |
| const separator = uri.indexOf('?') !== -1 ? '&' : '?'; | |
| if (uri.match(re)) { | |
| return uri.replace(re, `$1${key}=${value}$2`); | |
| } | |
| return `${uri + separator + key}=${value}`; | |
| }; |
This file contains hidden or 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
| //Custom hook | |
| import { useEffect, useRef } from 'react'; | |
| const useEffectSkipFirst = (fn, depValue) => { | |
| const isFirstRun = useRef(true); | |
| useEffect(() => { | |
| if (!isFirstRun.current) fn(); |
This file contains hidden or 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
| //parent component | |
| const parent = ({}) => { | |
| const [contentHeight, setContentHeight] = useState(null); | |
| return ( | |
| <Fragment> | |
| <Row className="mx-auto margin-top-15px max-width-991px d-flex"> | |
| <Col className="px-0"> | |
| <ECard | |
| contentHeight={contentHeight} |