Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: logo for the About modal window #916

Merged
merged 1 commit into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ type Props = {
};

export class AboutModal extends React.PureComponent<Props> {
private browserVersion: string | undefined | null;
private browserOS: string | undefined | null;
private browserName: string | undefined;
private readonly browserVersion: string | undefined | null;
private readonly browserOS: string | undefined | null;
private readonly browserName: string | undefined;

constructor(props: Props) {
super(props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { BrandingData } from '../../../../services/bootstrap/branding.constant';
type Props = {
branding: BrandingData;
username: string;
dashboardLogo?: { base64data: string; mediatype: string };
};
type State = {
isLauncherOpen: boolean;
Expand Down Expand Up @@ -88,11 +89,16 @@ export class AboutMenu extends React.PureComponent<Props, State> {
}

public render(): React.ReactElement {
const { username } = this.props;
const { username, dashboardLogo } = this.props;
const { isLauncherOpen, isModalOpen } = this.state;

const { logoFile, name, productVersion } = this.props.branding;

const logoSrc =
dashboardLogo !== undefined
? `data:${dashboardLogo.mediatype};base64,${dashboardLogo.base64data}`
: logoFile;

return (
<>
<ApplicationLauncher
Expand All @@ -107,7 +113,7 @@ export class AboutMenu extends React.PureComponent<Props, State> {
isOpen={isModalOpen}
closeModal={() => this.closeModal()}
username={username}
logo={logoFile}
logo={logoSrc}
productName={name}
serverVersion={productVersion}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { AboutMenu } from './AboutMenu';
import UserMenu from './UserMenu';
import { ApplicationsMenu } from './ApplicationsMenu';
import { selectApplications } from '../../../store/ClusterInfo/selectors';
import { selectDashboardLogo } from '../../../store/ServerConfig/selectors';

type Props = MappedProps & {
history: History;
Expand All @@ -50,7 +51,11 @@ export class HeaderTools extends React.PureComponent<Props> {
<PageHeaderToolsGroup>
{applications.length !== 0 && <ApplicationsMenu applications={applications} />}
<PageHeaderToolsItem>
<AboutMenu branding={this.props.branding} username={username} />
<AboutMenu
branding={this.props.branding}
dashboardLogo={this.props.dashboardLogo}
username={username}
/>
</PageHeaderToolsItem>
{isUserAuthenticated && (
<PageHeaderToolsItem>
Expand All @@ -73,6 +78,7 @@ export class HeaderTools extends React.PureComponent<Props> {
const mapStateToProps = (state: AppState) => ({
userProfile: selectUserProfile(state),
branding: selectBranding(state),
dashboardLogo: selectDashboardLogo(state),
applications: selectApplications(state),
});

Expand Down
Loading