import { useEffect, useState } from "react"; import Head from "next/head"; import Image from "next/image"; import { useRouter } from "next/router"; import { IconProp } from "@fortawesome/fontawesome-svg-core"; import { faSlack } from "@fortawesome/free-brands-svg-icons"; import { faCheckCircle, faHandPeace, faNetworkWired, faPlug, faPlus, faStar, faUserPlus } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import onboardingCheck from "@app/components/utilities/checks/OnboardingCheck"; import { TabsObject } from "@app/components/v2/Tabs"; import registerUserAction from "../api/userActions/registerUserAction"; type ItemProps = { text: string; subText: string; complete: boolean; icon: IconProp; time: string; userAction?: string; link?: string; }; const learningItem = ({ text, subText, complete, icon, time, userAction, link }: ItemProps): JSX.Element => { if (link) { return (
null} role="button" tabIndex={0} onClick={async () => { if (userAction && userAction !== "first_time_secrets_pushed") { await registerUserAction({ action: userAction }); } }} className="group relative mb-3 flex h-[5.5rem] w-full cursor-pointer items-center justify-between overflow-hidden rounded-md border border-mineshaft-600 bg-bunker-500 py-2 pl-2 pr-6 shadow-xl duration-200 hover:bg-mineshaft-700" >
{complete && (
)}
{text}
{subText}
{complete ? "Complete!" : `About ${time}`}
{complete &&
}
); } return (
null} role="button" tabIndex={0} onClick={async () => { if (userAction) { await registerUserAction({ action: userAction }); } }} className="relative my-1.5 flex h-[5.5rem] w-full cursor-pointer items-center justify-between overflow-hidden rounded-md border border-dashed border-bunker-400 bg-bunker-700 py-2 pl-2 pr-6 shadow-xl duration-200 hover:bg-bunker-500" >
{complete && (
)}
{text}
{subText}
{complete ? "Complete!" : `About ${time}`}
{complete &&
}
); }; /** * This tab is called Home because in the future it will include some company news, * updates, roadmap, relavant blogs, etc. Currently it only has the setup instruction * for the new users */ export default function Home() { const router = useRouter(); const [hasUserClickedSlack, setHasUserClickedSlack] = useState(false); const [hasUserClickedIntro, setHasUserClickedIntro] = useState(false); const [hasUserStarred, setHasUserStarred] = useState(false); const [hasUserPushedSecrets, setHasUserPushedSecrets] = useState(false); const [usersInOrg, setUsersInOrg] = useState(false); useEffect(() => { onboardingCheck({ setHasUserClickedIntro, setHasUserClickedSlack, setHasUserPushedSecrets, setHasUserStarred, setUsersInOrg }); }, []); return (
Infisical Guide
Your quick start guide
Click on the items below and follow the instructions.
start guise dragon illustration
{learningItem({ text: "Get to know Infisical", subText: "", complete: hasUserClickedIntro, icon: faHandPeace, time: "3 min", userAction: "intro_cta_clicked", link: "https://www.youtube.com/watch?v=3F7FNYX94zA" })} {learningItem({ text: "Add your secrets", subText: "Click to see example secrets, and add your own.", complete: hasUserPushedSecrets, icon: faPlus, time: "2 min", userAction: "first_time_secrets_pushed", link: `/dashboard/${router.query.id}` })}
{false && (
)}
Inject secrets locally
Replace .env files with a more secure and efficient alternative.
About 2 min
{false &&
}
{learningItem({ text: "Integrate Infisical with your infrastructure", subText: "Connect Infisical to various 3rd party services and platforms.", complete: false, icon: faPlug, time: "15 min", link: "https://infisical.com/docs/integrations/overview" })} {learningItem({ text: "Invite your teammates", subText: "", complete: usersInOrg, icon: faUserPlus, time: "2 min", link: `/settings/org/${router.query.id}?invite` })} {learningItem({ text: "Join Infisical Slack", subText: "Have any questions? Ask us!", complete: hasUserClickedSlack, icon: faSlack, time: "1 min", userAction: "slack_cta_clicked", link: "https://join.slack.com/t/infisical-users/shared_invite/zt-1wehzfnzn-1aMo5JcGENJiNAC2SD8Jlg" })} {learningItem({ text: "Star Infisical on GitHub", subText: "Like what we're doing? You know what to do! :)", complete: hasUserStarred, icon: faStar, time: "1 min", userAction: "star_cta_clicked", link: "https://github.com/Infisical/infisical" })}
); } Home.requireAuth = true;