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 Spinner = ({ | |
children, | |
containerProps, | |
spinnerProps, | |
xs, | |
sm, | |
center, | |
}) => ( | |
<div | |
className={cx('spinner-container', { |
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
.flex-center { | |
position: absolute; | |
top: 0; | |
right: 0; | |
bottom: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; | |
display: flex; | |
justify-content: center; |
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 axios from 'axios' | |
const getFrogs = async (params) => { | |
try { | |
const response = await axios.get( | |
'https://frogs-and-their-tongues.com', | |
params, | |
) | |
const frogs = response.data.result | |
return frogs |
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 axios from 'axios' | |
const getFrogs = async (params) => { | |
try { | |
const response = await axios.get( | |
'https://frogs-and-their-tongues.com', | |
params, | |
) | |
const frogs = response.data.result | |
return frogs | |
} catch (error) { |
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 axios from 'axios' | |
const getFrogs = async (params) => { | |
try { | |
const frogs = await axios.get('https://frogs-and-their-tongues.com', params) | |
return data | |
} catch (error) { | |
throw error | |
} | |
} |
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 from 'react' | |
import { GoCheck, GoAlert } from 'react-icons/go' | |
import { FaInfoCircle } from 'react-icons/fa' | |
import { MdPriorityHigh } from 'react-icons/md' | |
import { toast } from 'react-toastify' | |
/* | |
Calling these toasts most likely happens in the UI 100% of the time. | |
So it is safe to render components/elements as toasts. | |
*/ |
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 { toast } from 'react-toastify' | |
import { | |
info as toastInfo, | |
success as toastSuccess, | |
toastIds, | |
} from 'util/toast' | |
import App from './App' | |
const Root = () => { | |
const onOnline = () => { |
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, { isValidElement } from 'react' | |
import isString from 'lodash/isString' | |
import isFunction from 'lodash/isFunction' | |
import { GoCheck, GoAlert } from 'react-icons/go' | |
import { FaInfoCircle } from 'react-icons/fa' | |
import { MdPriorityHigh } from 'react-icons/md' | |
import { toast } from 'react-toastify' | |
/* | |
Calling these toasts most likely happens in the UI 100% of the time. |
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 preparePeopleWithFavoriteColor = (color) => { | |
const _people = [] | |
return { | |
getPeople() { | |
return _people | |
}, | |
addPeople(people) { | |
_people.push(...people) | |
}, |
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 appReducer = combineReducers({ | |
app, | |
form: formReducer, | |
}) | |
// Higher order reducer that resets the redux state when we dispatch a logout action | |
const rootReducer = (state, action) => { | |
if (['LOGOUT'].includes(action.type)) { | |
state = undefined | |
} |