From ce441f03b8b60cfefc15ecb45d53f8034565610a Mon Sep 17 00:00:00 2001 From: Juan Date: Mon, 9 Dec 2024 10:16:04 -0300 Subject: [PATCH 1/9] Upgrade minor --- package.json | 16 ++++----- yarn.lock | 100 +++++++++++++++++++++++++++------------------------ 2 files changed, 62 insertions(+), 54 deletions(-) diff --git a/package.json b/package.json index 3d13a68..5e03a06 100644 --- a/package.json +++ b/package.json @@ -19,26 +19,26 @@ "@ethersproject/contracts": "^5.7.0", "@ethersproject/providers": "^5.7.2", "@mapbox/to-color": "^2.1.1", - "axios": "^1.7.2", + "axios": "^1.7.9", "clsx": "^2.1.1", - "dayjs": "^1.11.11", + "dayjs": "^1.11.13", "downloadjs": "^1.4.7", - "iconoir-react": "^7.7.0", + "iconoir-react": "^7.10.1", "numbro": "^2.5.0", "react": "^18.3.1", "react-dom": "^18.3.1", "react-lazy-images": "^1.1.0", "react-modal": "^3.16.1", - "react-router-dom": "^6.25.1", + "react-router-dom": "^6.28.0", "react-scripts": "^5.0.1" }, "devDependencies": { "@types/downloadjs": "^1.4.6", - "@types/node": "^20.14.11", - "@types/react": "^18.3.3", - "@types/react-dom": "^18.3.0", + "@types/node": "^20.17.9", + "@types/react": "^18.3.14", + "@types/react-dom": "^18.3.2", "@types/react-modal": "^3.16.3", - "typescript": "^5.5.3" + "typescript": "^5.7.2" }, "main": "src/index.js", "scripts": { diff --git a/yarn.lock b/yarn.lock index 83e532a..23bb9b6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1898,10 +1898,10 @@ schema-utils "^3.0.0" source-map "^0.7.3" -"@remix-run/router@1.18.0": - version "1.18.0" - resolved "https://registry.yarnpkg.com/@remix-run/router/-/router-1.18.0.tgz#20b033d1f542a100c1d57cfd18ecf442d1784732" - integrity sha512-L3jkqmqoSVBVKHfpGZmLrex0lxR5SucGA0sUfFzGctehw+S/ggL9L/0NnC5mw6P8HUWpFZ3nQw3cRApjjWx9Sw== +"@remix-run/router@1.21.0": + version "1.21.0" + resolved "https://registry.yarnpkg.com/@remix-run/router/-/router-1.21.0.tgz#c65ae4262bdcfe415dbd4f64ec87676e4a56e2b5" + integrity sha512-xfSkCAchbdG5PnbrKqFWwia4Bi61nH+wm8wLEqfHDyp7Y3dZzgqS2itV8i4gAq9pC2HsTpwyBC6Ds8VHZ96JlA== "@rollup/plugin-babel@^5.2.0": version "5.3.1" @@ -2264,12 +2264,12 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-20.1.1.tgz#afc492e8dbe7f672dd3a13674823522b467a45ad" integrity sha512-uKBEevTNb+l6/aCQaKVnUModfEMjAl98lw2Si9P5y4hLu9tm6AlX2ZIoXZX6Wh9lJueYPrGPKk5WMCNHg/u6/A== -"@types/node@^20.14.11": - version "20.14.11" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.14.11.tgz#09b300423343460455043ddd4d0ded6ac579b74b" - integrity sha512-kprQpL8MMeszbz6ojB5/tU8PLN4kesnN8Gjzw349rDlNgsSzg90lAVj3llK99Dh7JON+t9AuscPPFW6mPbTnSA== +"@types/node@^20.17.9": + version "20.17.9" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.17.9.tgz#5f141d4b7ee125cdee5faefe28de095398865bab" + integrity sha512-0JOXkRyLanfGPE2QRCwgxhzlBAvaRdCNMcvbd7jFfpmD4eEXll7LRwy5ymJmyeZqk7Nh7eD2LeUyQ68BbndmXw== dependencies: - undici-types "~5.26.4" + undici-types "~6.19.2" "@types/parse-json@^4.0.0": version "4.0.0" @@ -2301,12 +2301,12 @@ resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== -"@types/react-dom@^18.3.0": - version "18.3.0" - resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.3.0.tgz#0cbc818755d87066ab6ca74fbedb2547d74a82b0" - integrity sha512-EhwApuTmMBmXuFOikhQLIBUn6uFg81SwLMOAUgodJF14SOBOCMdU04gDoYi0WOJJHD144TL32z4yDqCW3dnkQg== +"@types/react-dom@^18.3.2": + version "18.3.2" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.3.2.tgz#b58a9520f5f317a00bbda0271502889b71c345f0" + integrity sha512-Fqp+rcvem9wEnGr3RY8dYNvSQ8PoLqjZ9HLgaPUOjJJD120uDyOxOjc/39M4Kddp9JQCxpGQbnhVQF0C0ncYVg== dependencies: - "@types/react" "*" + "@types/react" "^18" "@types/react-modal@^3.16.3": version "3.16.3" @@ -2315,7 +2315,7 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@^18.3.3": +"@types/react@*": version "18.3.3" resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.3.tgz#9679020895318b0915d7a3ab004d92d33375c45f" integrity sha512-hti/R0pS0q1/xx+TsI73XIqk26eBsISZ2R0wUijXIngRK9R/e7Xw/cXVxQK7R5JjW+SV4zGcn5hXjudkN/pLIw== @@ -2323,6 +2323,14 @@ "@types/prop-types" "*" csstype "^3.0.2" +"@types/react@^18", "@types/react@^18.3.14": + version "18.3.14" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.14.tgz#7ce43bbca0e15e1c4f67ad33ea3f83d75aa6756b" + integrity sha512-NzahNKvjNhVjuPBQ+2G7WlxstQ+47kXZNHlUvFakDViuIEfGY926GqhMueQFZ7woG+sPiQKlF36XfrIUVSUfFg== + dependencies: + "@types/prop-types" "*" + csstype "^3.0.2" + "@types/resolve@1.17.1": version "1.17.1" resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6" @@ -2934,10 +2942,10 @@ axe-core@^4.6.2: resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.7.0.tgz#34ba5a48a8b564f67e103f0aa5768d76e15bbbbf" integrity sha512-M0JtH+hlOL5pLQwHOLNYZaXuhqmvS8oExsqB1SBYgA4Dk7u/xx+YdGHXaK5pyUfed5mYXdlYiphWq3G8cRi5JQ== -axios@^1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.7.2.tgz#b625db8a7051fbea61c35a3cbb3a1daa7b9c7621" - integrity sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw== +axios@^1.7.9: + version "1.7.9" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.7.9.tgz#d7d071380c132a24accda1b2cfc1535b79ec650a" + integrity sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw== dependencies: follow-redirects "^1.15.6" form-data "^4.0.0" @@ -3806,10 +3814,10 @@ data-urls@^2.0.0: whatwg-mimetype "^2.3.0" whatwg-url "^8.0.0" -dayjs@^1.11.11: - version "1.11.11" - resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.11.tgz#dfe0e9d54c5f8b68ccf8ca5f72ac603e7e5ed59e" - integrity sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg== +dayjs@^1.11.13: + version "1.11.13" + resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.13.tgz#92430b0139055c3ebb60150aa13e860a4b5a366c" + integrity sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg== debug@2.6.9, debug@^2.6.0: version "2.6.9" @@ -5269,10 +5277,10 @@ human-signals@^2.1.0: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== -iconoir-react@^7.7.0: - version "7.7.0" - resolved "https://registry.yarnpkg.com/iconoir-react/-/iconoir-react-7.7.0.tgz#acb2a90919a3f26d48cc4f8a5b601c9e58a99b2d" - integrity sha512-jKwbCZEJ3PtTDzxYga5pe9Jxg5Zvex0lK43DMS0VeHmJkLl+zSHolp6u5vW+hJzSxxxXE0Wy0P87CJBDGj3H7Q== +iconoir-react@^7.10.1: + version "7.10.1" + resolved "https://registry.yarnpkg.com/iconoir-react/-/iconoir-react-7.10.1.tgz#3898d758a0ff3c0fc3d4b6c18c4f51664b8f6ae8" + integrity sha512-Zqxwx+cUfXSrHWn82DNVWCPLq5RKUcDLevUvl37GdYaB73EJ+eNGdpdifGzhIWZ21U7/z0KVcdOJZp5BNyXzBw== iconv-lite@0.4.24: version "0.4.24" @@ -7850,20 +7858,20 @@ react-refresh@^0.11.0: resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.11.0.tgz#77198b944733f0f1f1a90e791de4541f9f074046" integrity sha512-F27qZr8uUqwhWZboondsPx8tnC3Ct3SxZA3V5WyEvujRyyNv0VYPhoBg1gZ8/MV5tubQp76Trw8lTv9hzRBa+A== -react-router-dom@^6.25.1: - version "6.25.1" - resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-6.25.1.tgz#b89f8d63fc8383ea4e89c44bf31c5843e1f7afa0" - integrity sha512-0tUDpbFvk35iv+N89dWNrJp+afLgd+y4VtorJZuOCXK0kkCWjEvb3vTJM++SYvMEpbVwXKf3FjeVveVEb6JpDQ== +react-router-dom@^6.28.0: + version "6.28.0" + resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-6.28.0.tgz#f73ebb3490e59ac9f299377062ad1d10a9f579e6" + integrity sha512-kQ7Unsl5YdyOltsPGl31zOjLrDv+m2VcIEcIHqYYD3Lp0UppLjrzcfJqDJwXxFw3TH/yvapbnUvPlAj7Kx5nbg== dependencies: - "@remix-run/router" "1.18.0" - react-router "6.25.1" + "@remix-run/router" "1.21.0" + react-router "6.28.0" -react-router@6.25.1: - version "6.25.1" - resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.25.1.tgz#70b4f1af79954cfcfd23f6ddf5c883e8c904203e" - integrity sha512-u8ELFr5Z6g02nUtpPAggP73Jigj1mRePSwhS/2nkTrlPU5yEkH1vYzWNyvSnSzeeE2DNqWdH+P8OhIh9wuXhTw== +react-router@6.28.0: + version "6.28.0" + resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.28.0.tgz#29247c86d7ba901d7e5a13aa79a96723c3e59d0d" + integrity sha512-HrYdIFqdrnhDw0PqG/AKjAqEqM7AvxCz0DQ4h2W8k6nqmc5uRBYDag0SBxx9iYz5G8gnuNVLzUe13wl9eAsXXg== dependencies: - "@remix-run/router" "1.18.0" + "@remix-run/router" "1.21.0" react-scripts@^5.0.1: version "5.0.1" @@ -9006,10 +9014,10 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typescript@^5.5.3: - version "5.5.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.3.tgz#e1b0a3c394190838a0b168e771b0ad56a0af0faa" - integrity sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ== +typescript@^5.7.2: + version "5.7.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.2.tgz#3169cf8c4c8a828cde53ba9ecb3d2b1d5dd67be6" + integrity sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg== unbox-primitive@^1.0.2: version "1.0.2" @@ -9021,10 +9029,10 @@ unbox-primitive@^1.0.2: has-symbols "^1.0.3" which-boxed-primitive "^1.0.2" -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== +undici-types@~6.19.2: + version "6.19.8" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" + integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw== unicode-canonical-property-names-ecmascript@^2.0.0: version "2.0.0" From 2a3f51705028e0eedb5dd52010b0558a10340ae1 Mon Sep 17 00:00:00 2001 From: Juan Date: Mon, 9 Dec 2024 10:18:00 -0300 Subject: [PATCH 2/9] Remove auto scroll collectors --- src/components/EventsCompare.tsx | 57 +------------------------------- src/models/settings.ts | 2 -- src/pages/Settings.tsx | 13 -------- 3 files changed, 1 insertion(+), 71 deletions(-) diff --git a/src/components/EventsCompare.tsx b/src/components/EventsCompare.tsx index ed44f2c..ad63a21 100644 --- a/src/components/EventsCompare.tsx +++ b/src/components/EventsCompare.tsx @@ -1,5 +1,4 @@ -import { createRef, useEffect, useMemo, useState } from 'react' -import { useSettings } from 'stores/settings' +import { useMemo, useState } from 'react' import { Drop } from 'models/drop' import { InCommon } from 'models/api' import { @@ -32,9 +31,7 @@ function EventsCompare({ onClose: (eventId: number) => void eventsEnsNames?: Record }) { - const { settings } = useSettings() const [highlighted, setHighlighted] = useState(null) - const [liRefs, setLiRefs] = useState>>>>({}) const adressesColors = useMemo( () => eventIds.length < 2 @@ -53,54 +50,7 @@ function EventsCompare({ [eventIds, inCommon] ) - useEffect( - () => { - if (eventIds.length > 0) { - const refs: Record>>> = {} - for (const eventId of eventIds) { - if (inCommon[eventId].length > 0) { - refs[eventId] = {} - for (const owner of inCommon[eventId]) { - refs[eventId][owner] = createRef() - } - } - } - if (Object.keys(refs).length > 0) { - setLiRefs(refs) - } - } - }, - [eventIds, inCommon] - ) - function onOwnerEnter(ownerEventId: number, owner: string): void { - if ( - owner in adressesColors && - settings && - settings.autoScrollCollectors - ) { - for (const eventId of eventIds) { - if (eventId !== ownerEventId && - eventId && liRefs && - owner in liRefs[eventId] && - liRefs[eventId][owner].current) { - liRefs[eventId][owner].current.scrollIntoView({ - behavior: 'smooth', - block: 'center', - }) - } - } - if ( - ownerEventId in liRefs && - owner in liRefs[ownerEventId] && - liRefs[ownerEventId][owner].current - ) { - liRefs[ownerEventId][owner].current.scrollIntoView({ - behavior: 'smooth', - block: 'center', - }) - } - } setHighlighted((current) => ( current !== owner && owner in adressesColors @@ -154,11 +104,6 @@ function EventsCompare({ return (
  • -
    - -
    - -
    -
    From dcc0e13b9fedb0c8969a6e01d3df64ac085f4941 Mon Sep 17 00:00:00 2001 From: Juan Date: Mon, 9 Dec 2024 10:21:57 -0300 Subject: [PATCH 3/9] Remove show collections setting --- src/components/CollectionList.tsx | 6 +-- src/hooks/useCollectionSearch.ts | 6 +-- src/hooks/useEventsCollections.ts | 43 +++++++++---------- src/models/settings.ts | 2 - src/pages/Event.tsx | 52 +++++++++++------------ src/pages/Events.tsx | 70 +++++++++++++++---------------- src/pages/Settings.tsx | 13 ------ 7 files changed, 81 insertions(+), 111 deletions(-) diff --git a/src/components/CollectionList.tsx b/src/components/CollectionList.tsx index 161f1f2..f697bbf 100644 --- a/src/components/CollectionList.tsx +++ b/src/components/CollectionList.tsx @@ -17,19 +17,19 @@ function CollectionList({ }) { const [showAll, setShowAll] = useState(false) - let showCollections = collections.slice() + let collectionsToShow = collections.slice() const total = collections.length const limit = COLLECTIONS_LIMIT const hasMore = total > limit if (hasMore && !showAll) { - showCollections = showCollections.slice(0, limit) + collectionsToShow = collectionsToShow.slice(0, limit) } return (
    - {showCollections.map((collection) => ( + {collectionsToShow.map((collection) => ( () => void retryCollectionSearch: () => void } { - const { settings } = useSettings() const [loading, setLoading] = useState(false) const [error, setError] = useState(null) const [total, setTotal] = useState(null) @@ -29,7 +27,7 @@ function useCollectionSearch(query?: string, page: number = 1): { setTotal(null) setResultCollections([]) const offset = ((newPage ?? page) - 1) * SEARCH_LIMIT - if (settings.showCollections && (total == null || offset <= total)) { + if (total == null || offset <= total) { controller = new AbortController() setLoading(true) loadSearchCollections( @@ -74,7 +72,7 @@ function useCollectionSearch(query?: string, page: number = 1): { setResultCollections([]) } }, - [query, page, total, settings.showCollections] + [query, page, total] ) function retryCollectionSearch(): void { diff --git a/src/hooks/useEventsCollections.ts b/src/hooks/useEventsCollections.ts index 128ad77..c4efcc2 100644 --- a/src/hooks/useEventsCollections.ts +++ b/src/hooks/useEventsCollections.ts @@ -1,6 +1,5 @@ import { useCallback, useState } from 'react' import { AbortedError } from 'models/error' -import { useSettings } from 'stores/settings' import { findEventsCollections } from 'loaders/collection' function useEventsCollections(eventIds: number[]): { @@ -10,35 +9,31 @@ function useEventsCollections(eventIds: number[]): { relatedCollections: Awaited>['related'] | null fetchEventsCollections: () => () => void } { - const { settings } = useSettings() const [loading, setLoading] = useState(false) const [error, setError] = useState(null) const [result, setResult] = useState> | null>(null) const fetchEventsCollections = useCallback( () => { - let controller: AbortController | undefined - if (settings.showCollections) { - controller = new AbortController() - setLoading(true) - findEventsCollections( - eventIds, - controller.signal - ).then((result) => { - setResult(result) - setLoading(false) - }).catch((err: unknown) => { - setLoading(false) - if (!(err instanceof AbortedError)) { - console.error(err) - if (err instanceof Error) { - setError(err) - } else { - setError(new Error(`Could not load collections`, { cause: err })) - } + const controller = new AbortController() + setLoading(true) + findEventsCollections( + eventIds, + controller.signal + ).then((result) => { + setResult(result) + setLoading(false) + }).catch((err: unknown) => { + setLoading(false) + if (!(err instanceof AbortedError)) { + console.error(err) + if (err instanceof Error) { + setError(err) + } else { + setError(new Error(`Could not load collections`, { cause: err })) } - }) - } + } + }) return () => { if (controller) { controller.abort() @@ -48,7 +43,7 @@ function useEventsCollections(eventIds: number[]): { setResult(null) } }, - [eventIds, settings.showCollections] + [eventIds] ) return { diff --git a/src/models/settings.ts b/src/models/settings.ts index a210b02..4f897b6 100644 --- a/src/models/settings.ts +++ b/src/models/settings.ts @@ -4,7 +4,6 @@ export const DEFAULT_SETTINGS = { showLastEvents: true, openProfiles: true, - showCollections: true, } export interface Settings { @@ -12,5 +11,4 @@ export interface Settings { feedbackShown: boolean showLastEvents: boolean openProfiles: boolean - showCollections: boolean } diff --git a/src/pages/Event.tsx b/src/pages/Event.tsx index 621fc2e..0dc7764 100644 --- a/src/pages/Event.tsx +++ b/src/pages/Event.tsx @@ -239,34 +239,30 @@ function Event() { /> )} - {settings.showCollections && ( - <> - {loadingCollections && collectionsError == null && ( - -

    Collections

    - -
    - )} - {!loadingCollections && collectionsError != null && ( - -

    Collections

    - -
    - )} - {( - !loadingCollections && - collectionsError == null && - collections != null - ) && ( - 0} - emptyMessage={`No collections found that includes ${event.name}`} - collectionMap={{ - [`${collections.length} collections`]: collections, - }} - /> - )} - + {loadingCollections && collectionsError == null && ( + +

    Collections

    + +
    + )} + {!loadingCollections && collectionsError != null && ( + +

    Collections

    + +
    + )} + {( + !loadingCollections && + collectionsError == null && + collections != null + ) && ( + 0} + emptyMessage={`No collections found that includes ${event.name}`} + collectionMap={{ + [`${collections.length} collections`]: collections, + }} + /> )} {completedEventInCommon && loadedOwners === 0 && ( diff --git a/src/pages/Events.tsx b/src/pages/Events.tsx index 9f09a4b..d6d5f11 100644 --- a/src/pages/Events.tsx +++ b/src/pages/Events.tsx @@ -503,44 +503,40 @@ function Events() { )} {completedEventsInCommon && ( <> - {settings.showCollections && ( - <> - {loadingCollections && !collectionsError && ( - -

    Collections

    - -
    - )} - {!loadingCollections && collectionsError && ( - -

    Collections

    - -
    - )} - {( - !loadingCollections && - !collectionsError && - collections != null && - relatedCollections != null - ) && ( - 0} - emptyMessage={( - <> - No collections found that includes exactly all{' '} - {Object.keys(events).length} POAPs,{' '} - - view related collections - . - - )} - collectionMap={{ - [`${collections.length} collections`]: collections, - [`${relatedCollections.length} related collections`]: all ? relatedCollections : [], - }} - /> + {loadingCollections && !collectionsError && ( + +

    Collections

    + +
    + )} + {!loadingCollections && collectionsError && ( + +

    Collections

    + +
    + )} + {( + !loadingCollections && + !collectionsError && + collections != null && + relatedCollections != null + ) && ( + 0} + emptyMessage={( + <> + No collections found that includes exactly all{' '} + {Object.keys(events).length} POAPs,{' '} + + view related collections + . + )} - + collectionMap={{ + [`${collections.length} collections`]: collections, + [`${relatedCollections.length} related collections`]: all ? relatedCollections : [], + }} + /> )} @@ -54,16 +51,6 @@ function Settings() { />
    -
    - -
    - -
    -
    navigate('/')}>back From 69e557318c13e1216b23fc1ee1c6ad92d7357201 Mon Sep 17 00:00:00 2001 From: Juan Date: Mon, 9 Dec 2024 10:22:40 -0300 Subject: [PATCH 4/9] Remove unused use settings --- src/pages/Event.tsx | 2 -- src/pages/Events.tsx | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/pages/Event.tsx b/src/pages/Event.tsx index 0dc7764..0aba8aa 100644 --- a/src/pages/Event.tsx +++ b/src/pages/Event.tsx @@ -1,7 +1,6 @@ import { useContext, useEffect, useMemo, useState } from 'react' import { useLoaderData, useSearchParams } from 'react-router-dom' import { HTMLContext } from 'stores/html' -import { useSettings } from 'stores/settings' import { ReverseEnsContext } from 'stores/ethereum' import { parseDropData } from 'models/drop' import { EnsByAddress } from 'models/ethereum' @@ -27,7 +26,6 @@ import 'styles/event.css' function Event() { const [searchParams, setSearchParams] = useSearchParams() const { setTitle } = useContext(HTMLContext) - const { settings } = useSettings() const { resolveEnsNames } = useContext(ReverseEnsContext) const loaderData = useLoaderData() const [eventsEnsNames, setEventsEnsNames] = useState>({}) diff --git a/src/pages/Events.tsx b/src/pages/Events.tsx index d6d5f11..e550f0c 100644 --- a/src/pages/Events.tsx +++ b/src/pages/Events.tsx @@ -1,7 +1,6 @@ import { useContext, useEffect, useMemo, useState } from 'react' import { Link, useLoaderData, useNavigate, useParams, useSearchParams } from 'react-router-dom' import { formatStat } from 'utils/number' -import { useSettings } from 'stores/settings' import { HTMLContext } from 'stores/html' import { ReverseEnsContext } from 'stores/ethereum' import { mergeAllInCommon } from 'models/in-common' @@ -38,7 +37,6 @@ function Events() { const navigate = useNavigate() const { eventIds: rawEventIds } = useParams() const [searchParams, setSearchParams] = useSearchParams({ all: 'false' }) - const { settings } = useSettings() const { setTitle } = useContext(HTMLContext) const { resolveEnsNames } = useContext(ReverseEnsContext) const loaderData = useLoaderData() From 9e3b2ee0d01d7f423bc466fb7ccacd5181d56e43 Mon Sep 17 00:00:00 2001 From: Juan Date: Mon, 9 Dec 2024 10:24:07 -0300 Subject: [PATCH 5/9] Remove open profiles setting --- src/components/AddressOwner.tsx | 26 +++++++++----------------- src/models/settings.ts | 2 -- src/pages/Settings.tsx | 13 ------------- 3 files changed, 9 insertions(+), 32 deletions(-) diff --git a/src/components/AddressOwner.tsx b/src/components/AddressOwner.tsx index e0cd721..a7fbace 100644 --- a/src/components/AddressOwner.tsx +++ b/src/components/AddressOwner.tsx @@ -1,4 +1,3 @@ -import { useSettings } from 'stores/settings' import { Drop } from 'models/drop' import TokenImage from 'components/TokenImage' import LinkToScan from 'components/LinkToScan' @@ -24,8 +23,6 @@ function AddressOwner({ inCommonAddresses?: string[] linkToScan?: boolean }) { - const { settings } = useSettings() - const hasEvents = ( events != null && typeof events === 'object' && @@ -37,21 +34,16 @@ function AddressOwner({ return (
    - {settings.openProfiles - ? ( - - ) - : - } +
    - {linkToScan && settings.openProfiles && ( + {linkToScan && ( @@ -41,16 +38,6 @@ function Settings() { />
    -
    - -
    - -
    -
    navigate('/')}>back From 824685acd98d962829a3e2dde26fd3ad7c367d54 Mon Sep 17 00:00:00 2001 From: Juan Date: Mon, 9 Dec 2024 10:25:53 -0300 Subject: [PATCH 6/9] Remove show last setting --- src/models/settings.ts | 3 --- src/pages/Home.tsx | 18 ++++++++---------- src/pages/Settings.tsx | 17 ----------------- 3 files changed, 8 insertions(+), 30 deletions(-) diff --git a/src/models/settings.ts b/src/models/settings.ts index 05c2528..c1aac25 100644 --- a/src/models/settings.ts +++ b/src/models/settings.ts @@ -1,12 +1,9 @@ export const DEFAULT_SETTINGS = { welcomeShown: false, feedbackShown: false, - - showLastEvents: true, } export interface Settings { welcomeShown: boolean feedbackShown: boolean - showLastEvents: boolean } diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index 59764a4..d4bb89b 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -29,16 +29,14 @@ function Home() { )} - {settings.showLastEvents && ( - - )} +
    last · diff --git a/src/pages/Settings.tsx b/src/pages/Settings.tsx index bddab89..5feef82 100644 --- a/src/pages/Settings.tsx +++ b/src/pages/Settings.tsx @@ -1,16 +1,13 @@ import { useContext, useEffect } from 'react' import { useNavigate } from 'react-router-dom' -import { useSettings } from 'stores/settings' import { HTMLContext } from 'stores/html' import ButtonLink from 'components/ButtonLink' import Card from 'components/Card' import CenterPage from 'components/CenterPage' -import Switch from 'components/Switch' import 'styles/settings.css' function Settings() { const navigate = useNavigate() - const { settings, setSetting } = useSettings() const { setTitle } = useContext(HTMLContext) useEffect( @@ -20,24 +17,10 @@ function Settings() { [setTitle] ) - function handleShowLastEvents(checked: boolean): void { - setSetting('showLastEvents', checked) - } - return (

    Settings

    -
    - -
    - -
    -
    navigate('/')}>back From de514ac13b5932867b059be0baa6a306f53782c3 Mon Sep 17 00:00:00 2001 From: Juan Date: Mon, 9 Dec 2024 10:27:59 -0300 Subject: [PATCH 7/9] Remove settings page --- src/app/App.tsx | 5 ----- src/pages/Home.tsx | 2 -- src/pages/Settings.tsx | 32 -------------------------------- 3 files changed, 39 deletions(-) delete mode 100644 src/pages/Settings.tsx diff --git a/src/app/App.tsx b/src/app/App.tsx index 1506e55..10f64ce 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -11,7 +11,6 @@ import Addresses from 'pages/Addresses' import Event from 'pages/Event' import Events from 'pages/Events' import Last from 'pages/Last' -import Settings from 'pages/Settings' import FeedbackList from 'pages/FeedbackList' import EventsPageError from 'components/EventsPageError' import PageError from 'components/PageError' @@ -58,10 +57,6 @@ export default function App() { path: '/last', element: , }, - { - path: '/settings', - element: , - }, { element: , children: [ diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index d4bb89b..dd97a79 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -40,8 +40,6 @@ function Home() {
    last · - settings - · { - setTitle('Settings') - }, - [setTitle] - ) - - return ( - - -

    Settings

    -
    -
    - navigate('/')}>back -
    -
    - ) -} - -export default Settings From 6e43c22e932eec09d53dad9685e4c0e4b1afd88c Mon Sep 17 00:00:00 2001 From: Juan Date: Mon, 9 Dec 2024 10:32:04 -0300 Subject: [PATCH 8/9] Fix settings loading --- src/stores/settings.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/stores/settings.tsx b/src/stores/settings.tsx index 49728e2..2c3ca1e 100644 --- a/src/stores/settings.tsx +++ b/src/stores/settings.tsx @@ -22,14 +22,16 @@ export const useSettings = () => useContext(SettingsContext) export function SettingsProvider({ children }: { children: ReactNode }) { const [settings, setSettings] = useState(DEFAULT_SETTINGS) + const [loaded, setLoaded] = useState(false) useEffect( () => { - if (settings === null) { + if (loaded === false) { setSettings({ ...DEFAULT_SETTINGS, ...getSettings() }) + setLoaded(true) } }, - [settings] + [settings, loaded] ) const setSetting = useCallback( From b013352d2044b34bf2b1aef94a2cbfbaf50989dd Mon Sep 17 00:00:00 2001 From: Juan Date: Mon, 9 Dec 2024 10:41:38 -0300 Subject: [PATCH 9/9] Version 1.18 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5e03a06..4c1aa29 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@poap-xyz/poap-family", - "version": "1.17.3", + "version": "1.18.0", "author": { "name": "POAP", "url": "https://poap.xyz"