lbry-desktop/ui/component/nagContinueFirstRun/view.jsx

39 lines
893 B
React
Raw Permalink Normal View History

// @flow
import * as PAGES from 'constants/pages';
import React from 'react';
import Nag from 'component/common/nag';
import { useHistory } from 'react-router';
type Props = {
followingAcknowledged: boolean,
firstRunStarted: boolean,
setClientSetting: (string, boolean) => void,
syncSetttings: () => void,
};
export default function NagContinueFirstRun(props: Props) {
2020-09-04 19:14:48 +02:00
const { firstRunStarted, followingAcknowledged } = props;
const {
location: { pathname },
push,
} = useHistory();
const isOnFirstRun = pathname.includes(PAGES.AUTH);
function handleContinue() {
push(`/$/${PAGES.AUTH}`);
}
if (isOnFirstRun || !firstRunStarted || followingAcknowledged) {
return null;
}
return (
<Nag
type="helpful"
2020-09-04 19:14:48 +02:00
message={__('Continue setting up your account.')}
actionText={__('Finish Up')}
onClick={handleContinue}
/>
);
}