mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00: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}</>;
|
||||
};
|
||||
Reference in New Issue
Block a user