lbry-desktop/ui/component/fileHideRecommendation/view.jsx
infinite-persistence 972429b391 FYP: allow mobile to reject + change phrasing
- This allows mobile to reject recommendations.
- Also changed from "I dislike this" to "Not interested". Less negative?
2022-03-15 20:57:28 -07:00

37 lines
911 B
JavaScript

// @flow
import React from 'react';
import Button from 'component/button';
import * as ICONS from 'constants/icons';
type Props = {
uri: string,
buttonType: ?string,
showLabel: ?boolean,
focusable: boolean,
// --- redux ---
doRemovePersonalRecommendation: (uri: string) => void,
};
export default function FileHideRecommendation(props: Props) {
const { uri, buttonType, showLabel = false, focusable = true, doRemovePersonalRecommendation } = props;
function handleClick(e) {
doRemovePersonalRecommendation(uri);
e.preventDefault();
}
const label = __('Not interested');
return (
<Button
button={buttonType}
className={buttonType ? undefined : 'button--file-action'}
title={label}
icon={ICONS.REMOVE}
label={showLabel ? label : null}
onClick={handleClick}
aria-hidden={!focusable}
tabIndex={focusable ? 0 : -1}
/>
);
}