We will build a contrived user registration that will take
-
new user's name and
-
a link to a picture they want to use for an avatar
The added users will then display below the form.
This will help us
We will build a contrived user registration that will take
new user's name and
a link to a picture they want to use for an avatar
The added users will then display below the form.
This will help us
use deep-freeze
in reducer tests to ensure no mutations
Required Fields
Photo/style.css
/* block */
.Photo {}
/* element */
.Photo__img {}
/* modifier */
.Photo--large {}
/* root */ | |
.Photo {} | |
/* modifier */ | |
.Photo--large {} | |
/* child */ | |
.Photo__caption {} |
/** | |
* CSS Modules Magic: | |
* styles = { Photo: '[hash]-Photo', ... } | |
*/ | |
import styles from './style' | |
import React from 'react' | |
import cn from 'classnames' | |
const Photo = ({src, alt, isLarge}) => | |
<div {...{ className: cn({ |
/* App/style/css/settings */ | |
:root { | |
—-clr-watermelon: #4FC1E9; | |
—-spacing-default: 12px; | |
} | |
@custom-media —-viewport-narrow (width >= 31.25em); | |
/** | |
* Example using settings in 'Generic' layer |
const pictionBlue = '#4FC1E9' | |
export const colors = { | |
primary: pictionBlue | |
} | |
export const spacing = { | |
tiny: ‘4px’ | |
} |
import { baseFontSize } from ‘./settings.js’ | |
export const pxToEm = (px) => | |
`${px / baseFontSize}em` |