Skip to content

Commit

Permalink
fix: ToggleThemeButton deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Mar 6, 2024
1 parent b3669b3 commit 76fd093
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
40 changes: 40 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,46 @@ Then, if it appears that it's a real bug, you may report it using GitHub by foll

Please base your changes on the `master` branch.


### Testing Changes With the Distribution

Start your project:

```console
docker compose up --wait
```

Clone the API Platform Admin repository:

```console
git clone https://github.com/api-platform/admin.git
```

Start your distribution-based project:

```console
cd <your-project>
docker compose up --wait
```

Change the entrypoint of the API to use the one served by Docker in `pwa/pages/admin/index.tsx`:

```patch
- setDynamicAdmin(<HydraAdmin entrypoint={window.origin}></HydraAdmin>);
+ setDynamicAdmin(<HydraAdmin entrypoint="https://localhost"</HydraAdmin>);
```

Link your local version of API Plarform Admin and start the PWA locally (outside Docker):

```console
cd pwa/
pnpm link ../../admin
pnpm run dev
```




### Installing the Source Version

To install the source version of API Platform Admin in your project and contribute a patch, follow the instructions below.
Expand Down
3 changes: 1 addition & 2 deletions src/layout/AppBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import type { AppBarProps } from 'react-admin';
import { Box, Typography } from '@mui/material';

import Logo from './Logo.js';
import { darkTheme, lightTheme } from './themes.js';

const CustomAppBar = ({ classes, userMenu, ...props }: AppBarProps) => {
const authProvider = useAuthProvider();
Expand All @@ -24,7 +23,7 @@ const CustomAppBar = ({ classes, userMenu, ...props }: AppBarProps) => {
/>
<Logo />
<Box component="span" sx={{ flex: 1 }} />
<ToggleThemeButton lightTheme={lightTheme} darkTheme={darkTheme} />
<ToggleThemeButton />
</AppBar>
);
};
Expand Down

0 comments on commit 76fd093

Please sign in to comment.