mirror of
https://github.com/Qortal/qapp-core.git
synced 2025-06-15 09:51:21 +00:00
change params to search
This commit is contained in:
parent
dcfe746b5b
commit
e5eff9827a
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "qapp-core",
|
"name": "qapp-core",
|
||||||
"version": "1.0.3",
|
"version": "1.0.4",
|
||||||
"description": "Qortal's core React library with global state, UI components, and utilities",
|
"description": "Qortal's core React library with global state, UI components, and utilities",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"module": "dist/index.mjs",
|
"module": "dist/index.mjs",
|
||||||
|
@ -45,7 +45,7 @@ interface DefaultLoaderParams {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface BaseProps {
|
interface BaseProps {
|
||||||
params: QortalSearchParams;
|
search: QortalSearchParams;
|
||||||
listItem: (item: ListItem, index: number) => React.ReactNode;
|
listItem: (item: ListItem, index: number) => React.ReactNode;
|
||||||
styles?: ResourceListStyles;
|
styles?: ResourceListStyles;
|
||||||
loaderItem?: (status: "LOADING" | "ERROR") => React.ReactNode;
|
loaderItem?: (status: "LOADING" | "ERROR") => React.ReactNode;
|
||||||
@ -73,7 +73,7 @@ interface NonVirtualizedProps extends BaseProps {
|
|||||||
type PropsResourceListDisplay = VirtualizedProps | NonVirtualizedProps;
|
type PropsResourceListDisplay = VirtualizedProps | NonVirtualizedProps;
|
||||||
|
|
||||||
export const MemorizedComponent = ({
|
export const MemorizedComponent = ({
|
||||||
params,
|
search,
|
||||||
listItem,
|
listItem,
|
||||||
styles = {
|
styles = {
|
||||||
gap: 1,
|
gap: 1,
|
||||||
@ -91,7 +91,7 @@ export const MemorizedComponent = ({
|
|||||||
const { fetchResources } = useResources();
|
const { fetchResources } = useResources();
|
||||||
const { getTemporaryResources, filterOutDeletedResources } = useCacheStore();
|
const { getTemporaryResources, filterOutDeletedResources } = useCacheStore();
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const memoizedParams = useMemo(() => JSON.stringify(params), [params]);
|
const memoizedParams = useMemo(() => JSON.stringify(search), [search]);
|
||||||
const addList = useListStore().addList
|
const addList = useListStore().addList
|
||||||
const addItems = useListStore().addItems
|
const addItems = useListStore().addItems
|
||||||
const getListByName = useListStore().getListByName
|
const getListByName = useListStore().getListByName
|
||||||
@ -315,7 +315,7 @@ function arePropsEqual(
|
|||||||
prevProps.disableVirtualization === nextProps.disableVirtualization &&
|
prevProps.disableVirtualization === nextProps.disableVirtualization &&
|
||||||
prevProps.direction === nextProps.direction &&
|
prevProps.direction === nextProps.direction &&
|
||||||
prevProps.onSeenLastItem === nextProps.onSeenLastItem &&
|
prevProps.onSeenLastItem === nextProps.onSeenLastItem &&
|
||||||
JSON.stringify(prevProps.params) === JSON.stringify(nextProps.params) &&
|
JSON.stringify(prevProps.search) === JSON.stringify(nextProps.search) &&
|
||||||
JSON.stringify(prevProps.styles) === JSON.stringify(nextProps.styles)
|
JSON.stringify(prevProps.styles) === JSON.stringify(nextProps.styles)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user