fix: rebrand Shadboard → CannaManage, staff permissions UX
- Sidebar, footer, bottom-bar-header: replaced 'Shadboard' with 'CannaManage' - Footer: removed 'Designed by Qualiora' attribution - Staff permissions: single-column layout, alphabetically sorted by label - Edit permissions dialog: useEffect syncs state when dialog opens (fixes pre-fill not working when controlled externally)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"use client"
|
||||
|
||||
import { useState } from "react"
|
||||
import { useEffect, useState } from "react"
|
||||
import {
|
||||
useInviteStaffMutation,
|
||||
useRevokeStaffMutation,
|
||||
@@ -157,8 +157,10 @@ function PermissionCheckboxes({
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2">
|
||||
{ALL_PERMISSIONS.map((perm) => (
|
||||
<div className="grid grid-cols-1 gap-3">
|
||||
{[...ALL_PERMISSIONS]
|
||||
.sort((a, b) => permLabels[a].localeCompare(permLabels[b]))
|
||||
.map((perm) => (
|
||||
<div key={perm} className="flex items-center space-x-2">
|
||||
<Checkbox
|
||||
id={`perm-${perm}`}
|
||||
@@ -311,11 +313,14 @@ function EditPermissionsDialog({
|
||||
staffMember?.id ?? ""
|
||||
)
|
||||
|
||||
// Sync permissions when staff member changes
|
||||
const handleOpen = (isOpen: boolean) => {
|
||||
if (isOpen && staffMember) {
|
||||
// Sync permissions whenever the dialog opens or staff member changes
|
||||
useEffect(() => {
|
||||
if (open && staffMember) {
|
||||
setPermissions([...staffMember.permissions])
|
||||
}
|
||||
}, [open, staffMember])
|
||||
|
||||
const handleOpen = (isOpen: boolean) => {
|
||||
onOpenChange(isOpen)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,36 +1,11 @@
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
import { buttonVariants } from "@/components/ui/button"
|
||||
|
||||
export function Footer() {
|
||||
const currentYear = new Date().getFullYear()
|
||||
|
||||
return (
|
||||
<footer className="bg-background border-t border-sidebar-border">
|
||||
<div className="container flex justify-between items-center p-4 md:px-6">
|
||||
<div className="container flex items-center p-4 md:px-6">
|
||||
<p className="text-xs text-muted-foreground md:text-sm">
|
||||
© {currentYear}{" "}
|
||||
<a
|
||||
href="/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className={cn(buttonVariants({ variant: "link" }), "inline p-0")}
|
||||
>
|
||||
Shadboard
|
||||
</a>
|
||||
.
|
||||
</p>
|
||||
<p className="text-xs text-muted-foreground md:text-sm">
|
||||
Designed & Developed by{" "}
|
||||
<a
|
||||
href="https://github.com/Qualiora"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className={cn(buttonVariants({ variant: "link" }), "inline p-0")}
|
||||
>
|
||||
Qualiora
|
||||
</a>
|
||||
.
|
||||
© {currentYear} CannaManage
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -20,7 +20,7 @@ export function BottomBarHeader() {
|
||||
width={24}
|
||||
className="dark:invert"
|
||||
/>
|
||||
<span>Shadboard</span>
|
||||
<span>CannaManage</span>
|
||||
</Link>
|
||||
<div className="flex gap-2">
|
||||
<FullscreenToggle />
|
||||
|
||||
@@ -116,7 +116,7 @@ export function Sidebar() {
|
||||
width={24}
|
||||
className="dark:invert"
|
||||
/>
|
||||
<span>Shadboard</span>
|
||||
<span>CannaManage</span>
|
||||
</Link>
|
||||
<CommandMenu buttonClassName="max-w-full" />
|
||||
</SidebarHeader>
|
||||
|
||||
Reference in New Issue
Block a user