From fb9b9eece3f080a5b90b67f11c9b769b92ab5ad4 Mon Sep 17 00:00:00 2001 From: Avi Date: Mon, 5 Feb 2024 10:31:48 +0200 Subject: [PATCH 1/4] added copy to clipboard --- package-lock.json | 120 ++++++++++++++++++ package.json | 2 + .../post/components/options/index.tsx | 13 +- .../components/settings-aside/index.tsx | 24 ++-- src/app/(site)/app/settings/page.tsx | 38 +++--- .../settings/section/accesibility/page.tsx | 8 +- src/app/(site)/layout.tsx | 21 +-- src/utils/utils.ts | 10 ++ 8 files changed, 191 insertions(+), 45 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0e17302..0d70b3c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,10 +19,13 @@ "react": "^18", "react-dom": "^18", "react-hook-form": "^7.48.2", + "react-share": "^5.0.3", + "react-toastify": "^10.0.4", "zod": "^3.22.4", "zustand": "^4.4.7" }, "devDependencies": { + "@playwright/test": "^1.41.2", "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", @@ -443,6 +446,21 @@ "node": ">=14" } }, + "node_modules/@playwright/test": { + "version": "1.41.2", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.41.2.tgz", + "integrity": "sha512-qQB9h7KbibJzrDpkXkYvsmiDJK14FULCCZgEcoe2AvFAS64oCirWTwzTlAYEbKaRxWs5TFesE1Na6izMv3HfGg==", + "dev": true, + "dependencies": { + "playwright": "1.41.2" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/@rushstack/eslint-patch": { "version": "1.7.2", "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.7.2.tgz", @@ -1329,6 +1347,11 @@ "node": ">=10" } }, + "node_modules/classnames": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.1.tgz", + "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==" + }, "node_modules/client-only": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", @@ -1356,6 +1379,14 @@ "lodash": ">=4.0" } }, + "node_modules/clsx": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.0.tgz", + "integrity": "sha512-m3iNNWpd9rl3jvvcBnu70ylMdrXt8Vlq4HYadnU5fwcOtvkSQWPmj7amUcDT2qYI7risszBjI5AUIUox9D16pg==", + "engines": { + "node": ">=6" + } + }, "node_modules/cmd-shim": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-6.0.2.tgz", @@ -3152,6 +3183,27 @@ "json5": "lib/cli.js" } }, + "node_modules/jsonp": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/jsonp/-/jsonp-0.2.1.tgz", + "integrity": "sha512-pfog5gdDxPdV4eP7Kg87M8/bHgshlZ5pybl+yKxAnCZ5O7lCIn7Ixydj03wOlnDQesky2BPyA91SQ+5Y/mNwzw==", + "dependencies": { + "debug": "^2.1.3" + } + }, + "node_modules/jsonp/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/jsonp/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, "node_modules/jsx-ast-utils": { "version": "3.3.5", "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", @@ -3847,6 +3899,50 @@ "node": ">= 6" } }, + "node_modules/playwright": { + "version": "1.41.2", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.41.2.tgz", + "integrity": "sha512-v0bOa6H2GJChDL8pAeLa/LZC4feoAMbSQm1/jF/ySsWWoaNItvrMP7GEkvEEFyCTUYKMxjQKaTSg5up7nR6/8A==", + "dev": true, + "dependencies": { + "playwright-core": "1.41.2" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.41.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.41.2.tgz", + "integrity": "sha512-VaTvwCA4Y8kxEe+kfm2+uUUw5Lubf38RxF7FpBxLPmGe5sdNkSg5e3ChEigaGrX7qdqT3pt2m/98LiyvU2x6CA==", + "dev": true, + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/playwright/node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/postcss": { "version": "8.4.33", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.33.tgz", @@ -4095,6 +4191,30 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", "dev": true }, + "node_modules/react-share": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/react-share/-/react-share-5.0.3.tgz", + "integrity": "sha512-8BFkzfd8zNrO6JMP4Dwrt2sTSrRGQ9bNrU3K0riAwRJe4U/Z8/ryjKuhP2jLoHsfxj38MsPuyEQiVlIHVIICvw==", + "dependencies": { + "classnames": "^2.3.2", + "jsonp": "^0.2.1" + }, + "peerDependencies": { + "react": "^17 || ^18" + } + }, + "node_modules/react-toastify": { + "version": "10.0.4", + "resolved": "https://registry.npmjs.org/react-toastify/-/react-toastify-10.0.4.tgz", + "integrity": "sha512-etR3RgueY8pe88SA67wLm8rJmL1h+CLqUGHuAoNsseW35oTGJEri6eBTyaXnFKNQ80v/eO10hBYLgz036XRGgA==", + "dependencies": { + "clsx": "^2.1.0" + }, + "peerDependencies": { + "react": ">=16", + "react-dom": ">=16" + } + }, "node_modules/read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", diff --git a/package.json b/package.json index 686a0e8..d9a8d63 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,8 @@ "react": "^18", "react-dom": "^18", "react-hook-form": "^7.48.2", + "react-share": "^5.0.3", + "react-toastify": "^10.0.4", "zod": "^3.22.4", "zustand": "^4.4.7" }, diff --git a/src/app/(site)/app/post/[postid]/components/post/components/options/index.tsx b/src/app/(site)/app/post/[postid]/components/post/components/options/index.tsx index c5eb14c..c8bf67a 100644 --- a/src/app/(site)/app/post/[postid]/components/post/components/options/index.tsx +++ b/src/app/(site)/app/post/[postid]/components/post/components/options/index.tsx @@ -6,7 +6,8 @@ import { useRouter } from 'next/navigation'; import { useState } from 'react'; import { Option } from './option.models'; import { PrimaryButton } from '@/components/ui/buttons/primary'; -import { downloadImage } from '@/utils/utils'; +import { copyToClipboard, downloadImage } from '@/utils/utils'; +import { toast } from 'react-toastify'; export function PostOptions({ post_id, @@ -53,6 +54,16 @@ export function PostOptions({ const PUBLIC_OPTIONS: Option[] = [ { title: 'Share', action: () => {} }, { title: 'Download', action: async () => await downloadImage(image_url) }, + { + title: 'Copy URL', + action: async () => { + (await copyToClipboard(image_url)) + ? toast.success(`Copied ${image_url} to clipboard`, { + position: 'top-center', + }) + : toast.error('error copying', { position: 'top-center' }); + }, + }, ]; const FINAL_OPTIONS = [...OWNER_OPTIONS, ...PUBLIC_OPTIONS]; diff --git a/src/app/(site)/app/settings/components/settings-aside/index.tsx b/src/app/(site)/app/settings/components/settings-aside/index.tsx index 98bb57d..9d991a4 100644 --- a/src/app/(site)/app/settings/components/settings-aside/index.tsx +++ b/src/app/(site)/app/settings/components/settings-aside/index.tsx @@ -1,31 +1,31 @@ -"use client"; +'use client'; -import { DesktopAside } from "@/components/feature/aside-menu/desktop-aside"; -import { BackwardsNav } from "@/components/feature/nav/backwards"; -import { IRLink } from "@/components/feature/nav/models"; +import { DesktopAside } from '@/components/feature/aside-menu/desktop-aside'; +import { BackwardsNav } from '@/components/feature/nav/backwards'; +import { IRLink } from '@/components/feature/nav/models'; import { CircleUserIcon, LockIcon, SunMoonIcon, UserRoundCog, -} from "lucide-react"; +} from 'lucide-react'; const LINKS: IRLink[] = [ { icon: CircleUserIcon, - href: "profile", + href: 'profile', }, { icon: LockIcon, - href: "reset-password", + href: 'reset-password', }, { icon: SunMoonIcon, - href: "accesibility", + href: 'Accessibility', }, { icon: UserRoundCog, - href: "account", + href: 'account', }, ]; @@ -42,9 +42,9 @@ console.log(LINKS_MAPPED); export function SettingsAside() { return ( -
-
- +
+
+
diff --git a/src/app/(site)/app/settings/page.tsx b/src/app/(site)/app/settings/page.tsx index 276decb..57cafa2 100644 --- a/src/app/(site)/app/settings/page.tsx +++ b/src/app/(site)/app/settings/page.tsx @@ -1,28 +1,28 @@ -"use client"; +'use client'; import { ChevronLeftIcon, CircleUserIcon, LockIcon, SunMoonIcon, -} from "lucide-react"; -import Link from "next/link"; -import { ILink } from "../models/nav-links/nav-links.models"; -import { MobileAside } from "@/components/feature/aside-menu/mobile-aside"; +} from 'lucide-react'; +import Link from 'next/link'; +import { ILink } from '../models/nav-links/nav-links.models'; +import { MobileAside } from '@/components/feature/aside-menu/mobile-aside'; export default function SettingsPage() { return ( -
-
-
+
+
+
-
+
;
@@ -34,19 +34,19 @@ interface ITLink extends ILink { } const LINKS: ITLink[] = [ { - title: "Edit Profile", + title: 'Edit Profile', icon: CircleUserIcon, - href: "settings/section/profile", + href: 'settings/section/profile', }, { - title: "Reset Password", + title: 'Reset Password', icon: LockIcon, - href: "settings/section/reset-password", + href: 'settings/section/reset-password', }, { - title: "Accesibility", + title: 'Accessibility', icon: SunMoonIcon, - href: "settings/section/accesibility", + href: 'settings/section/Accessibility', }, ]; @@ -54,8 +54,8 @@ function SettingsMenu() { return ( +
Theme
diff --git a/src/app/(site)/layout.tsx b/src/app/(site)/layout.tsx index dfdaedd..6c80f33 100644 --- a/src/app/(site)/layout.tsx +++ b/src/app/(site)/layout.tsx @@ -1,14 +1,16 @@ -import type { Metadata } from "next"; -import { Inter } from "next/font/google"; -import "./globals.css"; -import { Analytics } from "@vercel/analytics/react"; -import { SpeedInsights } from "@vercel/speed-insights/next"; +import type { Metadata } from 'next'; +import { Inter } from 'next/font/google'; +import './globals.css'; +import { Analytics } from '@vercel/analytics/react'; +import { SpeedInsights } from '@vercel/speed-insights/next'; -const inter = Inter({ subsets: ["latin"] }); +import { ToastContainer } from 'react-toastify'; +import 'react-toastify/dist/ReactToastify.css'; +const inter = Inter({ subsets: ['latin'] }); export const metadata: Metadata = { - title: "Pictura", - description: "Your pixel art social media app.", + title: 'Pictura', + description: 'Your pixel art social media app.', }; export default function RootLayout({ @@ -17,13 +19,14 @@ export default function RootLayout({ children: React.ReactNode; }) { return ( - + {children} + ); diff --git a/src/utils/utils.ts b/src/utils/utils.ts index e218f45..0f7d17a 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -19,3 +19,13 @@ export const downloadImage = async (url: string) => { console.error('Error downloading image:', error); } }; + +export const copyToClipboard = async (text: string): Promise => { + try { + await navigator.clipboard.writeText(text); + return true; + } catch (error) { + console.error('Unable to copy text to clipboard:', error); + return false; + } +}; From efdafbfddf1815744c3165f56b7532a2405ef2a2 Mon Sep 17 00:00:00 2001 From: Avi Date: Mon, 5 Feb 2024 13:09:36 +0200 Subject: [PATCH 2/4] added share buttons, modal for share buttons --- .../post/components/options/index.tsx | 25 ++++++++++++-- .../post/[postid]/components/post/index.tsx | 1 + src/components/feature/share-btns/index.tsx | 27 +++++++++++++++ src/components/ui/modal/index.tsx | 34 +++++++++++++++++++ 4 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 src/components/feature/share-btns/index.tsx create mode 100644 src/components/ui/modal/index.tsx diff --git a/src/app/(site)/app/post/[postid]/components/post/components/options/index.tsx b/src/app/(site)/app/post/[postid]/components/post/components/options/index.tsx index c8bf67a..208053b 100644 --- a/src/app/(site)/app/post/[postid]/components/post/components/options/index.tsx +++ b/src/app/(site)/app/post/[postid]/components/post/components/options/index.tsx @@ -8,13 +8,17 @@ import { Option } from './option.models'; import { PrimaryButton } from '@/components/ui/buttons/primary'; import { copyToClipboard, downloadImage } from '@/utils/utils'; import { toast } from 'react-toastify'; +import ShareBtns from '@/components/feature/share-btns'; +import Modal from '@/components/ui/modal'; export function PostOptions({ post_id, + title, image_url, doesUserOwnPost, }: { post_id: number; + title: string; image_url: string; doesUserOwnPost: boolean; }) { @@ -23,6 +27,7 @@ export function PostOptions({ const router = useRouter(); const [showDropdown, setShowDropdown] = useState(false); + const [showShareModal, setShowShareModal] = useState(false); const [indexOfOptionLoading, setIndexOfOptionLoading] = useState< number | null >(null); @@ -52,7 +57,10 @@ export function PostOptions({ ]; const PUBLIC_OPTIONS: Option[] = [ - { title: 'Share', action: () => {} }, + { + title: 'Share', + action: () => toggleShareModal(), + }, { title: 'Download', action: async () => await downloadImage(image_url) }, { title: 'Copy URL', @@ -69,7 +77,11 @@ export function PostOptions({ const FINAL_OPTIONS = [...OWNER_OPTIONS, ...PUBLIC_OPTIONS]; function toggleDropdown() { - setShowDropdown(!showDropdown); + setShowDropdown((prev) => !prev); + } + function toggleShareModal() { + setShowShareModal((prev) => !prev); + toggleDropdown(); } return ( @@ -99,6 +111,15 @@ export function PostOptions({ ))} )} + {showShareModal && ( + setShowShareModal(false)} + heading={`Share ${title} on: `} + > + + + )}
); } diff --git a/src/app/(site)/app/post/[postid]/components/post/index.tsx b/src/app/(site)/app/post/[postid]/components/post/index.tsx index 87c7fa5..7008cda 100644 --- a/src/app/(site)/app/post/[postid]/components/post/index.tsx +++ b/src/app/(site)/app/post/[postid]/components/post/index.tsx @@ -48,6 +48,7 @@ export async function Post({ )} = ({ shareUrl, title }) => { + return ( +
+
+ + + + + + +
+
+ ); +}; + +export default ShareBtns; diff --git a/src/components/ui/modal/index.tsx b/src/components/ui/modal/index.tsx new file mode 100644 index 0000000..91c6dc1 --- /dev/null +++ b/src/components/ui/modal/index.tsx @@ -0,0 +1,34 @@ +import { XIcon } from 'lucide-react'; +import React, { ReactNode } from 'react'; + +interface ModalProps { + isOpen: boolean; + onClose: () => void; + children: ReactNode; + heading: string | ReactNode; +} + +const Modal: React.FC = ({ + isOpen, + onClose, + heading, + children, +}) => { + if (!isOpen) return null; + + return ( +
+
+ +

{heading}

+ {children} +
+
+ ); +}; + +export default Modal; From d92f9e0ca9503422e6793212c1bdf2687c5d590f Mon Sep 17 00:00:00 2001 From: Avi Date: Mon, 5 Feb 2024 13:17:39 +0200 Subject: [PATCH 3/4] added title to linkedin share --- src/components/feature/share-btns/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/feature/share-btns/index.tsx b/src/components/feature/share-btns/index.tsx index 2c7da1b..e31bec8 100644 --- a/src/components/feature/share-btns/index.tsx +++ b/src/components/feature/share-btns/index.tsx @@ -16,7 +16,7 @@ const ShareBtns: React.FC = ({ shareUrl, title }) => { - +
From b8d4b2b4842dbc46dbf4a6c970c45903ec75f7b9 Mon Sep 17 00:00:00 2001 From: Avi Date: Tue, 6 Feb 2024 21:44:02 +0200 Subject: [PATCH 4/4] pnpm fix and duplicate imports --- pnpm-lock.yaml | 61 +++++++++++++++++++ .../post/components/options/index.tsx | 7 ++- 2 files changed, 66 insertions(+), 2 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 44b4503..077773e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -38,6 +38,12 @@ dependencies: react-hook-form: specifier: ^7.48.2 version: 7.49.2(react@18.2.0) + react-share: + specifier: ^5.0.3 + version: 5.0.3(react@18.2.0) + react-toastify: + specifier: ^10.0.4 + version: 10.0.4(react-dom@18.2.0)(react@18.2.0) zod: specifier: ^3.22.4 version: 3.22.4 @@ -837,6 +843,10 @@ packages: engines: {node: '>=10'} dev: true + /classnames@2.5.1: + resolution: {integrity: sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==} + dev: false + /client-only@0.0.1: resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} dev: false @@ -859,6 +869,11 @@ packages: q: 1.5.1 dev: false + /clsx@2.1.0: + resolution: {integrity: sha512-m3iNNWpd9rl3jvvcBnu70ylMdrXt8Vlq4HYadnU5fwcOtvkSQWPmj7amUcDT2qYI7risszBjI5AUIUox9D16pg==} + engines: {node: '>=6'} + dev: false + /cmd-shim@6.0.2: resolution: {integrity: sha512-+FFYbB0YLaAkhkcrjkyNLYDiOsFSfRjwjY19LXk/psmMx1z00xlCv7hhQoTGXXIKi+YXHL/iiFo8NqMVQX9nOw==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -916,6 +931,17 @@ packages: engines: {node: '>= 12'} dev: true + /debug@2.6.9: + resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.0.0 + dev: false + /debug@3.2.7: resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} peerDependencies: @@ -1966,6 +1992,14 @@ packages: minimist: 1.2.8 dev: true + /jsonp@0.2.1: + resolution: {integrity: sha512-pfog5gdDxPdV4eP7Kg87M8/bHgshlZ5pybl+yKxAnCZ5O7lCIn7Ixydj03wOlnDQesky2BPyA91SQ+5Y/mNwzw==} + dependencies: + debug: 2.6.9 + transitivePeerDependencies: + - supports-color + dev: false + /jsx-ast-utils@3.3.5: resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==} engines: {node: '>=4.0'} @@ -2117,6 +2151,10 @@ packages: hasBin: true dev: true + /ms@2.0.0: + resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} + dev: false + /ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} dev: true @@ -2520,6 +2558,29 @@ packages: resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} dev: true + /react-share@5.0.3(react@18.2.0): + resolution: {integrity: sha512-8BFkzfd8zNrO6JMP4Dwrt2sTSrRGQ9bNrU3K0riAwRJe4U/Z8/ryjKuhP2jLoHsfxj38MsPuyEQiVlIHVIICvw==} + peerDependencies: + react: ^17 || ^18 + dependencies: + classnames: 2.5.1 + jsonp: 0.2.1 + react: 18.2.0 + transitivePeerDependencies: + - supports-color + dev: false + + /react-toastify@10.0.4(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-etR3RgueY8pe88SA67wLm8rJmL1h+CLqUGHuAoNsseW35oTGJEri6eBTyaXnFKNQ80v/eO10hBYLgz036XRGgA==} + peerDependencies: + react: '>=16' + react-dom: '>=16' + dependencies: + clsx: 2.1.0 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + dev: false + /react@18.2.0: resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} engines: {node: '>=0.10.0'} diff --git a/src/app/(site)/app/post/[postid]/components/post/components/options/index.tsx b/src/app/(site)/app/post/[postid]/components/post/components/options/index.tsx index 46d3501..32f8ac5 100644 --- a/src/app/(site)/app/post/[postid]/components/post/components/options/index.tsx +++ b/src/app/(site)/app/post/[postid]/components/post/components/options/index.tsx @@ -6,11 +6,14 @@ import { useRouter } from 'next/navigation'; import { useState } from 'react'; import { Option } from './option.models'; import { PrimaryButton } from '@/components/ui/buttons/primary'; -import { copyToClipboard, downloadImage } from '@/utils/utils'; import { toast } from 'react-toastify'; import ShareBtns from '@/components/feature/share-btns'; import Modal from '@/components/ui/modal'; -import { deleteFromCloundinary, downloadImage } from '@/utils/utils'; +import { + deleteFromCloundinary, + copyToClipboard, + downloadImage, +} from '@/utils/utils'; export function PostOptions({ post_id,