mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-05-13 10:11:35 +00:00
Revert "feat: add styled tooltips to trailer and rating actions"
This reverts commit 204d9afc8f.
This commit is contained in:
parent
204d9afc8f
commit
fc7dc45a54
3 changed files with 5 additions and 11 deletions
|
|
@ -8,9 +8,9 @@ const { Button } = require('stremio/components');
|
||||||
const styles = require('./styles');
|
const styles = require('./styles');
|
||||||
const { Tooltip } = require('stremio/common/Tooltips');
|
const { Tooltip } = require('stremio/common/Tooltips');
|
||||||
|
|
||||||
const ActionButton = ({ className, icon, label, tooltip, showLabel, ...props }) => {
|
const ActionButton = ({ className, icon, label, tooltip, ...props }) => {
|
||||||
return (
|
return (
|
||||||
<Button title={tooltip ? undefined : label} {...props} className={classnames(className, styles['action-button-container'], { 'wide': typeof label === 'string' && (!tooltip || showLabel) })}>
|
<Button title={tooltip ? '' : label} {...props} className={classnames(className, styles['action-button-container'], { 'wide': typeof label === 'string' && !tooltip })}>
|
||||||
{
|
{
|
||||||
tooltip === true ?
|
tooltip === true ?
|
||||||
<Tooltip label={label} position={'top'} />
|
<Tooltip label={label} position={'top'} />
|
||||||
|
|
@ -26,7 +26,7 @@ const ActionButton = ({ className, icon, label, tooltip, showLabel, ...props })
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
(!tooltip || showLabel) && typeof label === 'string' && label.length > 0 ?
|
!tooltip && typeof label === 'string' && label.length > 0 ?
|
||||||
<div className={styles['label-container']}>
|
<div className={styles['label-container']}>
|
||||||
<div className={styles['label']}>{label}</div>
|
<div className={styles['label']}>{label}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -41,8 +41,7 @@ ActionButton.propTypes = {
|
||||||
className: PropTypes.string,
|
className: PropTypes.string,
|
||||||
icon: PropTypes.string,
|
icon: PropTypes.string,
|
||||||
label: PropTypes.string,
|
label: PropTypes.string,
|
||||||
tooltip: PropTypes.bool,
|
tooltip: PropTypes.bool
|
||||||
showLabel: PropTypes.bool
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = ActionButton;
|
module.exports = ActionButton;
|
||||||
|
|
|
||||||
|
|
@ -216,8 +216,7 @@ const MetaPreview = React.forwardRef(({ className, compact, name, logo, backgrou
|
||||||
label={t('TRAILER')}
|
label={t('TRAILER')}
|
||||||
tabIndex={compact ? -1 : 0}
|
tabIndex={compact ? -1 : 0}
|
||||||
href={trailerHref}
|
href={trailerHref}
|
||||||
tooltip={true}
|
tooltip={compact}
|
||||||
showLabel={true}
|
|
||||||
/>
|
/>
|
||||||
:
|
:
|
||||||
null
|
null
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
// Copyright (C) 2017-2025 Smart code 203358507
|
// Copyright (C) 2017-2025 Smart code 203358507
|
||||||
|
|
||||||
import React, { useMemo } from 'react';
|
import React, { useMemo } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
|
||||||
import useRating from './useRating';
|
import useRating from './useRating';
|
||||||
import { ActionsGroup } from 'stremio/components';
|
import { ActionsGroup } from 'stremio/components';
|
||||||
|
|
||||||
|
|
@ -12,20 +11,17 @@ type Props = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const Ratings = ({ ratingInfo, className }: Props) => {
|
const Ratings = ({ ratingInfo, className }: Props) => {
|
||||||
const { t } = useTranslation();
|
|
||||||
const { onLiked, onLoved, liked, loved } = useRating(ratingInfo);
|
const { onLiked, onLoved, liked, loved } = useRating(ratingInfo);
|
||||||
const disabled = useMemo(() => ratingInfo?.type !== 'Ready', [ratingInfo]);
|
const disabled = useMemo(() => ratingInfo?.type !== 'Ready', [ratingInfo]);
|
||||||
|
|
||||||
const items = useMemo(() => [
|
const items = useMemo(() => [
|
||||||
{
|
{
|
||||||
icon: liked ? 'thumbs-up' : 'thumbs-up-outline',
|
icon: liked ? 'thumbs-up' : 'thumbs-up-outline',
|
||||||
label: liked ? t('RATING_UNLIKE') : t('RATING_LIKE'),
|
|
||||||
disabled,
|
disabled,
|
||||||
onClick: onLiked,
|
onClick: onLiked,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: loved ? 'heart' : 'heart-outline',
|
icon: loved ? 'heart' : 'heart-outline',
|
||||||
label: loved ? t('RATING_UNLOVE') : t('RATING_LOVE'),
|
|
||||||
disabled,
|
disabled,
|
||||||
onClick: onLoved,
|
onClick: onLoved,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue