diff --git a/src/PageNav.tsx b/src/PageNav.tsx index fbf69505a2..7dbff51d86 100644 --- a/src/PageNav.tsx +++ b/src/PageNav.tsx @@ -1,6 +1,12 @@ import React, { useState, useContext } from "react"; import { useHistory } from "react-router-dom"; -import { Nav, NavItem, NavGroup, PageSidebar } from "@patternfly/react-core"; +import { + Nav, + NavItem, + NavGroup, + NavList, + PageSidebar, +} from "@patternfly/react-core"; import { RealmSelector } from "./components/realm-selector/RealmSelector"; import { DataLoader } from "./components/data-loader/DataLoader"; import { HttpClientContext } from "./http-service/HttpClientContext"; @@ -49,11 +55,15 @@ export const PageNav: React.FunctionComponent = () => { - - {(realmList) => ( - - )} - + + + + {(realmList) => ( + + )} + + + {makeNavItem("Clients", "clients")} {makeNavItem("Client Scopes", "client-scopes")} diff --git a/src/components/realm-selector/RealmSelector.tsx b/src/components/realm-selector/RealmSelector.tsx index 65e8b5e8c2..2f46dd1363 100644 --- a/src/components/realm-selector/RealmSelector.tsx +++ b/src/components/realm-selector/RealmSelector.tsx @@ -10,7 +10,7 @@ import { Divider, } from "@patternfly/react-core"; -import style from "./realm-selector.module.css"; +import "./realm-selector.css"; type RealmSelectorProps = { realm: string; @@ -37,13 +37,13 @@ export const RealmSelector = ({ realm, realmList }: RealmSelectorProps) => { return ( setOpen(!open)} - className={style.toggle} + className="keycloak__realm_selector_dropdown__toggle" > {currentRealm} diff --git a/src/components/realm-selector/__tests__/__snapshots__/RealmSelector.test.tsx.snap b/src/components/realm-selector/__tests__/__snapshots__/RealmSelector.test.tsx.snap index fbe693e3e7..2cda4377f6 100644 --- a/src/components/realm-selector/__tests__/__snapshots__/RealmSelector.test.tsx.snap +++ b/src/components/realm-selector/__tests__/__snapshots__/RealmSelector.test.tsx.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renders realm selector 1`] = `"
"`; +exports[`renders realm selector 1`] = `"
"`; diff --git a/src/components/realm-selector/realm-selector.css b/src/components/realm-selector/realm-selector.css new file mode 100644 index 0000000000..904928be03 --- /dev/null +++ b/src/components/realm-selector/realm-selector.css @@ -0,0 +1,30 @@ +.keycloak__realm_selector_dropdown__toggle { + --pf-c-dropdown__toggle--Color: var(--pf-c-nav__link--m-current--Color); + --pf-c-dropdown__toggle--BackgroundColor: var( + --pf-global--BackgroundColor--dark-100 + ); + --pf-c-dropdown__toggle--before--BorderTopColor: var( + --pf-global--BorderColor--200 + ); + --pf-c-dropdown__toggle--before--BorderRightColor: var( + --pf-global--BorderColor--200 + ); + --pf-c-dropdown__toggle--before--BorderBottomColor: var( + --pf-global--BorderColor--100 + ); + --pf-c-dropdown__toggle--before--BorderLeftColor: var( + --pf-global--BorderColor--200 + ); + width: 100%; +} + +.keycloak__realm_selector__dropdown { + width: 100%; +} + +.keycloak__page_nav__nav_item__realm-selector { + margin-top: var(--pf-c-nav__link--PaddingTop); + padding-right: var(--pf-c-nav__link--PaddingRight); + margin-bottom: var(--pf-c-nav__link--PaddingBottom); + padding-left: var(--pf-c-nav__link--PaddingLeft); +} diff --git a/src/components/realm-selector/realm-selector.module.css b/src/components/realm-selector/realm-selector.module.css deleted file mode 100644 index 8ed60c559e..0000000000 --- a/src/components/realm-selector/realm-selector.module.css +++ /dev/null @@ -1,32 +0,0 @@ - -.dropdown { - width: 100%; - padding: 32px; - border-bottom: 1px solid var(--pf-c-nav__link--before--BorderColor); - - outline: 1px solid var(--pf-global--Color--200); - outline-offset:-32px; -} - -.menu { - /* setting this to 85% for now */ - min-width: 85%; -} - -.pf-c-button.pf-m-primary.realmSelectButton { - width: 100%; -} - -.toggle { - color: var(--pf-c-nav__link--m-current--Color); - width: 100%; - background: var(--pf-global--BackgroundColor--dark-100); -} - -.toggle:focus { - outline:0; -} - -.toggle::before { - border: none; -}