Add application feedback and refine headless canvas design boundaries
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
"use client";
|
||||
|
||||
import { createContext, type ReactNode } from "react";
|
||||
import * as Tooltip from "@radix-ui/react-tooltip";
|
||||
import { Toaster } from "sonner";
|
||||
|
||||
export const FeedbackContext = createContext(false);
|
||||
|
||||
export function AppFeedback({ children }: { children: ReactNode }) {
|
||||
return <FeedbackContext.Provider value={true}>
|
||||
<Tooltip.Provider delayDuration={400} skipDelayDuration={200}>
|
||||
{children}
|
||||
<Toaster position="bottom-right" closeButton visibleToasts={3} duration={4500}
|
||||
offset={{ bottom: 24, right: 20 }} containerAriaLabel="操作通知"
|
||||
toastOptions={{ closeButtonAriaLabel: "关闭通知", style: { background: "var(--popover, #fffcf9)", color: "var(--popover-foreground, #38281f)", border: "1px solid var(--border, #ded5cc)" } }} />
|
||||
</Tooltip.Provider>
|
||||
</FeedbackContext.Provider>;
|
||||
}
|
||||
Reference in New Issue
Block a user