Last active
March 10, 2017 02:08
-
-
Save kenmori/be568b5adbde522064f6eb7b77b656a2 to your computer and use it in GitHub Desktop.
else if statement in render function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let Button; | |
const isOpen = TfCommonUtils.isOpenSaleTime(new Date(), new Date(2017,2,18,0,0,0), new Date(2017,2,21,6,0,0)); | |
if(!isOpen && isRightApplication) { | |
Button = <BtnA url={mailHref} /> | |
} else if (!isOpen && !isRightApplication) { | |
Button = <BtnLink url={registerUrl} /> | |
} else { | |
Button = <noscript /> | |
} | |
// ~~~~~ | |
return ( | |
{Button} | |
) | |
///↓↓↓↓↓↓↓ | |
return ({ | |
!isOpen && isRightApplication ? <BtnA url={mailHref} /> | |
:!isOpen && !isRightApplication ? <BtnLink url={registerUrl} /> | |
: <noscript /> | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment