Icon component

This commit is contained in:
Max Lynch
2020-12-22 17:27:45 -06:00
parent 5e2bd30d72
commit 91ca416c9f
12 changed files with 132 additions and 34 deletions
+18 -7
View File
@@ -1,13 +1,24 @@
import classNames from 'classnames';
import Icon from './Icon';
const Tab = ({ title, icon, selected, selectedIcon, onClick }) => (
<a onClick={onClick} href="#" className={classNames('px-6 rounded-md text-sm text-center font-medium cursor-pointer', {
'text-gray-500': !selected,
'text-gray-800': selected
})}>
{icon && <ion-icon name={selected ? selectedIcon : icon } className="cursor-pointer" style={{ fontSize: '18px' }}/>}
<a
onClick={onClick}
href="#"
className={classNames('px-6 rounded-md text-sm text-center font-medium cursor-pointer', {
'text-gray-500': !selected,
'text-gray-800': selected,
})}
>
{icon && (
<Icon
icon={selected ? selectedIcon : icon}
className="cursor-pointer"
style={{ fontSize: '18px' }}
/>
)}
<label className="block cursor-pointer">{title}</label>
</a>
)
);
export default Tab;
export default Tab;