Make cal.com version available on all pages, even on login page. (#6221)

* Make cal.com version available on all pages, even on login page.

* Extract out calcom version as a utility

* added version to login screen

* added ee and ce to version

* fixed lint

* Fix import

* removed  version info component

Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>
This commit is contained in:
authored and GitHub committed 2023-01-02 20:24:35 +05:30
1 parent fe14839f1b
commit 33530ad8c8
5 files changed
+27 -24

No files matched your search

+8 -2
View File
@@ -1,7 +1,7 @@
import classNames from "classnames";
import React from "react";
import { APP_NAME, LOGO } from "@calcom/lib/constants";
import { APP_NAME, LOGO, COMPANY_NAME, CalComVersion } from "@calcom/lib/constants";
import Loader from "@components/Loader";
import { HeadSeo } from "@components/seo/head-seo";
@@ -23,6 +23,7 @@ export default function AuthContainer(props: React.PropsWithChildren<Props>) {
// eslint-disable-next-line @next/next/no-img-element
<img className="mb-auto h-4" src={LOGO} alt={`${APP_NAME} Logo`} />
)}
<div className={classNames(props.showLogo ? "text-center" : "", "sm:mx-auto sm:w-full sm:max-w-md")}>
{props.heading && <h2 className="font-cal text-center text-3xl text-neutral-900">{props.heading}</h2>}
</div>
@@ -35,7 +36,12 @@ export default function AuthContainer(props: React.PropsWithChildren<Props>) {
<div className="border-1 mx-2 rounded-md border-gray-200 bg-white px-4 py-10 sm:px-10">
{props.children}
</div>
<div className="mt-8 text-center text-sm text-neutral-600">{props.footerText}</div>
<div className="mt-8 text-center text-sm text-neutral-600">
{props.footerText}
<small className="mx-3 mt-1 mb-2 hidden text-[0.5rem] opacity-50 lg:block">
&copy; {new Date().getFullYear()} {COMPANY_NAME} {CalComVersion}
</small>
</div>
</div>
</div>
);
+5 -1
View File
@@ -5,6 +5,7 @@ import superjson from "superjson";
import "@calcom/embed-core/src/embed-iframe";
import LicenseRequired from "@calcom/features/ee/common/components/LicenseRequired";
import { CalComVersion } from "@calcom/lib/constants";
import { httpBatchLink } from "@calcom/trpc/client/links/httpBatchLink";
import { httpLink } from "@calcom/trpc/client/links/httpLink";
import { loggerLink } from "@calcom/trpc/client/links/loggerLink";
@@ -32,7 +33,6 @@ function MyApp(props: AppProps) {
}
// Use the layout defined at the page level, if available
const getLayout = Component.getLayout ?? ((page) => page);
return (
<AppProviders {...props}>
<DefaultSeo {...seoConfig.defaultNextSeo} />
@@ -44,6 +44,10 @@ function MyApp(props: AppProps) {
<Head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
</Head>
<Script
id="calcom-version"
dangerouslySetInnerHTML={{ __html: `window.CalComVersion = '${CalComVersion}'` }}
/>
{getLayout(
Component.requiresLicense ? (
<LicenseRequired>