Skip to content

Commit

Permalink
Dev (#44)
Browse files Browse the repository at this point in the history
* refactor: improve CL

* fix: widget dynamic props

* core: v1.1.1
  • Loading branch information
edgarberm authored Jun 12, 2024
1 parent 609f0df commit 6c5afbb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm install
Expand All @@ -73,4 +73,4 @@ jobs:
- name: Run Storybook tests
run: npm run test:storybook
env:
TARGET_URL: 'https://builtbyedgar.github.io/dashup/'
TARGET_URL: 'https://edgarberm.github.io/dashup/'
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dashup",
"version": "1.0.10",
"version": "1.1.1",
"description": "A React Dashboard Component.",
"repository": {
"type": "git",
Expand Down Expand Up @@ -39,10 +39,6 @@
"sortable",
"resizable"
],
"engines": {
"node": ">=18",
"npm": ">=9"
},
"peerDependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/components/Widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default function Widget({
resizer?.removeEventListener('mousedown', handleResizeEvents, false)
}
}
}, []) // eslint-disable-line react-hooks/exhaustive-deps
}, [draggable, fixed, resizable]) // eslint-disable-line react-hooks/exhaustive-deps

/**
* When the necessary properties change, we recalculate the new styles and render the component.
Expand Down
5 changes: 3 additions & 2 deletions stories/Dashboard.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,8 @@ export const ToolbarWithOptionsWidget: Story = {
</>
)
CUSTOM_OPTIONS_WIDGET.dragHandleClassName = 'custom-draggable-toolbar'
const WS = [...FILTER, CUSTOM_OPTIONS_WIDGET]
const [widgets, setWidgets] = useState(WS)
const [widgets, setWidgets] = useState([...FILTER, CUSTOM_OPTIONS_WIDGET])

const handleChange = (dashboard: Layout) => {
setWidgets(dashboard)
}
Expand All @@ -574,6 +574,7 @@ export const ToolbarWithOptionsWidget: Story = {
// eslint-disable-next-line no-console
console.log(`You fired the action for widget: \n ${id}`)
}

function handleRemove(id: string) {
const newWidgets = widgets.filter((w) => w.id !== id)
setWidgets(newWidgets)
Expand Down

0 comments on commit 6c5afbb

Please sign in to comment.