From c634d4a891f0978b5afd83c0c79f812d294cd2f5 Mon Sep 17 00:00:00 2001 From: kcfuler <87866012+kcfuler@users.noreply.github.com> Date: Thu, 6 Oct 2022 19:28:02 +0800 Subject: [PATCH] feat: add some css style for the custom Provider button (#1185) * fix: add some css style for the custom button * fix: refactor previous code * fix: add i18 adaptation * fix: modifiy the saml codition --- web/src/auth/ProviderButton.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/web/src/auth/ProviderButton.js b/web/src/auth/ProviderButton.js index 1feb573f..ab4a2526 100644 --- a/web/src/auth/ProviderButton.js +++ b/web/src/auth/ProviderButton.js @@ -129,6 +129,32 @@ export function renderProviderLogo(provider, application, width, margin, size, l ); } + } else if (provider.type === "Custom") { + // style definition + const text = i18next.t("login:Sign in with {type}").replace("{type}", provider.displayName); + const customAStyle = {display: "block", height: "55px", color: "#000"}; + const customButtonStyle = {display: "flex", alignItems: "center", width: "calc(100% - 10px)", height: "50px", margin: "5px", padding: "0 10px", backgroundColor: "transparent", boxShadow: "0px 1px 3px rgba(0,0,0,0.5)", border: "0px", borderRadius: "3px", cursor: "pointer"}; + const customImgStyle = {justfyContent: "space-between"}; + const customSpanStyle = {textAlign: "center", lineHeight: "50px", width: "100%", fontSize: "19px"}; + if (provider.category === "OAuth") { + return ( + + + + ); + } else if (provider.category === "SAML") { + return ( + getSamlUrl(provider, location)} style={customAStyle}> + + + ); + } } else { return (