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

feat(Login): add ability to customize login logo #922

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions packages/ui/src/ui/appearance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export interface ClusterAppearance {
icon: string;
icon2x: string;
iconbig?: string;
LoginLogo?: React.ComponentType<{theme?: 'light' | 'dark'}>;
}

export const defaultClusterAppearance: ClusterAppearance = {
Expand Down
4 changes: 0 additions & 4 deletions packages/ui/src/ui/assets/img/svg/YTsaurus-logo-light.svg

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.default-login-logo {
position: absolute;
top: 40px;
left: 40px;
width: 160.32px;
height: 33.06px;

&_theme_light {
fill: #000;
}

&_theme_dark {
fill: #fff;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';

import YTsaurusLogoSvg from '../../../assets/img/svg/YTsaurus-logo.svg';

import cn from 'bem-cn-lite';

const block = cn('default-login-logo');

import './DefaultLoginLogo.scss';

interface Props {
theme?: 'light' | 'dark';
}

const DefaultLoginLogo: React.FC<Props> = ({theme}) => (
<YTsaurusLogoSvg className={block({theme})} />
);

export default DefaultLoginLogo;
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@
background-position: bottom 0 right 0;
background-size: auto 100%;

&__logo {
position: absolute;
top: 40px;
left: 40px;
width: 160.32px;
height: 33.06px;
}

&__content {
max-width: 300px;
margin-left: 150px;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react';
import UIFactory from '../../../UIFactory';
import YT from '../../../config/yt-config';

import LogoLight from '../../../assets/img/svg/YTsaurus-logo-light.svg';
import LogoDark from '../../../assets/img/svg/YTsaurus-logo-dark.svg';
import DefaultLoginLogo from './DefaultLoginLogo';

import cn from 'bem-cn-lite';

Expand All @@ -16,13 +17,11 @@ interface Props {
}

function LoginPageWrapper({theme, children}: Props) {
const {LoginLogo = DefaultLoginLogo} = UIFactory.getClusterAppearance(YT.cluster) || {};

return (
<div className={block(null)}>
{theme === 'light' ? (
<LogoLight className={block('logo')} />
) : (
<LogoDark className={block('logo')} />
)}
<LoginLogo theme={theme} />
<div className={block('content')}>{children}</div>
</div>
);
Expand Down
Loading