Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(app/pano):used toast component #577

Merged
merged 11 commits into from
Aug 6, 2023
4 changes: 3 additions & 1 deletion apps/kampus/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { type ReactNode } from "react";
import { Inter } from "next/font/google";
import { ToastProvider } from "@kampus/ui-next";

import { RelayEnvironmentProvider } from "~/features/relay/RelayEnvironmentProvider";

import "./globals.css";

import { ThemeProvider } from "@kampus/ui-next";
import { ThemeProvider, Toast } from "@kampus/ui-next";
cansirin marked this conversation as resolved.
Show resolved Hide resolved

const inter = Inter({ subsets: ["latin"] });

Expand All @@ -20,6 +21,7 @@ export default function RootLayout({ children }: { children: ReactNode }) {
<body className={inter.className}>
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
<RelayEnvironmentProvider>{children}</RelayEnvironmentProvider>
<ToastProvider/>
</ThemeProvider>
</body>
</html>
Expand Down
14 changes: 12 additions & 2 deletions apps/kampus/app/pano/features/post-list/MoreOptions.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use client";
import { MoreHorizontal } from "lucide-react";

import {
Expand All @@ -6,6 +7,7 @@ import {
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
useToast,
} from "@kampus/ui-next";

interface Props {
Expand All @@ -26,7 +28,7 @@ type Post = {
export const MoreOptionsDropdown = ({ post, shareUrl }: Props) => {
// const user = useUserContext();
console.log(post, shareUrl);

const { toast } = useToast();
const ownerItems: JSX.Element[] = [];
// if (canUserEdit(user, post)) {
// ownerItems.push(
Expand Down Expand Up @@ -54,7 +56,15 @@ export const MoreOptionsDropdown = ({ post, shareUrl }: Props) => {
</DropdownMenuTrigger>
<DropdownMenuContent>
{ownerItems}
<DropdownMenuItem>Adresi kopyala</DropdownMenuItem>
<DropdownMenuItem
onSelect={() => {
toast({
description: "link kopyalandı",
muhammed-gumus marked this conversation as resolved.
Show resolved Hide resolved
});
}}
>
Adresi kopyala
muhammed-gumus marked this conversation as resolved.
Show resolved Hide resolved
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
);
Expand Down