Revert "feat: add styled tooltips to trailer and rating actions"

This reverts commit 204d9afc8f.
This commit is contained in:
FrigoDev 2026-04-24 16:55:39 -05:00
parent 204d9afc8f
commit fc7dc45a54
3 changed files with 5 additions and 11 deletions

View file

@ -8,9 +8,9 @@ const { Button } = require('stremio/components');
const styles = require('./styles');
const { Tooltip } = require('stremio/common/Tooltips');
const ActionButton = ({ className, icon, label, tooltip, showLabel, ...props }) => {
const ActionButton = ({ className, icon, label, tooltip, ...props }) => {
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 label={label} position={'top'} />
@ -26,7 +26,7 @@ const ActionButton = ({ className, icon, label, tooltip, showLabel, ...props })
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']}>{label}</div>
</div>
@ -41,8 +41,7 @@ ActionButton.propTypes = {
className: PropTypes.string,
icon: PropTypes.string,
label: PropTypes.string,
tooltip: PropTypes.bool,
showLabel: PropTypes.bool
tooltip: PropTypes.bool
};
module.exports = ActionButton;

View file

@ -216,8 +216,7 @@ const MetaPreview = React.forwardRef(({ className, compact, name, logo, backgrou
label={t('TRAILER')}
tabIndex={compact ? -1 : 0}
href={trailerHref}
tooltip={true}
showLabel={true}
tooltip={compact}
/>
:
null

View file

@ -1,7 +1,6 @@
// Copyright (C) 2017-2025 Smart code 203358507
import React, { useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import useRating from './useRating';
import { ActionsGroup } from 'stremio/components';
@ -12,20 +11,17 @@ type Props = {
};
const Ratings = ({ ratingInfo, className }: Props) => {
const { t } = useTranslation();
const { onLiked, onLoved, liked, loved } = useRating(ratingInfo);
const disabled = useMemo(() => ratingInfo?.type !== 'Ready', [ratingInfo]);
const items = useMemo(() => [
{
icon: liked ? 'thumbs-up' : 'thumbs-up-outline',
label: liked ? t('RATING_UNLIKE') : t('RATING_LIKE'),
disabled,
onClick: onLiked,
},
{
icon: loved ? 'heart' : 'heart-outline',
label: loved ? t('RATING_UNLOVE') : t('RATING_LOVE'),
disabled,
onClick: onLoved,
},