Skip to content

Commit

Permalink
refactor: remove usage of solidjs-use/eventListener
Browse files Browse the repository at this point in the history
  • Loading branch information
ddiu8081 committed Sep 13, 2023
1 parent 93ad723 commit af15158
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 29 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@mapbox/rehype-prism": "^0.8.0",
"@nanostores/solid": "^0.4.2",
"@solid-primitives/clipboard": "^1.5.6",
"@solid-primitives/event-listener": "^2.3.0",
"@solid-primitives/keyboard": "^1.2.3",
"@solid-primitives/scheduled": "^1.3.2",
"@solid-primitives/scroll": "^2.0.17",
Expand Down Expand Up @@ -57,7 +58,6 @@
"solid-emoji-picker": "^0.2.0",
"solid-js": "1.7.7",
"solid-transition-group": "^0.2.2",
"solidjs-use": "^2.3.0",
"unified": "^10.1.2"
},
"devDependencies": {
Expand Down
39 changes: 13 additions & 26 deletions pnpm-lock.yaml

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

4 changes: 2 additions & 2 deletions src/components/Markdown.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Show, createSignal, createEffect, on } from 'solid-js'

Check failure on line 1 in src/components/Markdown.tsx

View workflow job for this annotation

GitHub Actions / lint

Member 'createEffect' of the import declaration should be sorted alphabetically
import { useEventListener } from 'solidjs-use'
import { makeEventListener } from '@solid-primitives/event-listener'
import { unified } from 'unified'
import remarkParse from 'remark-parse'
import remarkGfm from 'remark-gfm'
Expand Down Expand Up @@ -37,7 +37,7 @@ export default (props: Props) => {
const [copied, copy] = useClipboardCopy(source())
const [copiedIndex, setCopiedIndex] = createSignal(-1)

useEventListener('click', (e) => {
makeEventListener(document, 'click', (e) => {
const el = e.target as HTMLElement
if (el.matches('div > div.code-copy-btn')) {
setCopiedIndex(parseInt(el.dataset.index!))
Expand Down

0 comments on commit af15158

Please sign in to comment.