Some checks failed
Branch Build CE / Build Setup (push) Has been cancelled
Branch Build CE / Build-Push Admin Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Web Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Space Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Live Collaboration Docker Image (push) Has been cancelled
Branch Build CE / Build-Push API Server Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Proxy Docker Image (push) Has been cancelled
Branch Build CE / Build-Push AIO Docker Image (push) Has been cancelled
Branch Build CE / Upload Build Assets (push) Has been cancelled
Branch Build CE / Build Release (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Codespell / Check for spelling errors (push) Has been cancelled
Sync Repositories / sync_changes (push) Has been cancelled
Synced from upstream: 8853637e981ed7d8a6cff32bd98e7afe20f54362
45 lines
1.4 KiB
TypeScript
45 lines
1.4 KiB
TypeScript
"use client";
|
|
|
|
import Image from "next/image";
|
|
import { useTheme } from "next-themes";
|
|
// plane imports
|
|
import { HEADER_GITHUB_ICON, GITHUB_REDIRECTED_TRACKER_EVENT } from "@plane/constants";
|
|
import { useTranslation } from "@plane/i18n";
|
|
// assets
|
|
import githubBlackImage from "@/app/assets/logos/github-black.png?url";
|
|
import githubWhiteImage from "@/app/assets/logos/github-white.png?url";
|
|
// helpers
|
|
import { captureElementAndEvent } from "@/helpers/event-tracker.helper";
|
|
|
|
export const StarUsOnGitHubLink = () => {
|
|
// plane hooks
|
|
const { t } = useTranslation();
|
|
// hooks
|
|
const { resolvedTheme } = useTheme();
|
|
const imageSrc = resolvedTheme === "dark" ? githubWhiteImage : githubBlackImage;
|
|
|
|
return (
|
|
<a
|
|
aria-label={t("home.star_us_on_github")}
|
|
onClick={() =>
|
|
captureElementAndEvent({
|
|
element: {
|
|
elementName: HEADER_GITHUB_ICON,
|
|
},
|
|
event: {
|
|
eventName: GITHUB_REDIRECTED_TRACKER_EVENT,
|
|
state: "SUCCESS",
|
|
},
|
|
})
|
|
}
|
|
className="flex flex-shrink-0 items-center gap-1.5 rounded bg-custom-background-80 px-3 py-1.5"
|
|
href="https://github.com/makeplane/plane"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
>
|
|
<Image src={imageSrc} height={16} width={16} alt="GitHub Logo" aria-hidden="true" />
|
|
<span className="hidden text-xs font-medium sm:hidden md:block">{t("home.star_us_on_github")}</span>
|
|
</a>
|
|
);
|
|
};
|