Skip to content

Commit 34c981d

Browse files
combine checks (canada-ca#2851)
1 parent fc0b4d4 commit 34c981d

4 files changed

Lines changed: 42 additions & 49 deletions

File tree

frontend/src/admin/AdminDomianCard.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function AdminDomianCard({ url, lastRan, ...rest }) {
3131
<ExternalLinkIcon mx="2px" aria-hidden="true" />
3232
</Link>
3333
</Stack>
34-
{lastRan && (
34+
{lastRan ? (
3535
<Stack isInline>
3636
<Text fontWeight="bold">
3737
<Trans>Last scanned:</Trans>
@@ -41,8 +41,7 @@ export function AdminDomianCard({ url, lastRan, ...rest }) {
4141
<LinkIcon mx="2px" aria-hidden="true" />
4242
</Link>
4343
</Stack>
44-
)}
45-
{!lastRan && (
44+
) : (
4645
<Box>
4746
<Text fontWeight="bold">
4847
<Trans>Not scanned yet.</Trans>

frontend/src/app/App.js

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,17 @@ export function App() {
9696
</Link>
9797

9898
{isLoggedIn() && isEmailValidated() && (
99-
<Link to="/organizations">
100-
<Trans>Organizations</Trans>
101-
</Link>
102-
)}
103-
104-
{isLoggedIn() && isEmailValidated() && (
105-
<Link to="/domains">
106-
<Trans>Domains</Trans>
107-
</Link>
108-
)}
109-
110-
{isLoggedIn() && isEmailValidated() && (
111-
<Link to="/dmarc-summaries">
112-
<Trans>DMARC Summaries</Trans>
113-
</Link>
99+
<>
100+
<Link to="/organizations">
101+
<Trans>Organizations</Trans>
102+
</Link>
103+
<Link to="/domains">
104+
<Trans>Domains</Trans>
105+
</Link>
106+
<Link to="/dmarc-summaries">
107+
<Trans>DMARC Summaries</Trans>
108+
</Link>
109+
</>
114110
)}
115111

116112
{isLoggedIn() && (

frontend/src/app/FloatingMenu.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,14 +193,13 @@ export const FloatingMenu = () => {
193193
onClick={signOut}
194194
/>
195195
) : (
196-
<FloatingMenuLink to="/sign-in" text={t`Sign In`} />
197-
)}
198-
199-
{!isLoggedIn() && (
200-
<FloatingMenuLink
201-
to="/create-user"
202-
text={t`Create Account`}
203-
/>
196+
<>
197+
<FloatingMenuLink to="/sign-in" text={t`Sign In`} />
198+
<FloatingMenuLink
199+
to="/create-user"
200+
text={t`Create Account`}
201+
/>
202+
</>
204203
)}
205204

206205
<Divider

frontend/src/app/TopBanner.js

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -70,29 +70,28 @@ export const TopBanner = (props) => {
7070
<Trans>Sign Out</Trans>
7171
</Button>
7272
) : (
73-
<Button
74-
variant="primaryWhite"
75-
as={RouteLink}
76-
to="/sign-in"
77-
mr={2}
78-
px={3}
79-
display={{ base: 'none', md: 'inline' }}
80-
>
81-
<Trans>Sign In</Trans>
82-
</Button>
83-
)}
84-
85-
{!isLoggedIn() && (
86-
<Button
87-
variant="primaryHover"
88-
as={RouteLink}
89-
to="/create-user"
90-
mr={2}
91-
px={3}
92-
display={{ base: 'none', md: 'inline' }}
93-
>
94-
<Trans>Create Account</Trans>
95-
</Button>
73+
<>
74+
<Button
75+
variant="primaryWhite"
76+
as={RouteLink}
77+
to="/sign-in"
78+
mr={2}
79+
px={3}
80+
display={{ base: 'none', md: 'inline' }}
81+
>
82+
<Trans>Sign In</Trans>
83+
</Button>
84+
<Button
85+
variant="primaryHover"
86+
as={RouteLink}
87+
to="/create-user"
88+
mr={2}
89+
px={3}
90+
display={{ base: 'none', md: 'inline' }}
91+
>
92+
<Trans>Create Account</Trans>
93+
</Button>
94+
</>
9695
)}
9796

9897
<Box py={4}>

0 commit comments

Comments
 (0)