-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Add support for React 19 #10437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for React 19 #10437
Changes from all commits
53de163
cefb098
6ac6fa4
8d6fd0e
c4775c9
c4765ef
228a9a4
7758372
5be5a2d
dcad47f
91774e5
f800993
49497ad
a42f048
152a586
c36525e
ccd047d
6c93dc4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,7 +47,7 @@ const App = () => { | |
| const darkTheme = themes.find(theme => theme.name === themeName)?.dark; | ||
| return ( | ||
| <Admin | ||
| title="" | ||
| title="Posters Galore Admin" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added to access it in custom titles |
||
| dataProvider={dataProviderFactory( | ||
| process.env.REACT_APP_DATA_PROVIDER || '' | ||
| )} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,8 @@ import { | |
| TextInput, | ||
| useTranslate, | ||
| useRecordContext, | ||
| useDefaultTitle, | ||
| useGetResourceLabel, | ||
| } from 'react-admin'; | ||
|
|
||
| import ThumbnailField from '../products/ThumbnailField'; | ||
|
|
@@ -59,14 +61,21 @@ const CategoryEdit = () => ( | |
| ); | ||
|
|
||
| const CategoryTitle = () => { | ||
| const appTitle = useDefaultTitle(); | ||
| const record = useRecordContext<Category>(); | ||
| const translate = useTranslate(); | ||
| const getResourceLabel = useGetResourceLabel(); | ||
|
|
||
| const pageTitle = translate('ra.page.edit', { | ||
| name: getResourceLabel('categories', 1), | ||
| recordRepresentation: `"${record?.name}"`, | ||
| }); | ||
|
Comment on lines
+69
to
+72
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did not use |
||
|
|
||
| return record ? ( | ||
| <span> | ||
| {translate('resources.categories.name', { smart_count: 1 })} " | ||
| {record.name}" | ||
| </span> | ||
| <> | ||
| <title>{`${appTitle} - ${pageTitle}`}</title> | ||
| <span>{pageTitle}</span> | ||
| </> | ||
| ) : null; | ||
| }; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,9 @@ import { | |
| TextField, | ||
| TextInput, | ||
| useRecordContext, | ||
| useDefaultTitle, | ||
| useTranslate, | ||
| useGetResourceLabel, | ||
| } from 'react-admin'; | ||
| import PhotoCameraIcon from '@mui/icons-material/PhotoCamera'; | ||
| import AspectRatioIcon from '@mui/icons-material/AspectRatio'; | ||
|
|
@@ -32,8 +35,21 @@ const RichTextInput = React.lazy(() => | |
| ); | ||
|
|
||
| const ProductTitle = () => { | ||
| const appTitle = useDefaultTitle(); | ||
| const translate = useTranslate(); | ||
| const record = useRecordContext<Product>(); | ||
| return record ? <span>Poster "{record.reference}"</span> : null; | ||
| const getResourceLabel = useGetResourceLabel(); | ||
|
|
||
| const pageTitle = translate('ra.page.edit', { | ||
| name: getResourceLabel('products', 1), | ||
| recordRepresentation: `"${record?.reference}"`, | ||
| }); | ||
|
Comment on lines
+43
to
+46
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did not use |
||
| return record ? ( | ||
| <> | ||
| <title>{`${appTitle} - ${pageTitle}`}</title> | ||
| <span>{pageTitle}</span> | ||
| </> | ||
| ) : null; | ||
| }; | ||
|
|
||
| const ProductEdit = () => ( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.