diff --git a/src/common-help.json b/src/common-help.json index cbde705e77..8a3e1de1fb 100644 --- a/src/common-help.json +++ b/src/common-help.json @@ -1,4 +1,5 @@ { "common-help": { + "helpToggleInfo": "This toggle will enable / disable part of the help info in the console. Includes any help text, links and popovers." } } diff --git a/src/components/help-enabler/HelpHeader.tsx b/src/components/help-enabler/HelpHeader.tsx index 07e9032a13..9848a12db8 100644 --- a/src/components/help-enabler/HelpHeader.tsx +++ b/src/components/help-enabler/HelpHeader.tsx @@ -1,15 +1,19 @@ import React, { useState, useContext, ReactNode, createContext } from "react"; import { + Divider, Dropdown, DropdownItem, DropdownToggle, Split, SplitItem, Switch, + TextContent, } from "@patternfly/react-core"; import { Trans, useTranslation } from "react-i18next"; import { HelpIcon, ExternalLinkAltIcon } from "@patternfly/react-icons"; +import "./help-header.css"; + type HelpProps = { children: ReactNode; }; @@ -51,16 +55,8 @@ export const HelpHeader = () => { , - - This toggle will enable / disable part of the help info in the - console. Includes any help text, links and popovers. - - } - > + , + {t("enableHelpMode")} @@ -68,10 +64,15 @@ export const HelpHeader = () => { id="enableHelp" aria-label="Help is enabled" isChecked={help.enabled} + label="" + className="keycloak_help-header-switch" onChange={() => help.toggleHelp()} /> + + {t("common-help:helpToggleInfo")} + , ]; return ( diff --git a/src/components/help-enabler/__tests__/__snapshots__/HelpHeader.test.tsx.snap b/src/components/help-enabler/__tests__/__snapshots__/HelpHeader.test.tsx.snap index c0a7d5bdd4..11c9cb04e6 100644 --- a/src/components/help-enabler/__tests__/__snapshots__/HelpHeader.test.tsx.snap +++ b/src/components/help-enabler/__tests__/__snapshots__/HelpHeader.test.tsx.snap @@ -80,75 +80,65 @@ exports[` enable help 1`] = ` +
@@ -242,75 +232,65 @@ exports[` open dropdown 1`] = ` +
diff --git a/src/components/help-enabler/help-header.css b/src/components/help-enabler/help-header.css new file mode 100644 index 0000000000..44029ad2f8 --- /dev/null +++ b/src/components/help-enabler/help-header.css @@ -0,0 +1,16 @@ + + +.keycloak_help-header-description { + padding-top: var(--pf-global--spacer--lg); + overflow-wrap: break-word; + white-space: normal; + color: var(--pf-c-dropdown__menu-item--Color); +} + +.keycloak_help-header-switch { + margin-left: var(--pf-global--spacer--xl); +} + +.keycloak_help-header-switch .pf-c-switch__toggle::before { + background-color: var(--pf-c-switch__toggle-icon--Color); +}