feat: add Discord profile dropdown menu with role display and integrate with admin and form layouts via AdminShellServer.
This commit is contained in:
@@ -38,6 +38,7 @@ import Image from 'next/image';
|
||||
import { RichTextEditor } from "@/components/rich-text-editor";
|
||||
import { FormattedText } from "@/components/formatted-text";
|
||||
import { ThemeToggle } from "@/components/theme-toggle";
|
||||
import { DropdownMenuAvatar, DiscordMemberProfile } from "@/components/dropdown-menu-avatar";
|
||||
|
||||
interface Question {
|
||||
id: string;
|
||||
@@ -609,7 +610,17 @@ function AnswerPreview({ question }: { question: Question }) {
|
||||
);
|
||||
}
|
||||
|
||||
export function AdminSidebar({ formId }: { formId: string }) {
|
||||
export function AdminSidebar({
|
||||
formId,
|
||||
userName,
|
||||
userImage,
|
||||
profile,
|
||||
}: {
|
||||
formId: string;
|
||||
userName?: string;
|
||||
userImage?: string;
|
||||
profile?: DiscordMemberProfile | null;
|
||||
}) {
|
||||
const pathname = usePathname();
|
||||
|
||||
return (
|
||||
@@ -618,7 +629,17 @@ export function AdminSidebar({ formId }: { formId: string }) {
|
||||
<span className="font-bold tracking-wider text-primary text-sm uppercase">
|
||||
Form Admin
|
||||
</span>
|
||||
<ThemeToggle />
|
||||
<div className="flex items-center gap-1">
|
||||
{(userName || profile) && (
|
||||
<DropdownMenuAvatar
|
||||
userName={userName || ""}
|
||||
userImage={userImage || ""}
|
||||
profile={profile || null}
|
||||
showName={false}
|
||||
/>
|
||||
)}
|
||||
<ThemeToggle />
|
||||
</div>
|
||||
</SidebarHeader>
|
||||
|
||||
<SidebarContent>
|
||||
|
||||
Reference in New Issue
Block a user