mirror of
https://github.com/Hackdex-App/hackdex-website.git
synced 2026-08-25 01:54:20 -05:00
Update some links to version manager
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { notFound, redirect } from "next/navigation";
|
||||
import HackForm from "@/components/Hack/HackForm";
|
||||
import { createClient } from "@/utils/supabase/server";
|
||||
import { FaChevronLeft, FaChevronRight } from "react-icons/fa6";
|
||||
import { FaChevronLeft, FaChevronRight, FaPlus } from "react-icons/fa6";
|
||||
import Link from "next/link";
|
||||
import { sortOrderedTags, getCoverUrls } from "@/utils/format";
|
||||
import { checkEditPermission } from "@/utils/hack";
|
||||
@@ -90,16 +90,26 @@ export default async function EditHackPage({ params }: EditPageProps) {
|
||||
<FaChevronRight size={22} className="inline-block mx-2 text-foreground/50 align-middle" />
|
||||
<span className="gradient-text font-bold">{hack.title}</span>
|
||||
</h1>
|
||||
<div className="flex items-center gap-2 self-end lg:self-auto mt-8 lg:mt-0">
|
||||
<Link href={`/hack/${slug}`} className="inline-flex items-center justify-center rounded-md border border-[var(--border)] bg-[var(--surface-2)] px-3 py-2 text-sm font-medium hover:bg-black/5 dark:hover:bg-white/10">
|
||||
<div className="flex items-center gap-2 md:flex-row flex-col md:self-end lg:self-auto mt-8 lg:mt-0">
|
||||
<Link href={`/hack/${slug}`} className="inline-flex items-center justify-center h-12 md:h-10 w-full md:w-auto rounded-md border border-[var(--border)] bg-[var(--surface-2)] px-3 py-2 text-sm font-medium hover:bg-black/5 dark:hover:bg-white/10">
|
||||
<FaChevronLeft size={16} className="inline-block mr-1" />
|
||||
Back to hack
|
||||
</Link>
|
||||
{!isArchive && (
|
||||
<Link href={`/hack/${slug}/edit/patch`} className="inline-flex items-center justify-center rounded-md border border-[var(--border)] bg-[var(--surface-2)] px-3 py-2 text-sm font-medium hover:bg-black/5 dark:hover:bg-white/10">
|
||||
Upload new version
|
||||
{!isArchive && <>
|
||||
<Link
|
||||
href={`/hack/${slug}/versions`}
|
||||
className="inline-flex items-center justify-center h-12 md:h-10 w-full md:w-auto px-4 text-sm font-medium rounded-md border border-[var(--border)] bg-[var(--surface-2)] hover:bg-[var(--surface-3)] transition-colors"
|
||||
>
|
||||
Manage Versions
|
||||
</Link>
|
||||
)}
|
||||
<Link
|
||||
href={`/hack/${slug}/edit/patch`}
|
||||
className="inline-flex items-center justify-center h-12 md:h-10 w-full md:w-auto px-4 text-sm font-semibold rounded-md bg-[var(--accent)] text-[var(--accent-foreground)] hover:bg-[var(--accent-700)] transition-colors"
|
||||
>
|
||||
<FaPlus size={14} className="mr-2" />
|
||||
Upload New Version
|
||||
</Link>
|
||||
</>}
|
||||
</div>
|
||||
</div>
|
||||
<div className="mt-4 lg:mt-8">
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import React from "react";
|
||||
import Link from "next/link";
|
||||
import { FiExternalLink, FiEdit2, FiUpload, FiShare2, FiBarChart2, FiMoreVertical, FiCheck } from "react-icons/fi";
|
||||
import { TbVersions } from "react-icons/tb";
|
||||
import { useFloating, offset, flip, shift, autoUpdate } from "@floating-ui/react";
|
||||
import ActionSheet from "@/components/Primitives/ActionSheet";
|
||||
|
||||
@@ -65,8 +66,8 @@ export default function HackList({ hacks }: { hacks: HackRow[] }) {
|
||||
<IconTooltipButton href={`/hack/${h.slug}/edit`} label="Edit">
|
||||
<FiEdit2 className="h-4 w-4" />
|
||||
</IconTooltipButton>
|
||||
<IconTooltipButton href={`/hack/${h.slug}/edit/patch`} label="Upload patch">
|
||||
<FiUpload className="h-4 w-4" />
|
||||
<IconTooltipButton href={`/hack/${h.slug}/versions`} label="Manage versions">
|
||||
<TbVersions className="h-5 w-5" />
|
||||
</IconTooltipButton>
|
||||
<ShareIconButton slug={h.slug} />
|
||||
</div>
|
||||
@@ -131,7 +132,7 @@ function buildActions(slug: string | null) {
|
||||
{ key: "view", label: "View", href: `/hack/${slug}`, icon: <FiExternalLink className="h-4 w-4" /> },
|
||||
{ key: "stats", label: "Stats", href: `/hack/${slug}/stats`, icon: <FiBarChart2 className="h-4 w-4" /> },
|
||||
{ key: "edit", label: "Edit", href: `/hack/${slug}/edit`, icon: <FiEdit2 className="h-4 w-4" /> },
|
||||
{ key: "upload", label: "Upload patch", href: `/hack/${slug}/edit/patch`, icon: <FiUpload className="h-4 w-4" /> },
|
||||
{ key: "versions", label: "Manage versions", href: `/hack/${slug}/versions`, icon: <TbVersions className="h-4 w-4" /> },
|
||||
{ key: "share", label: "Share link", onClick: () => copyShare(slug), icon: <FiShare2 className="h-4 w-4" /> },
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user