added variable for hiding social links

This commit was merged in pull request #409.
This commit is contained in:
2023-09-10 06:25:36 +01:00
parent fd9adb1c08
commit bfcfcdbf16
4 changed files with 69 additions and 39 deletions
+2
View File
@@ -68,6 +68,8 @@ REACT_APP_MAX_FILE_SIZE=1000000
REACT_APP_TOTAL_NUM_FILE=4 REACT_APP_TOTAL_NUM_FILE=4
REACT_APP_LOGOUT_TEXT="Sign Out" REACT_APP_LOGOUT_TEXT="Sign Out"
REACT_APP_APPLE_SOCIAL_LOGIN=0
REACT_APP_LINKEDIN_SOCIAL_LOGIN=0
#apigate.lotus.g1.wrenchboard.com:76.209.103.227 #apigate.lotus.g1.wrenchboard.com:76.209.103.227
+3
View File
@@ -43,3 +43,6 @@ REACT_APP_MAX_FILE_SIZE=1000000
REACT_APP_TOTAL_NUM_FILE=4 REACT_APP_TOTAL_NUM_FILE=4
REACT_APP_LOGOUT_TEXT="Sign Out" REACT_APP_LOGOUT_TEXT="Sign Out"
REACT_APP_APPLE_SOCIAL_LOGIN=0
REACT_APP_LINKEDIN_SOCIAL_LOGIN=0
+2
View File
@@ -50,3 +50,5 @@ REACT_APP_MAX_FILE_SIZE=1000000
REACT_APP_TOTAL_NUM_FILE=4 REACT_APP_TOTAL_NUM_FILE=4
REACT_APP_LOGOUT_TEXT="Sign Out" REACT_APP_LOGOUT_TEXT="Sign Out"
REACT_APP_APPLE_SOCIAL_LOGIN=0
REACT_APP_LINKEDIN_SOCIAL_LOGIN=0
+60 -37
View File
@@ -329,35 +329,51 @@ export default function Login() {
)} )}
</button> </button>
</div> </div>
<div className="sm:flex sm:justify-between sm:items-center sm:space-x-2"> <div className="sm:grid grid-cols-2 gap-1">
<BrandBtn <div className="w-full">
link="#" <BrandBtn
imgSrc={googleLogo} link="#"
brand="Google" imgSrc={googleLogo}
onClick={googleLogin} brand="Google"
/> onClick={googleLogin}
<BrandBtn />
// link={`https://appleid.apple.com/auth/authorize?response_type=code&response_mode=form_post&client_id=${process.env.REACT_APP_APPLE_CLIENT_ID}&redirect_uri=https%3A%2F%2Fwork.wrenchboard.com%2Flogin%2Fauth%2Fapple&state=4b2c4456b7&scope=name+email`} </div>
link={`https://appleid.apple.com/auth/authorize?response_type=code&response_mode=form_post&client_id=${process.env.REACT_APP_APPLE_CLIENT_ID}&redirect_uri=${process.env.REACT_APP_APPLE_REDIRECT_URL}&state=4b2c4456b7&scope=name+email`} <div
imgSrc={appleLogo} className={`w-full ${
brand="Apple" process.env.REACT_APP_APPLE_SOCIAL_LOGIN !== 0 &&
isAnchor={true} "hidden"
style={{visibility: 'hidden'}} }`}
/> >
</div> <BrandBtn
<div className="sm:flex sm:justify-between sm:items-center sm:space-x-2"> // link={`https://appleid.apple.com/auth/authorize?response_type=code&response_mode=form_post&client_id=${process.env.REACT_APP_APPLE_CLIENT_ID}&redirect_uri=https%3A%2F%2Fwork.wrenchboard.com%2Flogin%2Fauth%2Fapple&state=4b2c4456b7&scope=name+email`}
<BrandBtn link={`https://appleid.apple.com/auth/authorize?response_type=code&response_mode=form_post&client_id=${process.env.REACT_APP_APPLE_CLIENT_ID}&redirect_uri=${process.env.REACT_APP_APPLE_REDIRECT_URL}&state=4b2c4456b7&scope=name+email`}
link={`https://www.facebook.com/v14.0/dialog/oauth?client_id=${process.env.REACT_APP_FACEBOOK_CLIENT_ID}&redirect_uri=${process.env.REACT_APP_FACEBOOK_REDIRECT_URL}&scope=${process.env.REACT_APP_FACEBOOK_CLIENT_SCOPE}`} imgSrc={appleLogo}
imgSrc={facebookLogo} brand="Apple"
brand="Facebook" isAnchor={true}
isAnchor={true} // style={{visibility: 'hidden'}}
/> />
<BrandBtn </div>
// link="https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&scope=comma-separated-list-of-scopes&state=YOUR_STATE_VALUE" <div className="w-full">
imgSrc={linkedInLogo} <BrandBtn
brand="LinkedIn" link={`https://www.facebook.com/v14.0/dialog/oauth?client_id=${process.env.REACT_APP_FACEBOOK_CLIENT_ID}&redirect_uri=${process.env.REACT_APP_FACEBOOK_REDIRECT_URL}&scope=${process.env.REACT_APP_FACEBOOK_CLIENT_SCOPE}`}
isAnchor={true} imgSrc={facebookLogo}
/> brand="Facebook"
isAnchor={true}
/>
</div>
<div
className={`w-full ${
process.env.REACT_APP_LINKEDIN_SOCIAL_LOGIN !== 0 &&
"hidden"
}`}
>
<BrandBtn
// link="https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&scope=comma-separated-list-of-scopes&state=YOUR_STATE_VALUE"
imgSrc={linkedInLogo}
brand="LinkedIn"
isAnchor={true}
/>
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -433,12 +449,12 @@ export default function Login() {
} }
{/* END of login component */} {/* END of login component */}
{loginType == "full" && {loginType == "full" && (
<div className="pt-5 text-[#181c32] text-center font-semibold text-[13.975px] leading-[20.9625px]"> <div className="pt-5 text-[#181c32] text-center font-semibold text-[13.975px] leading-[20.9625px]">
This site is protected by hCaptcha and the our Privacy Policy This site is protected by hCaptcha and the our Privacy Policy
and Terms of Service apply. and Terms of Service apply.
</div> </div>
} )}
</div> </div>
</div> </div>
</div> </div>
@@ -447,7 +463,14 @@ export default function Login() {
); );
} }
const BrandBtn = ({ link, imgSrc, brand, onClick, isAnchor = false, style = {visibility: 'visible' } }) => { const BrandBtn = ({
link,
imgSrc,
brand,
onClick,
isAnchor = false,
style = { visibility: "visible" },
}) => {
// const doGoogle = async () => { // const doGoogle = async () => {
// alert("start google"); // alert("start google");
// }; // };
@@ -467,7 +490,7 @@ const BrandBtn = ({ link, imgSrc, brand, onClick, isAnchor = false, style = {vis
// alert("start facebook"); // alert("start facebook");
// }; // };
return ( return (
<div className="w-full sm:w-1/2 flex justify-center bottomMargin" style={style}> <div className="w-full flex justify-center bottomMargin" style={style}>
{isAnchor ? ( {isAnchor ? (
<a <a
href={link} href={link}