]>
cat aescling's git repositories - mastodon.git/blob - app/javascript/flavours/glitch/features/local_settings/navigation/item/index.js
2 import React
from 'react';
3 import PropTypes
from 'prop-types';
4 import classNames
from 'classnames';
6 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
8 export default class LocalSettingsPage
extends React
.PureComponent
{
11 active: PropTypes
.bool
,
12 className: PropTypes
.string
,
13 href: PropTypes
.string
,
14 icon: PropTypes
.string
,
15 textIcon: PropTypes
.string
,
16 index: PropTypes
.number
.isRequired
,
17 onNavigate: PropTypes
.func
,
18 title: PropTypes
.string
,
21 handleClick
= (e
) => {
22 const { index
, onNavigate
} = this.props
;
30 const { handleClick
} = this;
41 const finalClassName
= classNames('glitch', 'local-settings__navigation__item', {
45 const iconElem
= icon
? <i className
={`fa fa-fw fa-${icon}`} /> : (textIcon
? <span className
='text-icon-button'>{textIcon
}</span
> : null);
50 className
={finalClassName
}
52 {iconElem
} <span
>{title
}</span
>
55 else if (onNavigate
) return (
60 className
={finalClassName
}
62 {iconElem
} <span
>{title
}</span
>
This page took 0.101773 seconds and 6 git commands to generate.