-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9854 from marmelab/crm-changes
[Demo] Improve CRM demo
- Loading branch information
Showing
18 changed files
with
415 additions
and
159 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
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
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
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
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
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 |
---|---|---|
@@ -1,37 +1,41 @@ | ||
import * as React from 'react'; | ||
import { CreateBase, Form, Toolbar } from 'react-admin'; | ||
import { CreateBase, Form, Toolbar, useGetIdentity } from 'react-admin'; | ||
import { Card, CardContent, Box, Avatar } from '@mui/material'; | ||
|
||
import { ContactInputs } from './ContactInputs'; | ||
import { Contact } from '../types'; | ||
|
||
export const ContactCreate = () => ( | ||
<CreateBase | ||
redirect="show" | ||
transform={(data: Contact) => ({ | ||
...data, | ||
last_seen: new Date(), | ||
tags: [], | ||
})} | ||
> | ||
<Box mt={2} display="flex"> | ||
<Box flex="1"> | ||
<Form> | ||
<Card> | ||
<CardContent> | ||
<Box> | ||
<Box display="flex"> | ||
<Box mr={2}> | ||
<Avatar /> | ||
export const ContactCreate = () => { | ||
const { identity } = useGetIdentity(); | ||
return ( | ||
<CreateBase | ||
redirect="show" | ||
transform={(data: Contact) => ({ | ||
...data, | ||
first_seen: new Date().toISOString(), | ||
last_seen: new Date().toISOString(), | ||
tags: [], | ||
})} | ||
> | ||
<Box mt={2} display="flex"> | ||
<Box flex="1"> | ||
<Form defaultValues={{ sales_id: identity?.id }}> | ||
<Card> | ||
<CardContent> | ||
<Box> | ||
<Box display="flex"> | ||
<Box mr={2}> | ||
<Avatar /> | ||
</Box> | ||
<ContactInputs /> | ||
</Box> | ||
<ContactInputs /> | ||
</Box> | ||
</Box> | ||
</CardContent> | ||
<Toolbar /> | ||
</Card> | ||
</Form> | ||
</CardContent> | ||
<Toolbar /> | ||
</Card> | ||
</Form> | ||
</Box> | ||
</Box> | ||
</Box> | ||
</CreateBase> | ||
); | ||
</CreateBase> | ||
); | ||
}; |
Oops, something went wrong.