Skip to content

Commit 227674d

Browse files
authored
initial: domains setup page (#2618)
1 parent 94f82af commit 227674d

File tree

1 file changed

+88
-1
lines changed

1 file changed

+88
-1
lines changed

src/pages/package-settings.tsx

Lines changed: 88 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,16 @@ import {
4646
AlertTriangle,
4747
Trash2,
4848
ArrowRightLeft,
49+
Search,
50+
CheckCircle2,
4951
} from "lucide-react"
5052
import { cn } from "@/lib/utils"
5153

52-
type SettingsSection = "general" | "github" | "danger"
54+
type SettingsSection = "general" | "domains" | "github" | "danger"
5355

5456
const navItems: { id: SettingsSection; label: string }[] = [
5557
{ id: "general", label: "General" },
58+
{ id: "domains", label: "Domains" },
5659
{ id: "github", label: "GitHub" },
5760
{ id: "danger", label: "Danger Zone" },
5861
]
@@ -705,6 +708,90 @@ export default function PackageSettingsPage() {
705708
</>
706709
)}
707710

711+
{activeSection === "domains" && (
712+
<div className="space-y-6">
713+
<div className="flex flex-col sm:flex-row sm:items-start justify-between gap-4">
714+
<div>
715+
<h2 className="text-lg font-medium text-gray-900">
716+
Domains
717+
</h2>
718+
<p className="text-sm text-gray-500 mt-1">
719+
Domains can be assigned to pacakge release preview.
720+
</p>
721+
</div>
722+
<div className="flex gap-2 shrink-0">
723+
<Button
724+
variant="outline"
725+
className="bg-white"
726+
onClick={() =>
727+
toast({
728+
title: "Work in progress",
729+
description: "This feature is coming soon",
730+
})
731+
}
732+
>
733+
Add new subdomain
734+
</Button>
735+
</div>
736+
</div>
737+
738+
<div className="border border-gray-200 rounded-lg bg-white overflow-hidden">
739+
<div className="p-3 border-b border-gray-200">
740+
<div className="relative">
741+
<Search className="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" />
742+
<Input
743+
placeholder="Search any domain"
744+
className="pl-9 border-none bg-transparent focus-visible:ring-0 placeholder:text-gray-400 focus:shadow-none shadow-none focus-visible:ring-offset-0"
745+
/>
746+
</div>
747+
</div>
748+
<div className="divide-y divide-gray-200">
749+
{packageRelease?.package_release_website_url ? (
750+
[
751+
{
752+
name: packageRelease.package_release_website_url,
753+
},
754+
].map((domain, i) => (
755+
<div
756+
key={i}
757+
className="p-4 flex flex-col sm:flex-row sm:items-center justify-between gap-4 hover:bg-gray-50/50 transition-colors"
758+
>
759+
<div className="flex items-start gap-3 min-w-0 flex-1">
760+
<CheckCircle2 className="h-5 w-5 text-white fill-blue-500 shrink-0 mt-0.5" />
761+
<div className="min-w-0 flex-1">
762+
<div className="font-medium text-gray-900 truncate">
763+
{domain.name}
764+
</div>
765+
</div>
766+
</div>
767+
768+
<div className="flex items-center gap-2 ml-8 sm:ml-0">
769+
<Button
770+
variant="outline"
771+
size="sm"
772+
className="h-8 px-3 bg-white"
773+
onClick={() =>
774+
toast({
775+
title: "Work in progress",
776+
description: "Edit coming soon",
777+
})
778+
}
779+
>
780+
Edit
781+
</Button>
782+
</div>
783+
</div>
784+
))
785+
) : (
786+
<div className="p-8 text-center text-gray-500 text-sm">
787+
No domains configured yet
788+
</div>
789+
)}
790+
</div>
791+
</div>
792+
</div>
793+
)}
794+
708795
{activeSection === "github" && (
709796
<SettingCard
710797
title="GitHub Repository"

0 commit comments

Comments
 (0)