-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added real-time notification data with Prisma and React Admin
- Loading branch information
1 parent
528c9aa
commit 96b4382
Showing
4 changed files
with
64 additions
and
3 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,41 @@ | ||
// | ||
// Composant de gestion des notifications. | ||
// | ||
import { List, | ||
Datagrid, | ||
DateField, | ||
NumberField, | ||
ReferenceField } from "react-admin"; | ||
|
||
// Affichage des notification. | ||
export function NotificationList() | ||
{ | ||
return ( | ||
<List> | ||
<Datagrid bulkActionButtons={false}> | ||
{/* Numéro de la notification */} | ||
<NumberField source="id" label="Numéro" /> | ||
|
||
{/* Relation avec l'utilisateur */} | ||
<ReferenceField | ||
label="Utilisateur" | ||
source="userId" | ||
reference="user" | ||
/> | ||
|
||
{/* Identifiant du titre de la notification */} | ||
<NumberField label="Titre" source="title" /> | ||
|
||
{/* Identifiant de la description de la notification */} | ||
<NumberField label="Description" source="description" /> | ||
|
||
{/* Date de création de la notification */} | ||
<DateField | ||
label="Date de création" | ||
source="createdAt" | ||
showTime | ||
/> | ||
</Datagrid> | ||
</List> | ||
); | ||
} |
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