Skip to content

Commit

Permalink
Merge pull request #46 from mayank1513/fix/45-remove-trails
Browse files Browse the repository at this point in the history
Fix/45 remove trails
  • Loading branch information
mayank1513 authored Jul 9, 2024
2 parents 05a27a5 + 010afeb commit 62cabaf
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Trello Kanban Board

## 0.7.1

### Patch Changes

- 387ba59: Add option to hide mouse trails.

## 0.7.0

### Minor Changes
Expand Down
1 change: 1 addition & 0 deletions extension/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ export interface BoardType {
columns: ColumnType[];
tasks: { [key: string]: TaskType };
scope: string;
hideTrails?: boolean;
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "trello-kanban-task-board",
"private": true,
"version": "0.7.0",
"version": "0.7.1",
"type": "module",
"scripts": {
"dev": "vite --port 3000",
Expand All @@ -25,7 +25,8 @@
"react-toastify": "^9.1.3",
"react-webgl-trails": "^0.0.4",
"rehype-raw": "^7.0.0",
"remark-gfm": "^4.0.0"
"remark-gfm": "^4.0.0",
"webgl-generative-particles": "^0.0.1"
},
"devDependencies": {
"@changesets/cli": "^2.27.1",
Expand Down
8 changes: 7 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ToastContainer } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
import { ThemeSwitcher } from "nextjs-themes";
import { MouseTrail } from "react-webgl-trails";
import { Particles } from "webgl-generative-particles/react";

function App() {
const [state, _setState] = useState<BoardType>(defaultBoard);
Expand All @@ -25,7 +26,12 @@ function App() {
<ThemeSwitcher storage="localStorage" themeTransition="all .3s" />
<Board />
<ToastContainer position="bottom-right" />
<MouseTrail />
{!state.hideTrails && (
<>
<MouseTrail />
<Particles fullScreenOverlay />
</>
)}
</GlobalContext.Provider>
);
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/drawer/drawer.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
padding: 0;
list-style-type: none;
}
a {
a,
label {
padding: 20px;
display: block;
color: inherit;
Expand Down
15 changes: 15 additions & 0 deletions src/components/drawer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { vscode } from "utils/vscode";
import styles from "./drawer.module.scss";
import { MouseEventHandler } from "react";
import { useGlobalState } from "utils/context";

const links = [
{
Expand All @@ -26,10 +27,24 @@ const links = [
];

export default function Drawer({ open, scope }: { open: boolean; scope: string }) {
const { state, setState } = useGlobalState();

return (
<aside className={[styles.drawer, open ? styles.open : ""].join(" ")}>
<ul>
{scope !== "Browser" && <ExtensionOnlyUI scope={scope} />}
<li>
<label htmlFor="trails">
<input
id="trails"
type="checkbox"
checked={!state?.hideTrails}
onChange={() => setState({ ...state, hideTrails: !state.hideTrails })}
/>
{" "}
Show mouse trails?
</label>
</li>
{links.map(({ text, href }) => (
<li key={href}>
<a href={href} target="_blank">
Expand Down
2 changes: 2 additions & 0 deletions vitest.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ Object.defineProperty(window, "matchMedia", {

vi.mock("react-webgl-trails", () => ({ MouseTrail: () => null }));

vi.mock("react-webgl-trails/react", () => ({ Particles: () => null }));

vi.mock("react-color-palette", () => ({ ColorPicker: () => null, useColor: useState }));

0 comments on commit 62cabaf

Please sign in to comment.