2023-12-01 10:20:01 +00:00
|
|
|
import React, { useState } from "react";
|
2023-11-29 15:03:08 +00:00
|
|
|
import Image from "next/image";
|
2023-12-01 10:20:01 +00:00
|
|
|
import { useTheme } from "next-themes";
|
2023-11-29 15:03:08 +00:00
|
|
|
// ui
|
|
|
|
import { Button } from "@plane/ui";
|
|
|
|
import { UserCog2 } from "lucide-react";
|
2023-12-01 10:20:01 +00:00
|
|
|
// images
|
2023-11-29 15:03:08 +00:00
|
|
|
import instanceSetupDone from "public/instance-setup-done.svg";
|
2023-12-01 10:20:01 +00:00
|
|
|
import PlaneBlackLogo from "public/plane-logos/black-horizontal-with-blue-logo.svg";
|
|
|
|
import PlaneWhiteLogo from "public/plane-logos/white-horizontal-with-blue-logo.svg";
|
|
|
|
import { useMobxStore } from "lib/mobx/store-provider";
|
2023-11-29 15:03:08 +00:00
|
|
|
|
2023-12-01 10:20:01 +00:00
|
|
|
export const InstanceSetupDone = () => {
|
|
|
|
// states
|
|
|
|
const [isRedirecting, setIsRedirecting] = useState(false);
|
|
|
|
// next-themes
|
|
|
|
const { resolvedTheme } = useTheme();
|
|
|
|
// mobx store
|
|
|
|
const {
|
|
|
|
instance: { fetchInstanceInfo },
|
|
|
|
} = useMobxStore();
|
2023-11-29 15:03:08 +00:00
|
|
|
|
2023-12-01 10:20:01 +00:00
|
|
|
const planeLogo = resolvedTheme === "dark" ? PlaneWhiteLogo : PlaneBlackLogo;
|
|
|
|
|
|
|
|
const redirectToGodMode = async () => {
|
|
|
|
setIsRedirecting(true);
|
2023-11-29 15:03:08 +00:00
|
|
|
|
2023-12-01 10:20:01 +00:00
|
|
|
await fetchInstanceInfo().finally(() => setIsRedirecting(false));
|
|
|
|
};
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="h-full w-full overflow-hidden">
|
2023-12-10 10:18:10 +00:00
|
|
|
<div className="h-full w-full overflow-hidden bg-onboarding-gradient-100 pt-12">
|
|
|
|
<div className="mx-auto h-full overflow-hidden rounded-t-md border-x border-t border-custom-border-200 bg-onboarding-gradient-100 px-4 pt-4 shadow-sm sm:w-4/5 md:w-2/3">
|
|
|
|
<div className="relative flex h-full flex-col items-center overflow-y-auto rounded-t-md bg-onboarding-gradient-200 px-7 pb-8 sm:px-0">
|
|
|
|
<div className="flex justify-center py-10">
|
2023-12-01 10:20:01 +00:00
|
|
|
<div className="h-[30px]">
|
|
|
|
<Image src={planeLogo} className="h-full w-full" alt="Plane logo" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2023-12-10 10:18:10 +00:00
|
|
|
<div className="my-8 grid place-items-center">
|
2023-12-01 10:20:01 +00:00
|
|
|
<div className="w-[444px]">
|
|
|
|
<Image src={instanceSetupDone} className="h-full w-full" alt="image" />
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-11-29 15:03:08 +00:00
|
|
|
|
2023-12-10 10:18:10 +00:00
|
|
|
<div className="flex w-full flex-col items-center gap-8 sm:px-4">
|
|
|
|
<div className="space-y-3 rounded border border-purple-500 bg-purple-500/20 px-3 py-2.5 text-center">
|
2023-12-01 10:20:01 +00:00
|
|
|
<h6 className="text-base font-semibold">
|
|
|
|
Your instance is now ready for more security, more controls, and more intelligence.
|
|
|
|
</h6>
|
|
|
|
<p className="text-xs font-medium">
|
|
|
|
Use this wisely. Remember, with great power comes great responsibility.
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<Button size="lg" prependIcon={<UserCog2 />} onClick={redirectToGodMode} loading={isRedirecting}>
|
2023-12-06 08:52:59 +00:00
|
|
|
Go to God Mode
|
2023-12-01 10:20:01 +00:00
|
|
|
</Button>
|
2023-11-29 15:03:08 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-12-01 10:20:01 +00:00
|
|
|
);
|
|
|
|
};
|