Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
orlinmalkja committed Feb 5, 2025
1 parent f7ac332 commit dc29224
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 12 deletions.
9 changes: 1 addition & 8 deletions src/components/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ import { FC, ReactNode, useEffect, useState } from 'react'

import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'

interface Position {
x: number,
y: number
}

interface ModalProps {
TriggerButton?: ReactNode,
showPopover?: boolean,
Expand All @@ -21,7 +16,6 @@ const Modal: FC<ModalProps> = ({
position
}) => {


const [isOpen, setIsOpen] = useState(false)

const handleOpenChange = (open: boolean) => {
Expand All @@ -31,8 +25,7 @@ const Modal: FC<ModalProps> = ({
useEffect(() => {
if (showPopover) setIsOpen(true)
}, [position])

Check warning on line 27 in src/components/Modal.tsx

View workflow job for this annotation

GitHub Actions / build (18)

React Hook useEffect has a missing dependency: 'showPopover'. Either include it or remove the dependency array

Check warning on line 27 in src/components/Modal.tsx

View workflow job for this annotation

GitHub Actions / build (20)

React Hook useEffect has a missing dependency: 'showPopover'. Either include it or remove the dependency array



return <div className="local-tree-modal">
<Popover open={isOpen} onOpenChange={handleOpenChange}>
<PopoverTrigger asChild>
Expand Down
1 change: 0 additions & 1 deletion src/components/base/IconRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ interface IconRendererProps {
height?: number
}


const IconRenderer: FC<IconRendererProps> = ({ htmlString, width, height }) => {
const ref = useRef<HTMLInputElement>(null)

Expand Down
1 change: 1 addition & 0 deletions src/components/tree-modal/TreeSelectionModalContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { dataStore } from '@/store/DataStore'
import Tree from '@/components/Tree.tsx'
import InputField from '@/components/base/InputField.tsx'
import { ClosePopover } from '@/components/ui/popover'

import { onExpand, onCollapse, getNodeIndices } from '@/utils/tree.ts'


Expand Down
3 changes: 1 addition & 2 deletions src/store/ConfigStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const configStore = create<ConfigStoreType>((set, get) => ({
set({ config: customConfig })
},
addNewPanel: (newPanelConfig: PanelConfig) => {

const newConfig = { ...get().config }
newConfig.panels?.push(newPanelConfig)

Expand All @@ -23,8 +22,8 @@ export const configStore = create<ConfigStoreType>((set, get) => ({

updatePanel: (newPanelConfig: PanelConfig, newIndex: number) => {
const newConfig = { ...get().config }

if (newConfig.panels) newConfig.panels[newIndex] = newPanelConfig

set({ config: newConfig })
}
}))
6 changes: 6 additions & 0 deletions src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,5 +284,11 @@ declare global {
interface CollectionMap {
[key: string]: Collection
}

interface Position {
x: number,
y: number
}

}
export {}
1 change: 0 additions & 1 deletion src/utils/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ export async function onCollapse(node: TreeNode, nodes: TreeNode[]) {
const manifests = updatedTree[collectionIndex].children
if (!manifests) return
manifests[manifestIndex].expanded = false

updatedTree[collectionIndex].children = [...manifests]
}

Expand Down

0 comments on commit dc29224

Please sign in to comment.