Skip to content
This repository was archived by the owner on Apr 19, 2024. It is now read-only.

Commit 4b36c1c

Browse files
committed
hide discover-cloud
1 parent 1410b70 commit 4b36c1c

2 files changed

Lines changed: 30 additions & 21 deletions

File tree

src/App.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,16 @@ import { netdataCallback, updateLocaleFunctions } from "./main"
4949
import { MigrationManager } from "@/src/domains/dashboard/components/migration-manager"
5050
import { isDemo } from "./utils/is-demo"
5151
import { Box } from "@netdata/netdata-ui"
52+
import { selectIsCloudEnabled } from "domains/global/selectors"
5253

5354
const FakeMargin = Box
5455

5556
// support legacy code
5657
window.Ps = Ps
5758

5859
const App: React.FC = () => {
60+
const cloudEnabled = useSelector(selectIsCloudEnabled)
61+
5962
const store = useStore()
6063
useEffect(() => {
6164
// todo
@@ -139,7 +142,7 @@ const App: React.FC = () => {
139142
</>
140143
)}
141144
</Layout>
142-
<FakeMargin height={15} />
145+
{cloudEnabled && <FakeMargin height={15} />}
143146
</>
144147
)}
145148
</ThemeProvider>

src/components/header/index.js

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import Timezone from "./timezone"
1111
import SignIn from "./signIn"
1212
import { CloudConnectionStatus } from "./ACLK"
1313
import { DiscoverCloud } from "@/src/components/discover-cloud"
14+
import { selectIsCloudEnabled } from "domains/global/selectors"
15+
import { useSelector } from "react-redux"
1416

1517
const Wrapper = styled(Flex).attrs({
1618
as: "header",
@@ -24,25 +26,29 @@ const Wrapper = styled(Flex).attrs({
2426
pointer-events: all;
2527
`
2628

27-
const Header = () => (
28-
<Wrapper>
29-
<Flex alignItems="center" gap={3}>
30-
<Node />
31-
</Flex>
32-
<Flex justifyContent="end" alignItems="center" gap={3}>
33-
<CloudConnectionStatus />
34-
<Version />
35-
<News />
36-
<Options />
37-
<Timezone />
38-
<GlobalControls />
39-
<Alarms />
40-
<SignIn />
41-
</Flex>
42-
<Box sx={{ background: "#272B30" }} position="absolute" top="52px" left="0px" right="0px">
43-
<DiscoverCloud />
44-
</Box>
45-
</Wrapper>
46-
)
29+
const Header = () => {
30+
const cloudEnabled = useSelector(selectIsCloudEnabled)
31+
32+
return <Wrapper>
33+
<Flex alignItems="center" gap={3}>
34+
<Node />
35+
</Flex>
36+
<Flex justifyContent="end" alignItems="center" gap={3}>
37+
<CloudConnectionStatus />
38+
<Version />
39+
<News />
40+
<Options />
41+
<Timezone />
42+
<GlobalControls />
43+
<Alarms />
44+
<SignIn />
45+
</Flex>
46+
{cloudEnabled&& <Box sx={{ background: "#272B30" }} position="absolute" top="52px" left="0px" right="0px">
47+
<DiscoverCloud />
48+
</Box>}
49+
</Wrapper>
50+
}
51+
52+
4753

4854
export default Header

0 commit comments

Comments
 (0)