Skip to content

Commit

Permalink
feat: add error and success messages on edit page (#227)
Browse files Browse the repository at this point in the history
* add notifications for loading, success and error

replace the error handling with useStates for error and success and conditional Alert component.

* put notification handling in a separate file

- less code is needed in the components to use notifications for loading/success/error.
- notifications will be consistent across the app and style/settings can be easily changed in one place.
- a tsx file was needed to have the Icon component in the notifications. -> src/lib/notifications.tsx

* refactor layout to have buttons up top and sticky

* edit some spacing

* remove DeleteRecipeButton component

its now handled inline in the EditRecipeForm component

* remove DeleteRecipeButton and title

there now rendered in the EditRecipeForm component instead

* add buttons with text for larger screens

and change title placement + content ({recipe.title} instead of "Edit Recipe")

* refactor sticky element slightly

- zIndex:1000 made it appear on top of dropdowns/drawers
  -> zIndex:100
- small edit of margins

* integrate modals for recipe deletion confirmation

* increase notification auto-close duration to 2s

* fix singular/plural typo

---------

Co-authored-by: sirisayshello <[email protected]>
  • Loading branch information
JoarHansson and sirisayshello authored Nov 18, 2024
1 parent 638e69f commit 6ad3e68
Show file tree
Hide file tree
Showing 10 changed files with 447 additions and 189 deletions.
252 changes: 210 additions & 42 deletions package-lock.json

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

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@hello-pangea/dnd": "^17.0.0",
"@mantine/core": "^7.13.4",
"@mantine/core": "^7.14.1",
"@mantine/form": "^7.13.5",
"@mantine/hooks": "^7.13.3",
"@mantine/notifications": "^7.13.4",
"@mantine/hooks": "^7.14.1",
"@mantine/modals": "^7.14.1",
"@mantine/notifications": "^7.14.1",
"@prisma/client": "^5.21.0",
"@tabler/icons-react": "^3.20.0",
"bcrypt": "^5.1.1",
Expand All @@ -43,6 +44,7 @@
"eslint-config-prettier": "^9.1.0",
"lint-staged": "^15.2.10",
"postcss": "^8.4.47",
"postcss-preset-mantine": "^1.17.0",
"prisma": "^5.21.0",
"ts-node": "^10.9.2",
"tsx": "^4.19.1",
Expand Down
Loading

0 comments on commit 6ad3e68

Please sign in to comment.