Skip to content

Commit

Permalink
chore: upgrade libraries to latest versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Notuom committed Oct 10, 2023
1 parent 5e197f6 commit 2636c2f
Show file tree
Hide file tree
Showing 8 changed files with 4,251 additions and 2,826 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.13.0
v20.5.1
16 changes: 3 additions & 13 deletions components/Checklist.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import ReactTooltip from "react-tooltip";
import { Tooltip } from "react-tooltip";

import { useViewContext } from "../context/ViewContext";
import { cycleStatus, useDecorCollection } from "../hooks/useDecorCollection";
Expand All @@ -15,20 +15,10 @@ export const Checklist: React.FC = () => {
const { collection, get, set, clear } = useDecorCollection();
const { view } = useViewContext();

React.useEffect(() => {
// ReactTooltip needs to be told when tooltipped elements on the page change.
ReactTooltip.rebuild();
}, [view]);

return (
<>
<TopToolbar />
<ReactTooltip
place="right"
effect="solid"
backgroundColor="black"
textColor="white"
/>
<Tooltip id="decor-title-tooltip" place="right" variant="dark" />
<table className={styles.table}>
<thead>
<tr>
Expand Down Expand Up @@ -65,7 +55,7 @@ export const Checklist: React.FC = () => {
);
})}
</tr>
)
),
)}
</tbody>
</table>
Expand Down
3 changes: 2 additions & 1 deletion components/DecorHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ export const DecorHeader: React.FC<DecorHeaderProps> = ({ decor }) => {
<Image
loader={decorLoader}
alt={decor.title}
data-tip={tooltip}
data-tooltip-id="decor-title-tooltip"
data-tooltip-content={tooltip}
src={getDecorIcon(decor.key)}
width={imageSize}
height={imageSize}
Expand Down
9 changes: 6 additions & 3 deletions context/ViewContext.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from "react";

import { CollectionView } from "../utils/types";
import { PropsWithChildren } from "react";

export interface ViewContextValue {
view: CollectionView;
Expand All @@ -16,9 +17,11 @@ export const useViewContext = () => React.useContext(ViewContext);

const storageKey = "decorView";

export const ViewContextProvider: React.FC = ({ children }) => {
export const ViewContextProvider: React.FC<PropsWithChildren> = ({
children,
}) => {
const [view, setInternalView] = React.useState<CollectionView>(
CollectionView.Advanced
CollectionView.Advanced,
);
React.useEffect(() => {
const storedView = localStorage.getItem(storageKey) as CollectionView;
Expand All @@ -31,7 +34,7 @@ export const ViewContextProvider: React.FC = ({ children }) => {
setInternalView(updatedView);
localStorage.setItem(storageKey, updatedView);
},
[setInternalView]
[setInternalView],
);
const context = { view, setView };

Expand Down
7 changes: 3 additions & 4 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
const withPWA = require('next-pwa');
const withPWA = require("next-pwa")({
dest: "public",
});

module.exports = withPWA({
pwa: {
dest: 'public'
},
reactStrictMode: true,
images: {
loader: "custom",
Expand Down
Loading

0 comments on commit 2636c2f

Please sign in to comment.