Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

feat: add download button #209

Merged
merged 2 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
15 changes: 5 additions & 10 deletions src/components/DropdownDownload/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,19 @@ type GpuInfo = {

const systemsTemplate: SystemType[] = [
{
name: "Download for Mac (Apple Silicon)",
name: "Download for Mac",
logo: FaApple,
fileFormat: "{appname}-installer-{tag}-arm64-mac.tar.gz",
},
{
name: "Download for Mac (Intel)",
logo: FaApple,
fileFormat: "{appname}-installer-{tag}-amd64-mac.tar.gz",
fileFormat: "{appname}-{tag}-mac-universal-local-installer.pkg",
},
{
name: "Download for Windows",
logo: FaWindows,
fileFormat: "{appname}-installer-{tag}-amd64-windows.tar.gz",
fileFormat: "{appname}-{tag}-windows-amd64-local-installer.exe",
},
{
name: "Download for Linux",
logo: FaLinux,
fileFormat: "{appname}-installer-{tag}-amd64-linux.deb",
fileFormat: "{appname}-{tag}-linux-amd64-local-installer.deb",
},
];

Expand Down Expand Up @@ -214,7 +209,7 @@ const DropdownDownload = ({ lastRelease }: Props) => {
</div>
{open && (
<div
className="absolute left-0 top-[72px] w-full border-2 border-black bg-white dark:bg-black z-30 rounded-xl lg:w-[340px]"
className="absolute left-0 top-[72px] w-full border-2 border-black bg-white dark:bg-black z-30 rounded-xl lg:w-[280px]"
ref={setRefDropdownContent}
>
{systems.map((system) => (
Expand Down
13 changes: 5 additions & 8 deletions src/containers/Homepage/SimpleHeroSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ import { Button } from "@site/src/components/Button";
import Link from "@docusaurus/Link";

import Announcement from "@site/src/components/Announcement";

import { FaGithub } from "react-icons/fa";
import DropdownDownload from "@site/src/components/DropdownDownload";
import { usePluginData } from "@docusaurus/useGlobalData";

const SimpleHeroSection = () => {
const latestRelease = usePluginData("latest-release");
return (
<div className="container">
<div className="text-center mb-10">
Expand All @@ -23,14 +27,7 @@ const SimpleHeroSection = () => {
</p>

<div className="mt-8 flex gap-8 justify-center items-center">
<Link href="https://github.com/janhq/cortex" target="_blank">
<Button>
<div className="flex items-center">
<FaGithub className="mr-2" size={24} />
<span className="mb-0">Github</span>
</div>
</Button>
</Link>
<DropdownDownload lastRelease={latestRelease} />
<Link href="/docs/quickstart" target="_blank">
<Button theme="secondary">Documentation</Button>
</Link>
Expand Down
Loading