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 reset = () => { | |
dispatch({ type: 'reset' }) | |
} | |
const onThemeChange = (e) => { | |
dispatch({ type: 'set-theme', theme: e.target.value }) | |
} | |
return { | |
...state, |
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 ShowMeTheMoney = () => { | |
const [money, setMoney] = useState(0) | |
const showThemTheMoney = (money) => { | |
setMoney(money) | |
} | |
const hideTheMoney = () => { | |
setMoney(null) | |
} |
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
return ( | |
<div> | |
<h4>Where is the money?</h4> | |
<hr /> | |
<div style={{ display: 'flex', alignItems: 'center' }}> | |
<SomeCustomButton | |
type="button" | |
onClick={sayWhereTheMoneyIs.bind(null, "I don't know")} | |
> | |
I'll tell you |
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 Cereal = ({ items, ...otherProps }) => { | |
const indexHalf = Math.floor(items.length / 2) | |
const items1 = items.slice(0, indexHalf) | |
const items2 = items.slice(indexHalf) | |
return ( | |
<> | |
<ul> | |
{items1.map(({ to, label }) => ( | |
<li key={to}> |
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 { generateRandomUniqueKey } from 'utils/generating' | |
const Cereal = ({ items, ...otherProps }) => { | |
const indexHalf = Math.floor(items.length / 2) | |
const items1 = items.slice(0, indexHalf) | |
const items2 = items.slice(indexHalf) | |
return ( | |
<> | |
<ul> |
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 { generateRandomUniqueKey } from 'utils/generating' | |
const Cereal = ({ items, ...otherProps }) => { | |
const indexHalf = Math.floor(items.length / 2) | |
const items1 = items.slice(0, indexHalf) | |
const items2 = items.slice(indexHalf) | |
return ( | |
<> | |
<ul> |
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 SomeComponent = ({ items = [], todaysDate, tomorrowsDate }) => { | |
const [someState, setSomeState] = useState(null) | |
return ( | |
<div> | |
<h2>Today is {todaysDate}</h2> | |
<small>And tomorrow is {tomorrowsDate}</small> | |
<hr /> | |
{items.map((item, index) => ( | |
<span key={`item_${index}`}>{item.email}</span> |
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 SomeComponent = () => ( | |
<Body noBottom> | |
<Header center>Title</Header> | |
<Divider /> | |
<Background grey> | |
<Section height={500}> | |
<Grid spacing={16} container> | |
<Grid xs={12} sm={6} item> | |
<div className={classes.groupsHeader}> | |
<Header center>Groups</Header> |
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 SectionContainer = ({ | |
bgProps, | |
height = 500, | |
header, | |
headerProps, | |
imgProps, | |
}) => ( | |
<Background {...bgProps}> | |
<Section height={height}> | |
<Grid spacing={16} 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
const SectionContainer = ({ | |
bgProps, | |
sectionProps, | |
children, | |
gridContainerProps, | |
gridColumnLeftProps, | |
gridColumnRightProps, | |
columnLeft, | |
columnRight, | |
}) => ( |