/** * Copyright 2022 Design Barn Inc. */ import { Appearance, Loading, Size, TextColor } from '@lottiefiles/react-ui-kit'; import { useContext, useState } from '@wordpress/element'; import clsx from 'clsx'; import * as React from 'react'; import * as semver from 'semver'; import { useQuery } from 'urql'; import packageJson from '../../../../../package.json'; import { Button } from '../../../../_components'; import { IUserDataProps } from '../../../../admin/settings/reducer'; import { Illustration, UpdateIcon } from '../../../../assets/Icons'; import { LoadingAnimation } from '../../../../components/LoadingAnimation'; import { LoginAuto } from '../../../../components/login-auto'; import { LottieContext } from '../../../../context/lottie-provider'; import { URLS } from '../../../../helpers/consts'; import { queries } from '../../../../helpers/query-strings'; export const OnBoarding: React.FC = () => { const [isSubmitting, setIsSubmitting] = useState(false); const { onLogin } = useContext(LottieContext); const onSuccess = async (data: IUserDataProps): Promise => { await onLogin({ shareUserData: false, enableCdn: false, copyLottieToMedia: false, switchAccount: false, userData: data, }); }; const [{ data, fetching }] = useQuery({ query: queries.softwareUpdates, variables: { version: packageJson.version }, }); // React.useEffect(() => { // if (semver.lt(packageJson.version, data.softwareUpdates.version)) { // console.log('') // } // }, []); if (!fetching) { if (data && data.softwareUpdates) { if (semver.lt(packageJson.version, data.softwareUpdates.version)) { return (
<>

Update your plugin to continue

The plugin version you’ve installed is no longer supported. Please update your plugin to the latest version.

Copyright © 2022 Design Barn Inc.

); } } return (
{!isSubmitting && ( <>

Bring your web pages to life with Lottie animations

Log in with your LottieFiles account to access the world’s largest collection of free-to-use animations on your website.
)} {isSubmitting && } { setIsSubmitting(true); }} isBrowserLogin onSuccess={onSuccess} onError={(): void => { /** */ }} /> {!isSubmitting && ( <>

Don’t have an account yet?

Get started for free )}

Copyright © 2022 Design Barn Inc.

); } return ; };