Shared: fix SSR issue
This commit is contained in:
parent
2fffc86593
commit
a5560a7411
@ -89,9 +89,11 @@ const MoreLoginModal: React.FC<MoreLoginModalProps> = (props) => {
|
||||
const { icon, label } =
|
||||
PROVIDERS_DATA[item.provider as keyof ProvidersDataType];
|
||||
|
||||
const IconComponent = icon;
|
||||
|
||||
return (
|
||||
<ProviderRow key={`ProviderItem${label}`}>
|
||||
<ReactSVG src={icon} />
|
||||
<IconComponent />
|
||||
<Text
|
||||
fontSize="14px"
|
||||
fontWeight="600"
|
||||
|
@ -29,7 +29,7 @@ import equal from "fast-deep-equal/react";
|
||||
|
||||
import { getProviderLabel } from "@docspace/shared/utils/common";
|
||||
|
||||
import VerticalDotsReactSvgUrl from "PUBLIC_DIR/images/vertical-dots.react.svg?url";
|
||||
import VerticalDotsReactSvg from "PUBLIC_DIR/images/vertical-dots.react.svg";
|
||||
|
||||
import { SocialButton } from "../social-button";
|
||||
import StyledSocialButtonsGroup from "./SocialButtonsGroup.styled";
|
||||
@ -80,11 +80,11 @@ export const SocialButtonsGroup = memo(
|
||||
<div className="buttonWrapper" key={`${provider}ProviderItem`}>
|
||||
<SocialButton
|
||||
isDisabled={isDisabled}
|
||||
iconName={icon}
|
||||
label={length >= 2 ? "" : getProviderLabel(label, t)}
|
||||
$iconOptions={iconOptions}
|
||||
data-url={url}
|
||||
data-providername={provider}
|
||||
IconComponent={icon}
|
||||
onClick={onClick}
|
||||
className="social-button"
|
||||
/>
|
||||
@ -97,7 +97,7 @@ export const SocialButtonsGroup = memo(
|
||||
{ssoUrl && (
|
||||
<SocialButton
|
||||
isDisabled={isDisabled}
|
||||
iconName={ssoSVG}
|
||||
IconComponent={ssoSVG}
|
||||
className="sso-button social-button"
|
||||
label={ssoLabel || getProviderLabel("sso", t)}
|
||||
onClick={() => (window.location.href = ssoUrl)}
|
||||
@ -108,7 +108,7 @@ export const SocialButtonsGroup = memo(
|
||||
{elements}
|
||||
{length > 2 && (
|
||||
<SocialButton
|
||||
iconName={VerticalDotsReactSvgUrl}
|
||||
IconComponent={VerticalDotsReactSvg}
|
||||
onClick={moreAuthOpen}
|
||||
className="show-more-button"
|
||||
/>
|
||||
|
@ -24,13 +24,13 @@
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
import ShareAppleReactSvgUrl from "PUBLIC_DIR/images/share.apple.react.svg?url";
|
||||
import ShareGoogleReactSvgUrl from "PUBLIC_DIR/images/share.google.react.svg?url";
|
||||
import ShareFacebookReactSvgUrl from "PUBLIC_DIR/images/share.facebook.react.svg?url";
|
||||
import ShareTwitterReactSvgUrl from "PUBLIC_DIR/images/share.twitter.react.svg?url";
|
||||
import ShareLinkedinReactSvgUrl from "PUBLIC_DIR/images/share.linkedin.react.svg?url";
|
||||
import ShareMicrosoftReactSvgUrl from "PUBLIC_DIR/images/share.microsoft.react.svg?url";
|
||||
import ShareZoomReactSvgUrl from "PUBLIC_DIR/images/share.zoom.react.svg?url";
|
||||
import ShareAppleReactSvg from "PUBLIC_DIR/images/share.apple.react.svg";
|
||||
import ShareGoogleReactSvg from "PUBLIC_DIR/images/share.google.react.svg";
|
||||
import ShareFacebookReactSvg from "PUBLIC_DIR/images/share.facebook.react.svg";
|
||||
import ShareTwitterReactSvg from "PUBLIC_DIR/images/share.twitter.react.svg";
|
||||
import ShareLinkedinReactSvg from "PUBLIC_DIR/images/share.linkedin.react.svg";
|
||||
import ShareMicrosoftReactSvg from "PUBLIC_DIR/images/share.microsoft.react.svg";
|
||||
import ShareZoomReactSvg from "PUBLIC_DIR/images/share.zoom.react.svg";
|
||||
|
||||
export const LOADER_STYLE = Object.freeze({
|
||||
title: "",
|
||||
@ -100,37 +100,37 @@ export const FOLDER_NAMES = Object.freeze({
|
||||
export const PROVIDERS_DATA = Object.freeze({
|
||||
appleid: {
|
||||
label: "apple",
|
||||
icon: ShareAppleReactSvgUrl,
|
||||
icon: ShareAppleReactSvg,
|
||||
iconOptions: undefined,
|
||||
},
|
||||
google: {
|
||||
label: "google",
|
||||
icon: ShareGoogleReactSvgUrl,
|
||||
icon: ShareGoogleReactSvg,
|
||||
iconOptions: undefined,
|
||||
},
|
||||
facebook: {
|
||||
label: "facebook",
|
||||
icon: ShareFacebookReactSvgUrl,
|
||||
icon: ShareFacebookReactSvg,
|
||||
iconOptions: undefined,
|
||||
},
|
||||
twitter: {
|
||||
label: "twitter",
|
||||
icon: ShareTwitterReactSvgUrl,
|
||||
icon: ShareTwitterReactSvg,
|
||||
iconOptions: { color: "#2AA3EF" },
|
||||
},
|
||||
linkedin: {
|
||||
label: "linkedin",
|
||||
icon: ShareLinkedinReactSvgUrl,
|
||||
icon: ShareLinkedinReactSvg,
|
||||
iconOptions: undefined,
|
||||
},
|
||||
microsoft: {
|
||||
label: "microsoft",
|
||||
icon: ShareMicrosoftReactSvgUrl,
|
||||
icon: ShareMicrosoftReactSvg,
|
||||
iconOptions: undefined,
|
||||
},
|
||||
zoom: {
|
||||
label: "zoom",
|
||||
icon: ShareZoomReactSvgUrl,
|
||||
icon: ShareZoomReactSvg,
|
||||
iconOptions: undefined,
|
||||
},
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user