Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions packages/ui/components/icon/IconSprites.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
import process from "node:process";
import type { JSX } from "react";

import SVG from "react-inlinesvg";

// eslint-disable-next-line turbo/no-undeclared-env-vars
const vercelCommitHash = process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA;
const commitHash = vercelCommitHash ? `-${vercelCommitHash.slice(0, 7)}` : "";
const vercelCommitHash: string | undefined = process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA;

function getCommitHash(): string {
if (vercelCommitHash) {
return `-${vercelCommitHash.slice(0, 7)}`;
}
return "";
}

const commitHash: string = getCommitHash();

export function IconSprites() {
export function IconSprites(): JSX.Element {
return (
<SVG
src={`${process.env.NEXT_PUBLIC_WEBAPP_URL}/icons/sprite.svg?v=${process.env.NEXT_PUBLIC_CALCOM_VERSION}-${commitHash}`}
src={`/icons/sprite.svg?v=${process.env.NEXT_PUBLIC_CALCOM_VERSION}${commitHash}`}
/>
);
}
Expand Down