Skip to content

Instantly share code, notes, and snippets.

@mikeyamadeo
Last active August 2, 2016 15:48
Show Gist options
  • Save mikeyamadeo/f5e7a51417fe75eee4110d3123d8e28b to your computer and use it in GitHub Desktop.
Save mikeyamadeo/f5e7a51417fe75eee4110d3123d8e28b to your computer and use it in GitHub Desktop.
/**
* 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