re-enables custom List view after rolling back changes to Routes.js
This commit is contained in:
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
|
||||
import {
|
||||
Route, Switch, withRouter, Redirect,
|
||||
} from 'react-router-dom';
|
||||
import List from './views/collections/List';
|
||||
import DefaultList from './views/collections/List';
|
||||
import config from '../config/sanitizedClientConfig';
|
||||
import { useUser } from './data/User';
|
||||
import Dashboard from './views/Dashboard';
|
||||
@@ -82,9 +82,9 @@ const Routes = () => {
|
||||
path={`${match.url}/collections/${collection.slug}`}
|
||||
exact
|
||||
render={(routeProps) => {
|
||||
const ListComponent = (customComponents[collection.slug] && customComponents[collection.slug].List) ? customComponents[collection.slug].List : List;
|
||||
const List = customComponents[collection.slug]?.views?.List || DefaultList;
|
||||
return (
|
||||
<ListComponent
|
||||
<List
|
||||
{...routeProps}
|
||||
collection={collection}
|
||||
/>
|
||||
|
||||
@@ -38,8 +38,6 @@ const EditView = (props) => {
|
||||
});
|
||||
} : null;
|
||||
|
||||
console.log(isEditing);
|
||||
|
||||
const [{ data }] = usePayloadAPI(
|
||||
(isEditing ? `${serverURL}/${collection.slug}/${id}` : null),
|
||||
{ initialParams: { 'fallback-locale': 'null' } },
|
||||
|
||||
Reference in New Issue
Block a user