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 web3auth logo bg issue #1828

Merged
merged 1 commit into from
May 28, 2024
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
8 changes: 0 additions & 8 deletions packages/ui/css/web3auth.css
Original file line number Diff line number Diff line change
Expand Up @@ -445,18 +445,10 @@
@apply flex p-2;
}

#w3a-modal .w3a-modal__loader-app-logo--default {
@apply bg-app-primary-600 dark:bg-app-gray-50 w-[72px] h-[72px] rounded-full items-center justify-center;
}

#w3a-modal .w3a-modal__loader-app-logo img {
@apply max-h-[72px] max-w-[72px] w-[72px] h-auto;
}

#w3a-modal .w3a-modal__loader-app-logo--default img {
@apply max-h-[45px] max-w-[45px] w-[45px];
}

#w3a-modal .w3a-modal__loader-social-logo {
@apply bg-app-gray-100 dark:bg-app-gray-50 w-[72px] h-[72px] flex rounded-full items-center justify-center;
}
Expand Down
9 changes: 4 additions & 5 deletions packages/ui/src/components/AdapterLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ADAPTER_STATUS, log } from "@web3auth/base";
import { useEffect } from "react";
import { useTranslation } from "react-i18next";

import { DEFAULT_LOGO_DARK, DEFAULT_LOGO_LIGHT, MODAL_STATUS, ModalStatusType } from "../interfaces";
import { MODAL_STATUS, ModalStatusType } from "../interfaces";
import i18n from "../localeImport";
import Footer from "./Footer";
import Icon from "./Icon";
Expand All @@ -23,7 +23,6 @@ export default function DetailedLoader(props: DetailedLoaderProps) {
const { adapter, appLogo, message, modalStatus, adapterName, onClose } = props;
const providerIcon = adapter === "twitter" ? <Image imageId="login-x-dark" /> : <Image imageId={`login-${adapter}`} />;
const [t] = useTranslation(undefined, { i18n });
const isDefaultLogo = [DEFAULT_LOGO_DARK, DEFAULT_LOGO_LIGHT].includes(appLogo);
Copy link
Contributor Author

@BboyStatix BboyStatix May 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We no longer assign a different background based on default logo or not. So all logos are treated the same now. So no need to check if the logo is a default logo or not anymore. Besides, appLogo is set to default values in constructor

if (!uiConfig.logoLight) this.uiConfig.logoLight = DEFAULT_LOGO_LIGHT;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still have the condition in Header.tsx where we hide the logo based on whether or not its default logo or not

if (!uiConfig.logoLight) this.uiConfig.logoLight = DEFAULT_LOGO_LIGHT;


useEffect(() => {
log.debug("adapter loader re-rendering");
Expand All @@ -41,9 +40,9 @@ export default function DetailedLoader(props: DetailedLoaderProps) {
{modalStatus === MODAL_STATUS.CONNECTING && (
<>
<div className="w3a-modal__loader-bridge">
<div className={["w3a-modal__loader-app-logo", isDefaultLogo ? "w3a-modal__loader-app-logo--default" : ""].join(" ")}>
<img src={isDefaultLogo ? DEFAULT_LOGO_LIGHT : appLogo} className="block dark:hidden" alt="" />
<img src={isDefaultLogo ? DEFAULT_LOGO_DARK : appLogo} className="hidden dark:block" alt="" />
<div className="w3a-modal__loader-app-logo">
<img src={appLogo} className="block dark:hidden" alt="" />
<img src={appLogo} className="hidden dark:block" alt="" />
</div>
<div className="w3a-modal__connector">
<div className="w3a-modal__connector-beat">
Expand Down
Loading