Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Dark Themes does not work with React Admin Enterprise #596

Copy link
Copy link
@gplanchat

Description

@gplanchat
Issue body actions

API Platform version(s) affected: @api-platform/admin 3.4.9

Description

It is not possible to configure the light and dark themes when using React Admin Enterprise, the Dark Theme parameters are lost in the process and we only get a broken standard dark theme on most parts of the application.

How to reproduce

import {HydraAdmin} from "@api-platform/admin"
import {houseDarkTheme, houseLightTheme} from "react-admin"
import {Admin} from "@react-admin/ra-enterprise"
import {SolarLayout} from "@react-admin/ra-navigation";

const GyroscopsLoader = ({ entrypoint, ...rest }: DashboardLoaderProps) => {
  return (
    <HydraAdmin
      admin={Admin}
      dataProvider={dataProvider}
      entrypoint={entrypoint}
      layout={SolarLayout}
      lightTheme={houseLightTheme}
      darkTheme={houseDarkTheme}
      defaultTheme="light"
      {{...rest}}
    >
   // Resources here
   </HydraAdmin>
  )
}

Possible Solution

In the AdminGuesser.tsx file, the AdminGuesser component does override anything we could set inside the darkTheme prop with the default APIP dark theme. It may be fixed by fixing this forced override.

Additional Context
#403

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.