Created
February 12, 2016 14:37
-
-
Save codemilli/2285437d71559bc3f46b to your computer and use it in GitHub Desktop.
visible option 을 선택하는 header component
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, { PropTypes } from 'react'; | |
/** | |
* Define React Presentational Component Header | |
*/ | |
const Header = ({visible, setVisible}) => { | |
const getStyle = (type) => { | |
if (visible === type) { | |
return { | |
textDecoration: 'underline' | |
}; | |
} | |
return { | |
textDecoration: 'none' | |
}; | |
}; | |
return ( | |
<div> | |
<a onClick={() => setVisible('SHOW_ALL')} style={getStyle('SHOW_ALL')}>ALL</a> - | |
<a onClick={() => setVisible('SHOW_COMPLETED')} style={getStyle('SHOW_COMPLETED')}> COMPLETED</a> - | |
<a onClick={() => setVisible('SHOW_UNCOMPLETED')} style={getStyle('SHOW_UNCOMPLETED')}> UNCOMPLETED</a> | |
</div> | |
); | |
}; | |
export default Header; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment