lbry-desktop/web/component/nag-sunset.jsx

39 lines
1,005 B
React
Raw Permalink Normal View History

2021-08-05 18:24:43 +02:00
// @flow
import React from 'react';
import Nag from 'component/common/nag';
import I18nMessage from 'component/i18nMessage';
import * as PAGES from 'constants/pages';
import { useHistory } from 'react-router';
2021-08-06 19:28:58 +02:00
import Button from '../../ui/component/button';
2021-08-05 18:24:43 +02:00
type Props = {
email?: User,
onClose: () => void,
};
export default function NagSunset(props: Props) {
const { email, onClose } = props;
const { push } = useHistory();
const handleOnClick = () => {
onClose();
push(`/$/${PAGES.AUTH_SIGNIN}`);
};
return (
<Nag
type="helpful"
2021-08-06 19:28:58 +02:00
message={
<I18nMessage
tokens={{
more: <Button button={'link'} label={__('more')} href="https://odysee.com/@lbry:3f/retirement" />,
}}
>
lbry.tv has been retired (%more%). You have been magically transported to Odysee.com
</I18nMessage>
}
2021-08-05 18:24:43 +02:00
actionText={__('Sign In')}
onClick={!email ? handleOnClick : undefined}
onClose={onClose}
/>
);
}