Updated hooks. Changed url, host to path, hostname.
This commit is contained in:
@@ -31,7 +31,7 @@ export function DataGrid({
|
||||
const { page, pageSize, count, data } = result || {};
|
||||
const { search } = params || {};
|
||||
const hasData = Boolean(!isLoading && data?.length);
|
||||
const { router, renderUrl } = useNavigation();
|
||||
const { router, updateParams } = useNavigation();
|
||||
|
||||
const handleSearch = (search: string) => {
|
||||
setParams({ ...params, search });
|
||||
@@ -39,7 +39,7 @@ export function DataGrid({
|
||||
|
||||
const handlePageChange = (page: number) => {
|
||||
setParams({ ...params, page });
|
||||
router.push(renderUrl({ page }));
|
||||
router.push(updateParams({ page }));
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -47,7 +47,7 @@ export function FilterEditForm({ websiteId, data = [], onChange, onClose }: Filt
|
||||
};
|
||||
|
||||
return (
|
||||
<Grid columns="160px 1fr" width="760px" gapY="6">
|
||||
<Grid columns="160px 1fr" width="760px" overflow="hidden" gapY="6">
|
||||
<Row gridColumn="span 2">
|
||||
<Heading>{formatMessage(labels.filters)}</Heading>
|
||||
</Row>
|
||||
@@ -64,7 +64,13 @@ export function FilterEditForm({ websiteId, data = [], onChange, onClose }: Filt
|
||||
})}
|
||||
</List>
|
||||
</Column>
|
||||
<Column paddingLeft="6" overflow="auto" gapY="4">
|
||||
<Column
|
||||
paddingLeft="6"
|
||||
overflow="auto"
|
||||
gapY="4"
|
||||
maxHeight="600px"
|
||||
style={{ contain: 'layout' }}
|
||||
>
|
||||
{filters.map(filter => {
|
||||
return (
|
||||
<FilterRecord
|
||||
|
||||
@@ -24,7 +24,7 @@ export function FilterLink({
|
||||
className,
|
||||
}: FilterLinkProps) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { renderUrl, query } = useNavigation();
|
||||
const { updateParams, query } = useNavigation();
|
||||
const active = query[id] !== undefined;
|
||||
const selected = query[id] === value;
|
||||
|
||||
@@ -38,7 +38,7 @@ export function FilterLink({
|
||||
{children}
|
||||
{!value && `(${label || formatMessage(labels.unknown)})`}
|
||||
{value && (
|
||||
<Link href={renderUrl({ [id]: `eq.${value}` })} className={styles.label} replace>
|
||||
<Link href={updateParams({ [id]: `eq.${value}` })} className={styles.label} replace>
|
||||
{label || value}
|
||||
</Link>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user