1
0
mirror of https://github.com/quay/quay.git synced 2026-01-26 06:21:37 +03:00

[redhat-3.15] ui: show custom REGISTRY_TITLE on login page (PROJQUAY-9522) (#4335)

ui: show custom REGISTRY_TITLE on login page (PROJQUAY-9461)

the old UI shows this value in the login/sign in button

Signed-off-by: Brady Pratt <bpratt@redhat.com>
Co-authored-by: Brady Pratt <bpratt@redhat.com>
This commit is contained in:
OpenShift Cherrypick Robot
2025-10-08 21:39:49 +02:00
committed by GitHub
parent 56a378d725
commit 9002eb8189
2 changed files with 12 additions and 2 deletions

View File

@@ -42,6 +42,7 @@ import SunIcon from '@patternfly/react-icons/dist/esm/icons/sun-icon';
import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
import {ThemePreference, useTheme} from 'src/contexts/ThemeContext';
import {useQuayConfig} from 'src/hooks/UseQuayConfig';
export function HeaderToolbar({toggleDrawer}: {toggleDrawer: () => void}) {
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
@@ -52,6 +53,7 @@ export function HeaderToolbar({toggleDrawer}: {toggleDrawer: () => void}) {
const queryClient = useQueryClient();
const {user} = useCurrentUser();
const [err, setErr] = useState<string>();
const quayConfig = useQuayConfig();
const onDropdownToggle = () => {
setIsDropdownOpen((prev) => !prev);
@@ -220,7 +222,11 @@ export function HeaderToolbar({toggleDrawer}: {toggleDrawer: () => void}) {
/>
);
const signInButton = <Button> Sign In </Button>;
const signInButtonText = quayConfig?.config?.REGISTRY_TITLE_SHORT
? `Sign in to ${quayConfig.config.REGISTRY_TITLE_SHORT}`
: 'Sign In';
const signInButton = <Button>{signInButtonText}</Button>;
// Toggle between old UI and new UI
const [isChecked, setIsChecked] = React.useState<boolean>(true);

View File

@@ -70,6 +70,10 @@ export function Signin() {
/>
);
const loginButtonLabel = quayConfig?.config?.REGISTRY_TITLE
? `Sign in to ${quayConfig.config.REGISTRY_TITLE}`
: 'Sign in';
const loginForm = (
<LoginForm
showHelperText={err != null}
@@ -85,7 +89,7 @@ export function Signin() {
isRememberMeChecked={rememberMe}
onChangeRememberMe={(_event, v) => setRememberMe(v)}
onLoginButtonClick={(e) => onLoginButtonClick(e)}
loginButtonLabel="Log in"
loginButtonLabel={loginButtonLabel}
/>
);