Skip to content

Commit

Permalink
fix: ToggleThemeButton deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas authored and soyuka committed Mar 6, 2024
1 parent fed62d6 commit 83ecd8b
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 69 deletions.
42 changes: 39 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,43 @@ Then, if it appears that it's a real bug, you may report it using GitHub by foll

Please base your changes on the `main` branch.

### Two ways to write your patch
### 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

You can patch `@api-platform/admin` by two different ways:
- by linking `@api-platform/admin` sources to an existing project;
Expand All @@ -38,7 +74,7 @@ If you already have a project in progress, you can develop directly from it.

The instructions below explain how to install the source version of API Platform Admin in your project and contribute a patch.

Your client should already uses `@api-platform/admin` and its bootstrap file (usually: `src/App.tsx`) should at least contains:
Your client should already uses `@api-platform/admin` and its bootstrap file (usually: `src/App.tsx`) should at least contains:

```tsx
import React from 'react';
Expand Down Expand Up @@ -107,7 +143,7 @@ Install everything:
cd admin
# Install JS dependencies
make install
# (optional) Initizalize a .env containing the URL of the API
# (optional) Initizalize a .env containing the URL of the API
make cp-env
```

Expand Down
141 changes: 75 additions & 66 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 83ecd8b

Please sign in to comment.