Last active
August 2, 2016 15:48
-
-
Save mikeyamadeo/f5e7a51417fe75eee4110d3123d8e28b to your computer and use it in GitHub Desktop.
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
/** | |
* 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({ | |
[styles.Photo]: true, | |
[styles['Photo--large']]: isLarge}) | |
}}> | |
<img {...{ src, alt, | |
className: styles['Photo__img'] }} | |
/> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment