Skip to content

Commit 27e7fd2

Browse files
committed
refactor(web): use-better-conditional-rendering-syntax
1 parent 08601ca commit 27e7fd2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

web/src/layout/Header/navbar/Debug.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import styled from "styled-components";
33
import { useSortitionModulePhase } from "hooks/contracts/generated";
44
import { useToggleTheme } from "hooks/useToggleThemeContext";
55
import { GIT_BRANCH, GIT_DIRTY, GIT_HASH, GIT_TAGS, GIT_URL, RELEASE_VERSION } from "consts/index";
6+
import { isUndefined } from "utils/index";
67

78
const Container = styled.div`
89
display: flex;
@@ -46,7 +47,7 @@ const ServicesStatus = () => {
4647
const [theme] = useToggleTheme();
4748
const statusUrlParameters = useMemo(() => (theme === "light" ? "?theme=light" : "?theme=dark"), [theme]);
4849
const statusUrl = process.env.REACT_APP_STATUS_URL;
49-
return <label>{statusUrl && <StyledIframe src={`${statusUrl + statusUrlParameters}`} />}</label>;
50+
return <label>{isUndefined(statusUrl) ? null : <StyledIframe src={`${statusUrl + statusUrlParameters}`} />}</label>;
5051
};
5152

5253
enum Phases {
@@ -59,7 +60,7 @@ const Phase = () => {
5960
const { data: phase } = useSortitionModulePhase({
6061
watch: true,
6162
});
62-
return <>{phase !== undefined && <StyledLabel>Phase: {Phases[phase]}</StyledLabel>}</>;
63+
return <>{isUndefined(phase) ? null : <StyledLabel>Phase: {Phases[phase]}</StyledLabel>}</>;
6364
};
6465

6566
const Debug: React.FC = () => {

0 commit comments

Comments
 (0)