diff --git a/app/package.json b/app/package.json index 4357af64..a3ecc716 100644 --- a/app/package.json +++ b/app/package.json @@ -21,8 +21,8 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-rnd": "^10.4.1", - "react-router-dom": "^6.23.0", - "utopia-ui": "^3.0.111", + "react-router-dom": "^7.10.1", + "utopia-ui": "^3.0.112", "vite-tsconfig-paths": "^5.1.4" }, "devDependencies": { diff --git a/lib/package.json b/lib/package.json index 2270fc1c..b3d2db1e 100644 --- a/lib/package.json +++ b/lib/package.json @@ -1,6 +1,6 @@ { "name": "utopia-ui", - "version": "3.0.111", + "version": "3.0.112", "description": "Reuseable React Components to build mapping apps for real life communities and networks", "repository": "https://github.com/utopia-os/utopia-ui", "homepage": "https://utopia-os.org/", @@ -96,7 +96,7 @@ "peerDependencies": { "react": "^18.2.0", "react-dom": "^18.2.0", - "react-router-dom": "^6.23.0" + "react-router-dom": "^7.10.1" }, "dependencies": { "@heroicons/react": "^2.0.17", diff --git a/lib/src/Components/AppShell/UserControl.tsx b/lib/src/Components/AppShell/UserControl.tsx index 379937ac..ff0ef561 100644 --- a/lib/src/Components/AppShell/UserControl.tsx +++ b/lib/src/Components/AppShell/UserControl.tsx @@ -45,12 +45,12 @@ export const UserControl = () => { const handleEdit = () => { if (!myProfile?.layer) { - navigate(userProfile.id ? `/edit-item/${userProfile.id}` : '#') + void navigate(userProfile.id ? `/edit-item/${userProfile.id}` : '#') return } if (myProfile.layer.itemType.small_form_edit && myProfile.position) { - navigate('/') + void navigate('/') // Wait for navigation to complete before setting popup setTimeout(() => { if (myProfile.position && myProfile.layer) { @@ -65,7 +65,7 @@ export const UserControl = () => { } }, 100) } else { - navigate(userProfile.id ? `/edit-item/${userProfile.id}` : '#') + void navigate(userProfile.id ? `/edit-item/${userProfile.id}` : '#') } } const avatar: string | undefined = diff --git a/lib/src/Components/Auth/LoginPage.tsx b/lib/src/Components/Auth/LoginPage.tsx index e38ed451..b1c8fbb1 100644 --- a/lib/src/Components/Auth/LoginPage.tsx +++ b/lib/src/Components/Auth/LoginPage.tsx @@ -51,9 +51,9 @@ export function LoginPage({ inviteApi, showRequestPassword }: Props) { invitingProfileId = await redeemInvite(inviteCode) } if (invitingProfileId) { - navigate(`/item/${invitingProfileId}`) + void navigate(`/item/${invitingProfileId}`) } else { - navigate('/') + void navigate('/') } }, [navigate, redeemInvite]) diff --git a/lib/src/Components/Auth/RequestPasswordPage.tsx b/lib/src/Components/Auth/RequestPasswordPage.tsx index 713516c1..0d13d436 100644 --- a/lib/src/Components/Auth/RequestPasswordPage.tsx +++ b/lib/src/Components/Auth/RequestPasswordPage.tsx @@ -20,7 +20,7 @@ export function RequestPasswordPage({ resetUrl }: { resetUrl: string }) { await toast.promise(requestPasswordReset(email, resetUrl), { success: { render() { - navigate('/') + void navigate('/') return 'Check your mailbox' }, // other options diff --git a/lib/src/Components/Auth/SetNewPasswordPage.tsx b/lib/src/Components/Auth/SetNewPasswordPage.tsx index fc00649c..2d826d5e 100644 --- a/lib/src/Components/Auth/SetNewPasswordPage.tsx +++ b/lib/src/Components/Auth/SetNewPasswordPage.tsx @@ -22,7 +22,7 @@ export function SetNewPasswordPage() { await toast.promise(passwordReset(token, password), { success: { render() { - navigate('/') + void navigate('/') return 'New password set' }, }, diff --git a/lib/src/Components/Auth/SignupPage.tsx b/lib/src/Components/Auth/SignupPage.tsx index 13c0089f..296ec7bb 100644 --- a/lib/src/Components/Auth/SignupPage.tsx +++ b/lib/src/Components/Auth/SignupPage.tsx @@ -25,7 +25,7 @@ export function SignupPage() { await toast.promise(register({ email, password }, userName), { success: { render({ data }) { - navigate('/') + void navigate('/') return `Hi ${data?.first_name ? data.first_name : 'Traveler'}` }, // other options diff --git a/lib/src/Components/Map/Subcomponents/Controls/GratitudeControl.tsx b/lib/src/Components/Map/Subcomponents/Controls/GratitudeControl.tsx index 5e7c9d6e..629a5bf5 100644 --- a/lib/src/Components/Map/Subcomponents/Controls/GratitudeControl.tsx +++ b/lib/src/Components/Map/Subcomponents/Controls/GratitudeControl.tsx @@ -14,7 +14,7 @@ export const GratitudeControl = () => {
{ - navigate('/select-user') + void navigate('/select-user') }} > diff --git a/lib/src/Components/Map/Subcomponents/Controls/LocateControl.tsx b/lib/src/Components/Map/Subcomponents/Controls/LocateControl.tsx index f0907f81..194b4b89 100644 --- a/lib/src/Components/Map/Subcomponents/Controls/LocateControl.tsx +++ b/lib/src/Components/Map/Subcomponents/Controls/LocateControl.tsx @@ -195,7 +195,7 @@ export const LocateControl = (): React.JSX.Element => { } // Navigate to the profile to show the popup - navigate(`/${result.id}`) + void navigate(`/${result.id}`) // Clean up and reset state setFoundLocation(null) diff --git a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/EditMenu.tsx b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/EditMenu.tsx index 436737e4..e522accf 100644 --- a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/EditMenu.tsx +++ b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/EditMenu.tsx @@ -73,11 +73,13 @@ export function EditMenu({ className='tw:text-base-content! tw:tooltip tw:tooltip-top tw:cursor-pointer' data-tip='Edit' onClick={(e) => { - item.layer?.customEditLink - ? navigate( - `${item.layer.customEditLink}${item.layer.customEditParameter ? `/${item.id}${params.toString() ? '?' + params.toString() : ''}` : ''}`, - ) - : editCallback(e) + if (item.layer?.customEditLink) { + void navigate( + `${item.layer.customEditLink}${item.layer.customEditParameter ? `/${item.id}${params.toString() ? '?' + params.toString() : ''}` : ''}`, + ) + } else { + editCallback(e) + } }} > diff --git a/lib/src/Components/Map/Subcomponents/ItemViewPopup.tsx b/lib/src/Components/Map/Subcomponents/ItemViewPopup.tsx index ee1d4e65..5a3975c9 100644 --- a/lib/src/Components/Map/Subcomponents/ItemViewPopup.tsx +++ b/lib/src/Components/Map/Subcomponents/ItemViewPopup.tsx @@ -81,7 +81,7 @@ export const ItemViewPopup = forwardRef((props: ItemViewPopupProps, ref: any) => setLoading(false) map.closePopup() removeItemFromUrl() - navigate('/') + void navigate('/') } return ( @@ -99,7 +99,7 @@ export const ItemViewPopup = forwardRef((props: ItemViewPopupProps, ref: any) => setPositionCallback={() => { map.closePopup() setSelectPosition(props.item) - navigate('/') + void navigate('/') }} loading={loading} /> diff --git a/lib/src/Components/Map/hooks/useFilter.tsx b/lib/src/Components/Map/hooks/useFilter.tsx index 04f61f59..26d2d4c0 100644 --- a/lib/src/Components/Map/hooks/useFilter.tsx +++ b/lib/src/Components/Map/hooks/useFilter.tsx @@ -117,7 +117,7 @@ function useFilterManager(initialTags: Tag[]): { params.set('layers', visibleNames.join(',')) } - navigate(`${location.pathname}?${params.toString()}`, { replace: true }) + void navigate(`${location.pathname}?${params.toString()}`, { replace: true }) }, [visibleLayers, allLayers, navigate]) const [visibleGroupTypes, dispatchGroupTypes] = useReducer( @@ -152,8 +152,8 @@ function useFilterManager(initialTags: Tag[]): { params.set('tags', `${urlTags || ''}${urlTags ? ';' : ''}${tag.name}`) } if (windowDimensions.width < 786 && location.pathname.split('/').length > 2) - navigate('/' + (params ? `?${params}` : '')) - else navigate(location.pathname + (params ? `?${params}` : '')) + void navigate('/' + (params ? `?${params}` : '')) + else void navigate(location.pathname + (params ? `?${params}` : '')) dispatchTags({ type: 'ADD_TAG', @@ -177,10 +177,10 @@ function useFilterManager(initialTags: Tag[]): { }) if (newUrlTags !== '') { params.set('tags', newUrlTags) - navigate(location.pathname + (params ? `?${params}` : '')) + void navigate(location.pathname + (params ? `?${params}` : '')) } else { params.delete('tags') - navigate(location.pathname + (params ? `?${params}` : '')) + void navigate(location.pathname + (params ? `?${params}` : '')) } dispatchTags({ diff --git a/lib/src/Components/Onboarding/InvitePage.tsx b/lib/src/Components/Onboarding/InvitePage.tsx index 800766a8..d7c7a897 100644 --- a/lib/src/Components/Onboarding/InvitePage.tsx +++ b/lib/src/Components/Onboarding/InvitePage.tsx @@ -39,10 +39,10 @@ export function InvitePage({ inviteApi }: Props) { if (invitingProfileId) { toast.success('Invite redeemed successfully!') - navigate(`/item/${invitingProfileId}`) + void navigate(`/item/${invitingProfileId}`) } else { toast.error('Failed to redeem invite') - navigate('/') + void navigate('/') } } @@ -55,7 +55,7 @@ export function InvitePage({ inviteApi }: Props) { localStorage.setItem('inviteCode', id) // Redirect to login page - navigate('/login') + void navigate('/login') } }, [ id, diff --git a/lib/src/Components/Profile/ProfileView.tsx b/lib/src/Components/Profile/ProfileView.tsx index 08bc31fd..0561deeb 100644 --- a/lib/src/Components/Profile/ProfileView.tsx +++ b/lib/src/Components/Profile/ProfileView.tsx @@ -187,12 +187,12 @@ export function ProfileView({ attestationApi }: { attestationApi?: ItemsApi }) }} editCallback={() => { - navigate('/edit-item/' + item.id) + void navigate('/edit-item/' + item.id) }} setPositionCallback={() => { map.closePopup() setSelectPosition(item) - navigate('/') + void navigate('/') }} big truncateSubname={false} diff --git a/lib/src/Components/Profile/Templates/TabsForm.tsx b/lib/src/Components/Profile/Templates/TabsForm.tsx index b7a13b88..4b63019b 100644 --- a/lib/src/Components/Profile/Templates/TabsForm.tsx +++ b/lib/src/Components/Profile/Templates/TabsForm.tsx @@ -133,7 +133,7 @@ export const TabsForm = ({ key={i.id} className='tw:cursor-pointer tw:card tw:bg-base-200 tw:border-[1px] tw:border-base-300 tw:card-body tw:shadow-xl tw:text-base-content tw:mx-4 tw:p-6 tw:mb-4' onClick={() => { - navigate('/item/' + i.id) + void navigate('/item/' + i.id) }} > { - navigate('/item/' + i.id) + void navigate('/item/' + i.id) }} > { - navigate('/') + void navigate('/') }) .catch((e) => { throw e diff --git a/lib/src/Components/Templates/AttestationForm.tsx b/lib/src/Components/Templates/AttestationForm.tsx index 4fd13078..25afc4da 100644 --- a/lib/src/Components/Templates/AttestationForm.tsx +++ b/lib/src/Components/Templates/AttestationForm.tsx @@ -71,7 +71,7 @@ export const AttestationForm = ({ api }: { api?: ItemsApi }) => { }, ) .then(() => { - navigate( + void navigate( '/item/' + // eslint-disable-next-line @typescript-eslint/restrict-plus-operands items.find( diff --git a/lib/src/Components/Templates/ItemCard.tsx b/lib/src/Components/Templates/ItemCard.tsx index cb287e8e..10178825 100644 --- a/lib/src/Components/Templates/ItemCard.tsx +++ b/lib/src/Components/Templates/ItemCard.tsx @@ -35,7 +35,7 @@ export const ItemCard = ({ } if (i.layer.itemType.small_form_edit && i.position) { - navigate('/') + void navigate('/') // Wait for navigation to complete before setting popup setTimeout(() => { if (i.position && i.layer) { @@ -49,7 +49,7 @@ export const ItemCard = ({ } }, 100) } else { - navigate('/edit-item/' + i.id) + void navigate('/edit-item/' + i.id) } } @@ -60,8 +60,8 @@ export const ItemCard = ({ // We could have an onClick callback instead const params = new URLSearchParams(window.location.search) if (windowDimensions.width < 786 && i.position) - navigate('/' + i.id + (params.size > 0 ? `?${params.toString()}` : '')) - else navigate(url + i.id + (params.size > 0 ? `?${params.toString()}` : '')) + void navigate('/' + i.id + (params.size > 0 ? `?${params.toString()}` : '')) + else void navigate(url + i.id + (params.size > 0 ? `?${params.toString()}` : '')) }} > { map.closePopup() setSelectPosition(i) - navigate('/') + void navigate('/') }} deleteCallback={() => { deleteCallback(i) diff --git a/lib/src/Components/Templates/MapOverlayPage.tsx b/lib/src/Components/Templates/MapOverlayPage.tsx index 7ba49826..edae2d2e 100644 --- a/lib/src/Components/Templates/MapOverlayPage.tsx +++ b/lib/src/Components/Templates/MapOverlayPage.tsx @@ -17,7 +17,7 @@ export function MapOverlayPage({ card?: boolean }) { const closeScreen = () => { - navigate(`/${window.location.search ? window.location.search : ''}`) + void navigate(`/${window.location.search ? window.location.search : ''}`) } const navigate = useNavigate() diff --git a/lib/src/Components/Templates/MarketView.tsx b/lib/src/Components/Templates/MarketView.tsx index 294d7874..a37026ad 100644 --- a/lib/src/Components/Templates/MarketView.tsx +++ b/lib/src/Components/Templates/MarketView.tsx @@ -70,7 +70,7 @@ export const MarketView = () => { {groupAndCount(offers).map((o) => ( { - navigate(`/?tags=${o.object.name}`) + void navigate(`/?tags=${o.object.name}`) }} key={o.object.id} tag={o.object} @@ -85,7 +85,7 @@ export const MarketView = () => { {groupAndCount(needs).map((o) => ( { - navigate(`/?tags=${o.object.name}`) + void navigate(`/?tags=${o.object.name}`) }} key={o.object.id} tag={o.object} diff --git a/lib/src/Components/Templates/Tabs.tsx b/lib/src/Components/Templates/Tabs.tsx index eb583f30..e9caaaf0 100644 --- a/lib/src/Components/Templates/Tabs.tsx +++ b/lib/src/Components/Templates/Tabs.tsx @@ -39,7 +39,7 @@ export const Tabs: React.FC = ({ items, setUrlParams }: TabsProps) => setUrlParams(params) const newUrl = location.pathname + '?' + params.toString() - navigate(newUrl, { replace: false }) + void navigate(newUrl, { replace: false }) }, [location.pathname, location.search, navigate, setUrlParams], ) diff --git a/package-lock.json b/package-lock.json index 5861b932..505df29a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,8 +22,8 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-rnd": "^10.4.1", - "react-router-dom": "^6.23.0", - "utopia-ui": "^3.0.111", + "react-router-dom": "^7.10.1", + "utopia-ui": "^3.0.112", "vite-tsconfig-paths": "^5.1.4" }, "devDependencies": { @@ -139,7 +139,7 @@ }, "lib": { "name": "utopia-ui", - "version": "3.0.111", + "version": "3.0.112", "license": "GPL-3.0-only", "dependencies": { "@heroicons/react": "^2.0.17", @@ -233,7 +233,7 @@ "peerDependencies": { "react": "^18.2.0", "react-dom": "^18.2.0", - "react-router-dom": "^6.23.0" + "react-router-dom": "^7.10.1" } }, "lib/node_modules/@typescript-eslint/types": { @@ -3102,15 +3102,6 @@ "integrity": "sha512-42aWfPrimMfDKDi4YegyS7x+/0tlzaqwPQCULLanv3DMIlu96KTJR0fM5isWX2UViOqlGnX6YFgqWepcX+XMNg==", "license": "MIT" }, - "node_modules/@remix-run/router": { - "version": "1.23.0", - "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.23.0.tgz", - "integrity": "sha512-O3rHJzAQKamUz1fvE0Qaw0xSFqsA/yafi2iqeE0pvdFtCO1viYx8QL6f3Ln/aCCTLxs68SLf0KPM9eSeM8yBnA==", - "license": "MIT", - "engines": { - "node": ">=14.0.0" - } - }, "node_modules/@rolldown/pluginutils": { "version": "1.0.0-beta.27", "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz", @@ -6736,6 +6727,19 @@ "dev": true, "license": "MIT" }, + "node_modules/cookie": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz", + "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, "node_modules/core-js-compat": { "version": "3.47.0", "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.47.0.tgz", @@ -13609,36 +13613,42 @@ "license": "0BSD" }, "node_modules/react-router": { - "version": "6.30.1", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.30.1.tgz", - "integrity": "sha512-X1m21aEmxGXqENEPG3T6u0Th7g0aS4ZmoNynhbs+Cn+q+QGTLt+d5IQ2bHAXKzKcxGJjxACpVbnYQSCRcfxHlQ==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.10.1.tgz", + "integrity": "sha512-gHL89dRa3kwlUYtRQ+m8NmxGI6CgqN+k4XyGjwcFoQwwCWF6xXpOCUlDovkXClS0d0XJN/5q7kc5W3kiFEd0Yw==", "license": "MIT", "dependencies": { - "@remix-run/router": "1.23.0" + "cookie": "^1.0.1", + "set-cookie-parser": "^2.6.0" }, "engines": { - "node": ">=14.0.0" + "node": ">=20.0.0" }, "peerDependencies": { - "react": ">=16.8" + "react": ">=18", + "react-dom": ">=18" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + } } }, "node_modules/react-router-dom": { - "version": "6.30.1", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.30.1.tgz", - "integrity": "sha512-llKsgOkZdbPU1Eg3zK8lCn+sjD9wMRZZPuzmdWWX5SUs8OFkN5HnFVC0u5KMeMaC9aoancFI/KoLuKPqN+hxHw==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.10.1.tgz", + "integrity": "sha512-JNBANI6ChGVjA5bwsUIwJk7LHKmqB4JYnYfzFwyp2t12Izva11elds2jx7Yfoup2zssedntwU0oZ5DEmk5Sdaw==", "license": "MIT", "peer": true, "dependencies": { - "@remix-run/router": "1.23.0", - "react-router": "6.30.1" + "react-router": "7.10.1" }, "engines": { - "node": ">=14.0.0" + "node": ">=20.0.0" }, "peerDependencies": { - "react": ">=16.8", - "react-dom": ">=16.8" + "react": ">=18", + "react-dom": ">=18" } }, "node_modules/react-toastify": { @@ -14224,6 +14234,12 @@ "randombytes": "^2.1.0" } }, + "node_modules/set-cookie-parser": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.2.tgz", + "integrity": "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==", + "license": "MIT" + }, "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz",