Skip to content

Commit

Permalink
remove remnants of react-beautiful-dnd
Browse files Browse the repository at this point in the history
  • Loading branch information
vangberg committed Dec 17, 2024
1 parent 8260e33 commit d436aa0
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 237 deletions.
133 changes: 0 additions & 133 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@
"prosemirror-transform": "^1.10.2",
"prosemirror-view": "^1.37.0",
"react": "^18.0.0",
"react-beautiful-dnd": "^13.1.0",
"react-dom": "^18.0.0",
"sqlite": "^5.1.1",
"sqlite3": "^5.1.6",
Expand All @@ -129,4 +128,4 @@
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.2.0"
}
}
}
21 changes: 2 additions & 19 deletions src/skrift-electron/renderer/components/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,14 @@
import clsx from "clsx";
import React, { useEffect, useMemo, useRef } from "react";
// import { Draggable, DraggableChildrenFn } from "react-beautiful-dnd";
import { useUniqueId } from "../hooks/useUniqueId";
import { DraggableIds } from "../interfaces/draggableIds";
import { Path } from "../interfaces/path";
import { Card as CardType } from "../interfaces/state";
import React from "react";

interface Props {
path: Path;
card: CardType;
className?: string;
// children: DraggableChildrenFn;
children: React.ReactNode;
}

export const Card: React.FC<Props> = ({ card, path, className, children }) => {
const draggableId = DraggableIds.serialize(card.meta.key);


export const Card: React.FC<Props> = ({ className, children }) => {
return (
// <Draggable draggableId={draggableId} index={Path.last(path)}>
// {(provided, snapshot, ...rest) => (
<div
// ref={provided.innerRef}
// {...provided.draggableProps}
className={clsx(
className,
"skrift-card mx-2 my-2 relative flex flex-initial flex-col group"
Expand All @@ -33,7 +18,5 @@ export const Card: React.FC<Props> = ({ card, path, className, children }) => {
{children}
</div>
</div>
// )}
// </Draggable>
);
};
7 changes: 0 additions & 7 deletions src/skrift-electron/renderer/components/DropStream.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,12 @@ export const DropStream: React.FC<Props> = ({ mode, onDrop }) => {
}, []);

return (
// <Droppable droppableId={droppableId}>
// {(provided, snapshot) => (
<div
// ref={provided.innerRef}
// {...provided.droppableProps}
ref={ref}
className={clsx(
"bg-gray-300 my-2 w-20 shadow-inner rounded opacity-0 transition-opacity",
{
"opacity-100": isDraggedOver,
// "opacity-100": snapshot.isDraggingOver,
}
)}
style={{
Expand All @@ -54,7 +49,5 @@ export const DropStream: React.FC<Props> = ({ mode, onDrop }) => {
*/}
<div className="hidden"></div>
</div>
// )}
// </Droppable>
);
};
7 changes: 1 addition & 6 deletions src/skrift-electron/renderer/components/NoteCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ import { Card } from "./Card";
import { CardToolbar } from "./CardToolbar";
import { CardBody } from "./CardBody";
import { CardToolbarItem } from "./CardToolbarItem";
import { Path } from "../interfaces/path";
import { NoteCard as NoteCardType, OpenCardMode } from "../interfaces/state";
import { NoteCardTitle } from "./NoteCardTitle";
import { CardTitle } from "./CardTitle";

type Props = {
path: Path;
card: NoteCardType;
note: NoteWithLinks;
focus: number;
Expand All @@ -26,7 +24,6 @@ type Props = {
};

export const NoteCard: React.FC<Props> = ({
path,
card,
note,
focus,
Expand Down Expand Up @@ -57,8 +54,7 @@ export const NoteCard: React.FC<Props> = ({
}, [note]);

return (
<Card card={card} path={path}>
{/* {(provided) => ( */}
<Card>
<>
<CardToolbar>
<CardToolbarItem onClick={handleDelete}>Delete</CardToolbarItem>
Expand All @@ -75,7 +71,6 @@ export const NoteCard: React.FC<Props> = ({
<NoteCardBacklinks note={note} onOpen={onOpen} />
</CardBody>
</>
{/* )} */}
</Card>
);
};
14 changes: 2 additions & 12 deletions src/skrift-electron/renderer/components/SearchCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,9 @@ import { Card } from "./Card";
import { CardBody } from "./CardBody";
import { CardToolbarItem } from "./CardToolbarItem";
import { SearchCardResults } from "./SearchCardResults";
import { Path } from "../interfaces/path";
import {
OpenCardMode,
SearchCard as SearchCardType,
} from "../interfaces/state";
import { OpenCardMode } from "../interfaces/state";

type Props = {
path: Path;
card: SearchCardType;
query: string;
results: Note[];
onOpen: (id: string, mode: OpenCardMode) => void;
Expand All @@ -24,8 +18,6 @@ type Props = {
};

export const SearchCard: React.FC<Props> = ({
path,
card,
query,
results,
onOpen,
Expand All @@ -34,8 +26,7 @@ export const SearchCard: React.FC<Props> = ({
onSearch,
}) => {
return (
<Card card={card} path={path}>
{/* {(provided) => ( */}
<Card>
<>
<CardToolbar>
<CardToolbarItem onClick={onClose}>Close</CardToolbarItem>
Expand All @@ -52,7 +43,6 @@ export const SearchCard: React.FC<Props> = ({
</div>
</CardBody>
</>
{/* )} */}
</Card>
);
};
Loading

0 comments on commit d436aa0

Please sign in to comment.