mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
feat: add demo account button on onboarding
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import React from 'react';
|
||||
import { Redirect } from 'react-router-dom';
|
||||
import { Config } from '@/config';
|
||||
|
||||
interface EnsureOneClickDemoAccountEnabledProps {
|
||||
children: React.ReactNode;
|
||||
redirectTo?: string;
|
||||
}
|
||||
|
||||
export const EnsureOneClickDemoAccountEnabled = ({
|
||||
children,
|
||||
redirectTo = '/',
|
||||
}: EnsureOneClickDemoAccountEnabledProps) => {
|
||||
const enabeld = Config.oneClickDemo.enable || false;
|
||||
|
||||
if (!enabeld) {
|
||||
return <Redirect to={{ pathname: redirectTo }} />;
|
||||
}
|
||||
return <>{children}</>;
|
||||
};
|
||||
@@ -18,10 +18,10 @@ export default function OneClickDemoPage() {
|
||||
mutateAsync: oneClickDemoSignIn,
|
||||
isLoading: isOneclickDemoSigningIn,
|
||||
} = useOneClickDemoSignin();
|
||||
const [buildJobId, setBuildJobId] = useState<string>('');
|
||||
|
||||
// Job states.
|
||||
const [demoId, setDemoId] = useState<string>('');
|
||||
const [buildJobId, setBuildJobId] = useState<string>('');
|
||||
const [isJobDone, setIsJobDone] = useState<boolean>(false);
|
||||
|
||||
const {
|
||||
|
||||
Reference in New Issue
Block a user