Skip to content

Commit d3fc190

Browse files
authored
Merge pull request #1356 from kleros/refactor(web)/align-debug-component
refactor(web): align-debug-component-content
2 parents edbee9d + 27e7fd2 commit d3fc190

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ 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;
910
flex-direction: column;
1011
gap: 12px;
12+
padding: 0px 3px;
1113
1214
label,
1315
a {
@@ -22,26 +24,30 @@ const StyledIframe = styled.iframe`
2224
border: none;
2325
width: 100%;
2426
height: 30px;
25-
border-radius: 300px;
27+
border-radius: 3px;
28+
`;
29+
30+
const StyledLabel = styled.label`
31+
padding-left: 8px;
2632
`;
2733

2834
const Version = () => (
29-
<label>
35+
<StyledLabel>
3036
v{RELEASE_VERSION}{" "}
3137
<a href={GIT_URL} target="_blank" rel="noreferrer">
3238
#{GIT_HASH}
3339
</a>
3440
{GIT_BRANCH && GIT_BRANCH !== "HEAD" && ` ${GIT_BRANCH}`}
3541
{GIT_TAGS && ` ${GIT_TAGS}`}
3642
{GIT_DIRTY && ` dirty`}
37-
</label>
43+
</StyledLabel>
3844
);
3945

4046
const ServicesStatus = () => {
4147
const [theme] = useToggleTheme();
4248
const statusUrlParameters = useMemo(() => (theme === "light" ? "?theme=light" : "?theme=dark"), [theme]);
4349
const statusUrl = process.env.REACT_APP_STATUS_URL;
44-
return <label>{statusUrl && <StyledIframe src={`${statusUrl + statusUrlParameters}`} />}</label>;
50+
return <label>{isUndefined(statusUrl) ? null : <StyledIframe src={`${statusUrl + statusUrlParameters}`} />}</label>;
4551
};
4652

4753
enum Phases {
@@ -54,7 +60,7 @@ const Phase = () => {
5460
const { data: phase } = useSortitionModulePhase({
5561
watch: true,
5662
});
57-
return <>{phase !== undefined && <label>Phase: {Phases[phase]}</label>}</>;
63+
return <>{isUndefined(phase) ? null : <StyledLabel>Phase: {Phases[phase]}</StyledLabel>}</>;
5864
};
5965

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

0 commit comments

Comments
 (0)