Skip to content
Snippets Groups Projects
Commit 671c4489 authored by Tom Robinson's avatar Tom Robinson
Browse files

Fix ellipsis icon size. Allow icon 'attrs' to override default props

parent 041435e7
No related branches found
No related tags found
No related merge requests found
......@@ -18,21 +18,22 @@ export default class Icon extends Component {
]),
}
static defaultProps = {
width: 16,
height: 16
}
render() {
var icon = loadIcon(this.props.name);
const icon = loadIcon(this.props.name);
const defaultProps = {
width: 16,
height: 16
};
if (!icon) {
return <span className="hide" />;
} else if (icon.img) {
return (<RetinaImage forceOriginalDimensions={false} {...icon.attrs} {...this.props} src={icon.img} />);
return (<RetinaImage forceOriginalDimensions={false} {...defaultProps} {...icon.attrs} {...this.props} src={icon.img} />);
} else if (icon.svg) {
return (<svg {...icon.attrs} {...this.props} dangerouslySetInnerHTML={{__html: icon.svg}}></svg>);
return (<svg {...defaultProps} {...icon.attrs} {...this.props} dangerouslySetInnerHTML={{__html: icon.svg}}></svg>);
} else {
return (<svg {...icon.attrs} {...this.props}><path d={icon.path} /></svg>);
return (<svg {...defaultProps} {...icon.attrs} {...this.props}><path d={icon.path} /></svg>);
}
}
}
......@@ -47,7 +47,10 @@ export var ICON_PATHS = {
path: 'M4,8 L4,0 L7,0 L7,8 L10,8 L5.5,13.25 L1,8 L4,8 Z M11,14 L0,14 L0,17 L11,17 L11,14 Z',
attrs: { viewBox: '0 0 11 17' }
},
ellipsis: 'M26.1111111,19 C27.7066004,19 29,17.6568542 29,16 C29,14.3431458 27.7066004,13 26.1111111,13 C24.5156218,13 23.2222222,14.3431458 23.2222222,16 C23.2222222,17.6568542 24.5156218,19 26.1111111,19 Z M5.88888889,19 C7.48437817,19 8.77777778,17.6568542 8.77777778,16 C8.77777778,14.3431458 7.48437817,13 5.88888889,13 C4.29339961,13 3,14.3431458 3,16 C3,17.6568542 4.29339961,19 5.88888889,19 Z M16,19 C17.5954893,19 18.8888889,17.6568542 18.8888889,16 C18.8888889,14.3431458 17.5954893,13 16,13 C14.4045107,13 13.1111111,14.3431458 13.1111111,16 C13.1111111,17.6568542 14.4045107,19 16,19 Z',
ellipsis: {
path: 'M26.1111111,19 C27.7066004,19 29,17.6568542 29,16 C29,14.3431458 27.7066004,13 26.1111111,13 C24.5156218,13 23.2222222,14.3431458 23.2222222,16 C23.2222222,17.6568542 24.5156218,19 26.1111111,19 Z M5.88888889,19 C7.48437817,19 8.77777778,17.6568542 8.77777778,16 C8.77777778,14.3431458 7.48437817,13 5.88888889,13 C4.29339961,13 3,14.3431458 3,16 C3,17.6568542 4.29339961,19 5.88888889,19 Z M16,19 C17.5954893,19 18.8888889,17.6568542 18.8888889,16 C18.8888889,14.3431458 17.5954893,13 16,13 C14.4045107,13 13.1111111,14.3431458 13.1111111,16 C13.1111111,17.6568542 14.4045107,19 16,19 Z',
attrs: { width: 32, height: 32 }
},
emojiactivity: 'M4.58360576,27.9163942 C7.44354038,30.7763289 17.5452495,30.2077351 24.1264923,23.6264923 C30.7077351,17.0452495 31.2763289,6.94354038 28.4163942,4.08360576 C25.5564596,1.22367115 15.4547505,1.79226488 8.87350769,8.37350769 C2.29226488,14.9547505 1.72367115,25.0564596 4.58360576,27.9163942 Z M18.0478143,6.51491123 C17.0327353,6.95492647 16.0168474,7.462507 15.0611336,8.03487206 C13.9504884,8.70002358 12.9907793,9.41185633 12.2241295,10.1785061 C11.6753609,10.7272747 11.1524326,11.3411471 10.6544469,12.0086598 C9.95174829,12.950575 9.33131183,13.9528185 8.79588947,14.9547475 C8.47309082,15.5587964 8.24755055,16.0346972 8.12501633,16.3206104 L10.6033735,17.3827634 C10.6970997,17.1640688 10.8900635,16.7569059 11.1739957,16.2255873 C11.6497914,15.335237 12.2007659,14.4452012 12.8156543,13.6209891 C13.2395954,13.0527276 13.6791325,12.5367492 14.1307526,12.0851292 C14.7228522,11.4930296 15.5113715,10.9081712 16.4465129,10.3481268 C17.2918299,9.84187694 18.205618,9.38530978 19.1202149,8.98885142 C19.6674377,8.75164195 20.0881481,8.58915552 20.3167167,8.50897949 L19.4242138,5.96460106 C19.1382021,6.06492664 18.6583971,6.25023653 18.0478143,6.51491123 Z',
emojifood: 'M14.9166667,8.71296296 L14.9166667,4.85648148 L14.9636504,4.84865086 L18.8123012,1 L21.149682,3.33738075 L18.2222222,6.26484052 L18.2222222,8.71296296 L27.037037,8.71296296 L27.037037,10.9166667 L24.6968811,10.9166667 L22.2407407,30.75 L10.3148148,30.75 L7.36744639,10.9166667 L5,10.9166667 L5,8.71296296 L14.9166667,8.71296296 Z',
emojiflags: 'M14.4,17.8888889 L7.9,17.8888889 L7.9,28.9485494 C7.9,30.0201693 7.0344636,30.8888889 5.95,30.8888889 C4.87304474,30.8888889 4,30.0243018 4,28.9485494 L4,2.99442095 C4,2.44521742 4.44737959,2 5.00434691,2 L7.25,2 L19.1921631,2 C20.8138216,2 22.135741,3.27793211 22.1977269,4.88888889 L29.0004187,4.88888889 C29.5524722,4.88888889 30,5.33043204 30,5.88281005 L30,17.7705198 C30,19.4313825 28.6564509,20.7777778 26.9921631,20.7777778 L14.4,20.7777778 L14.4,17.8888889 Z',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment