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

39 lines
1,010 B
React
Raw 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={__('Learn more')} href="https://odysee.com/@lbry:3f/retirement" />,
2021-08-06 19:28:58 +02:00
}}
>
lbry.tv has been retired. You have been magically transported to Odysee.com. %more%
2021-08-06 19:28:58 +02:00
</I18nMessage>
}
2021-08-05 18:24:43 +02:00
actionText={__('Sign In')}
onClick={!email ? handleOnClick : undefined}
onClose={onClose}
/>
);
}