removed the Guessers
This commit is contained in:
22
src/App.tsx
22
src/App.tsx
@@ -1,7 +1,7 @@
|
|||||||
import { Admin, ListGuesser, Resource, ShowGuesser } from "react-admin";
|
import { Admin, Resource,} from "react-admin";
|
||||||
//import { Layout } from "./Layout";//
|
//import { Layout } from "./Layout";//
|
||||||
import { dataProvider } from "./dataProvider";
|
import { dataProvider } from "./dataProvider";
|
||||||
import { UserList } from "./components/users/Users.tsx";
|
import { UserList } from "./components/users/UserList.tsx";
|
||||||
import { UserEdit } from "./components/users/UserEdit.tsx";
|
import { UserEdit } from "./components/users/UserEdit.tsx";
|
||||||
import { PostEdit } from "./components/posts/PostEdit.tsx";
|
import { PostEdit } from "./components/posts/PostEdit.tsx";
|
||||||
import { CommentEdit } from "./components/comments/CommentEdit.tsx";
|
import { CommentEdit } from "./components/comments/CommentEdit.tsx";
|
||||||
@@ -12,6 +12,11 @@ import { UserShow } from "./components/users/UserShow.tsx";
|
|||||||
import { CommentShow } from "./components/comments/CommentShow.tsx";
|
import { CommentShow } from "./components/comments/CommentShow.tsx";
|
||||||
import { PostShow } from "./components/posts/PostShow.tsx";
|
import { PostShow } from "./components/posts/PostShow.tsx";
|
||||||
import { PostList } from "./components/posts/PostList.tsx";
|
import { PostList } from "./components/posts/PostList.tsx";
|
||||||
|
import { CommentList } from "./components/comments/CommentList.tsx";
|
||||||
|
import { AlbumList } from "./components/albums/AlbumList.tsx";
|
||||||
|
import { PhotoList } from "./components/photos/PhotoList.tsx";
|
||||||
|
import { PhotoShow } from "./components/photos/PhotoShow.tsx";
|
||||||
|
import { AlbumShow } from "./components/albums/AlbumShow.tsx";
|
||||||
|
|
||||||
export const App = () => (
|
export const App = () => (
|
||||||
<Admin layout={MyLayout} dataProvider={dataProvider}>
|
<Admin layout={MyLayout} dataProvider={dataProvider}>
|
||||||
@@ -19,21 +24,24 @@ export const App = () => (
|
|||||||
<Resource name="posts" list={PostList} edit={PostEdit} show={PostShow} />
|
<Resource name="posts" list={PostList} edit={PostEdit} show={PostShow} />
|
||||||
<Resource
|
<Resource
|
||||||
name="comments"
|
name="comments"
|
||||||
list={ListGuesser}
|
list={CommentList}
|
||||||
edit={CommentEdit}
|
edit={CommentEdit}
|
||||||
show={CommentShow}
|
show={CommentShow}
|
||||||
/>
|
/>
|
||||||
<Resource
|
<Resource
|
||||||
name="albums"
|
name="albums"
|
||||||
list={ListGuesser}
|
list={AlbumList}
|
||||||
edit={AlbumEdit}
|
edit={AlbumEdit}
|
||||||
show={ShowGuesser}
|
show={AlbumShow}
|
||||||
/>
|
/>
|
||||||
<Resource
|
<Resource
|
||||||
name="photos"
|
name="photos"
|
||||||
list={ListGuesser}
|
list={PhotoList}
|
||||||
edit={PhotoEdit}
|
edit={PhotoEdit}
|
||||||
show={ShowGuesser}
|
show={PhotoShow}
|
||||||
/>
|
/>
|
||||||
</Admin>
|
</Admin>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// ShowGuesser, EditGuesser, ListGuesser //
|
||||||
11
src/components/albums/AlbumList.tsx
Normal file
11
src/components/albums/AlbumList.tsx
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { Datagrid, List, ReferenceField, TextField } from 'react-admin';
|
||||||
|
|
||||||
|
export const AlbumList = () => (
|
||||||
|
<List>
|
||||||
|
<Datagrid>
|
||||||
|
<ReferenceField source="userId" reference="users" />
|
||||||
|
<TextField source="id" />
|
||||||
|
<TextField source="title" />
|
||||||
|
</Datagrid>
|
||||||
|
</List>
|
||||||
|
);
|
||||||
11
src/components/albums/AlbumShow.tsx
Normal file
11
src/components/albums/AlbumShow.tsx
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { ReferenceField, Show, SimpleShowLayout, TextField } from 'react-admin';
|
||||||
|
|
||||||
|
export const AlbumShow = () => (
|
||||||
|
<Show>
|
||||||
|
<SimpleShowLayout>
|
||||||
|
<ReferenceField source="userId" reference="users" />
|
||||||
|
<TextField source="id" />
|
||||||
|
<TextField source="title" />
|
||||||
|
</SimpleShowLayout>
|
||||||
|
</Show>
|
||||||
|
);
|
||||||
13
src/components/comments/CommentList.tsx
Normal file
13
src/components/comments/CommentList.tsx
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { Datagrid, EmailField, List, ReferenceField, TextField } from 'react-admin';
|
||||||
|
|
||||||
|
export const CommentList = () => (
|
||||||
|
<List>
|
||||||
|
<Datagrid>
|
||||||
|
<ReferenceField source="postId" reference="posts" />
|
||||||
|
<TextField source="id" />
|
||||||
|
<TextField source="name" />
|
||||||
|
<EmailField source="email" />
|
||||||
|
<TextField source="body" />
|
||||||
|
</Datagrid>
|
||||||
|
</List>
|
||||||
|
);
|
||||||
13
src/components/photos/PhotoList.tsx
Normal file
13
src/components/photos/PhotoList.tsx
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { Datagrid, List, ReferenceField, TextField, UrlField } from 'react-admin';
|
||||||
|
|
||||||
|
export const PhotoList = () => (
|
||||||
|
<List>
|
||||||
|
<Datagrid>
|
||||||
|
<ReferenceField source="albumId" reference="albums" />
|
||||||
|
<TextField source="id" />
|
||||||
|
<TextField source="title" />
|
||||||
|
<UrlField source="url" />
|
||||||
|
<TextField source="thumbnailUrl" />
|
||||||
|
</Datagrid>
|
||||||
|
</List>
|
||||||
|
);
|
||||||
13
src/components/photos/PhotoShow.tsx
Normal file
13
src/components/photos/PhotoShow.tsx
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { ReferenceField, Show, SimpleShowLayout, TextField, UrlField } from 'react-admin';
|
||||||
|
|
||||||
|
export const PhotoShow = () => (
|
||||||
|
<Show>
|
||||||
|
<SimpleShowLayout>
|
||||||
|
<ReferenceField source="albumId" reference="albums" />
|
||||||
|
<TextField source="id" />
|
||||||
|
<TextField source="title" />
|
||||||
|
<UrlField source="url" />
|
||||||
|
<TextField source="thumbnailUrl" />
|
||||||
|
</SimpleShowLayout>
|
||||||
|
</Show>
|
||||||
|
);
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// in src/Users.tsx
|
// in src/UserList.tsx
|
||||||
import { useMediaQuery } from "@mui/material";
|
import { useMediaQuery } from "@mui/material";
|
||||||
import { List, SimpleList, Datagrid, TextField, EmailField, } from "react-admin";
|
import { List, SimpleList, Datagrid, TextField, EmailField, } from "react-admin";
|
||||||
|
|
||||||
Reference in New Issue
Block a user