-
-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add stroy testing view customization
- Loading branch information
1 parent
d1b4893
commit 213badd
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import React from 'react'; | ||
import { HydraAdmin } from '../hydra'; | ||
import ResourceGuesser from '../core/ResourceGuesser'; | ||
import ListGuesser from '../list/ListGuesser'; | ||
import ShowGuesser from '../show/ShowGuesser'; | ||
import FieldGuesser from '../field/FieldGuesser'; | ||
import EditGuesser from '../edit/EditGuesser'; | ||
import InputGuesser from '../input/InputGuesser'; | ||
import CreateGuesser from '../create/CreateGuesser'; | ||
|
||
export default { | ||
title: 'Admin/Custom', | ||
parameters: { | ||
layout: 'fullscreen', | ||
}, | ||
}; | ||
|
||
const GreetingList = () => ( | ||
<ListGuesser> | ||
<FieldGuesser source="name" label="Identity" /> | ||
</ListGuesser> | ||
); | ||
|
||
const GreetingShow = () => ( | ||
<ShowGuesser> | ||
<FieldGuesser source="name" label="Identity" /> | ||
</ShowGuesser> | ||
); | ||
|
||
const GreetingEdit = () => ( | ||
<EditGuesser> | ||
<InputGuesser source="name" label="Identity" /> | ||
</EditGuesser> | ||
); | ||
|
||
const GreetingCreate = () => ( | ||
<CreateGuesser> | ||
<InputGuesser source="name" label="Identity" /> | ||
</CreateGuesser> | ||
); | ||
|
||
export const Custom = () => ( | ||
<HydraAdmin entrypoint={process.env.ENTRYPOINT}> | ||
<ResourceGuesser | ||
name="greetings" | ||
options={{ label: 'Salutation' }} | ||
list={GreetingList} | ||
show={GreetingShow} | ||
edit={GreetingEdit} | ||
create={GreetingCreate} | ||
/> | ||
</HydraAdmin> | ||
); |