diff --git a/package.json b/package.json index 8771d3c..d400367 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "marked-react": "^2.0.0", "react": "^18.3.1", "react-dom": "^18.3.1", - "react-swipeable": "^7.0.1", "shiki": "^1.6.4", "tailwind-merge": "^2.3.0", "zod": "^3.23.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b653e3c..7de38ef 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -38,9 +38,6 @@ importers: react-dom: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) - react-swipeable: - specifier: ^7.0.1 - version: 7.0.1(react@18.3.1) shiki: specifier: ^1.6.4 version: 1.6.4 @@ -2329,11 +2326,6 @@ packages: '@types/react': optional: true - react-swipeable@7.0.1: - resolution: {integrity: sha512-RKB17JdQzvECfnVj9yDZsiYn3vH0eyva/ZbrCZXZR0qp66PBRhtg4F9yJcJTWYT5Adadi+x4NoG53BxKHwIYLQ==} - peerDependencies: - react: ^16.8.3 || ^17 || ^18 - react@18.3.1: resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} engines: {node: '>=0.10.0'} @@ -5109,10 +5101,6 @@ snapshots: optionalDependencies: '@types/react': 18.3.3 - react-swipeable@7.0.1(react@18.3.1): - dependencies: - react: 18.3.1 - react@18.3.1: dependencies: loose-envify: 1.4.0 diff --git a/src/components/Post.tsx b/src/components/Post.tsx index b636983..e8819fb 100644 --- a/src/components/Post.tsx +++ b/src/components/Post.tsx @@ -1,6 +1,5 @@ import { File, PencilLine, Reply, Trash2, X } from "lucide-react"; import * as Dialog from "@radix-ui/react-dialog"; -import { useSwipeable } from "react-swipeable"; import { CSSProperties, ReactNode, useRef, useState, memo } from "react"; import { useShallow } from "zustand/react/shallow"; import { useAPI } from "../lib/api"; @@ -88,7 +87,6 @@ type PostBaseProps = { onReply?: (id: string, content: string, username: string) => void; }; const PostBase = memo((props: PostBaseProps) => { - const [deltaX, setDeltaX] = useState(0); const [deleteError, setDeleteError] = useState(); const [editing, setEditing] = useState(false); const [credentials, editPost, deletePost] = useAPI( @@ -98,18 +96,6 @@ const PostBase = memo((props: PostBaseProps) => { state.deletePost, ]), ); - const swipeHandlers = useSwipeable({ - onSwipedRight: () => { - doReply(); - }, - onSwiping: (evt) => { - setDeltaX(evt.deltaX); - }, - onSwiped: () => { - setDeltaX(0); - }, - delta: 50, - }); const reply = getReply(props.post.p); const doReply = () => { @@ -132,11 +118,7 @@ const PostBase = memo((props: PostBaseProps) => { }; return ( -
+