mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-08-19 14:35:53 +00:00
NavTabButton checks for logo/icon changed
This commit is contained in:
parent
3853b5178e
commit
ea8e8153b7
1 changed files with 16 additions and 11 deletions
|
|
@ -9,20 +9,25 @@ const styles = require('./styles');
|
|||
const NavTabButton = ({ className, logo, icon, label, href, selected, onClick }) => {
|
||||
const renderLogoFallback = React.useMemo(() => () => {
|
||||
return (
|
||||
typeof icon === 'string' && icon.length > 0 ?
|
||||
<Icon className={styles['icon']} icon={icon} />
|
||||
:
|
||||
null
|
||||
<Icon className={styles['icon']} icon={'ic_addons'} />
|
||||
);
|
||||
}, [icon]);
|
||||
}, []);
|
||||
return (
|
||||
<Button className={classnames(className, styles['nav-tab-button-container'], { 'selected': selected })} title={label} tabIndex={-1} href={href} onClick={onClick}>
|
||||
<Image
|
||||
className={styles['logo']}
|
||||
src={logo}
|
||||
alt={' '}
|
||||
renderFallback={renderLogoFallback}
|
||||
/>
|
||||
{
|
||||
typeof logo === 'string' && logo.length > 0 ?
|
||||
<Image
|
||||
className={styles['logo']}
|
||||
src={logo}
|
||||
alt={' '}
|
||||
renderFallback={renderLogoFallback}
|
||||
/>
|
||||
:
|
||||
typeof icon === 'string' && icon.length > 0 ?
|
||||
<Icon className={styles['icon']} icon={icon} />
|
||||
:
|
||||
null
|
||||
}
|
||||
{
|
||||
typeof label === 'string' && label.length > 0 ?
|
||||
<div className={styles['label']}>{label}</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue