Ádding Icon to Coral UI Button

This commit is contained in:
Belen Curcio
2017-01-12 18:20:42 -03:00
parent 87b350e3a9
commit ce01389809
2 changed files with 20 additions and 13 deletions
@@ -7,7 +7,7 @@ import {
updateWordlist,
} from '../../actions/settings';
import {Button, Icon, List, Item} from 'coral-ui';
import {Button, List, Item} from 'coral-ui';
import styles from './Configure.css';
import I18n from 'coral-framework/modules/i18n/i18n';
import translations from '../../translations.json';
@@ -118,17 +118,22 @@ class Configure extends Component {
</List>
{
showSave ?
<Button
raised
onClick={this.saveSettings}
className={styles.changedSave}>
<Icon name='check' /> {lang.t('configure.save-changes')}
</Button>
: <Button
raised
disabled>
{lang.t('configure.save-changes')}
</Button>
<Button
raised
onClick={this.saveSettings}
className={styles.changedSave}
icon='check'
>
{lang.t('configure.save-changes')}
</Button>
:
<Button
raised
disabled
icon='check'
>
{lang.t('configure.save-changes')}
</Button>
}
</div>
+3 -1
View File
@@ -1,7 +1,8 @@
import React from 'react';
import styles from './Button.css';
import Icon from './Icon';
const Button = ({cStyle = 'local', children, className, raised = false, full = false, ...props}) => (
const Button = ({cStyle = 'local', children, className, raised = false, full = false, icon = '', ...props}) => (
<button
className={`
${styles.button}
@@ -12,6 +13,7 @@ const Button = ({cStyle = 'local', children, className, raised = false, full = f
`}
{...props}
>
{icon && <Icon name={icon} />}
{children}
</button>
);