-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7c3bf18
commit 473e0bb
Showing
1 changed file
with
18 additions
and
13 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,34 @@ | ||
import React from "react"; | ||
import { InsightView } from "@gooddata/sdk-ui-ext"; | ||
import { ThemeProvider, useThemeIsLoading } from "@gooddata/sdk-ui-theme-provider"; | ||
import { ThemeProvider, useTheme, useThemeIsLoading } from "@gooddata/sdk-ui-theme-provider"; | ||
|
||
import Page from "../components/Page"; | ||
import customTheme from "../customTheme"; | ||
|
||
const ThemedHome = () => ( | ||
<ThemeProvider theme={customTheme}> | ||
<Home /> | ||
</ThemeProvider> | ||
); | ||
|
||
const Home = () => { | ||
const themeIsLoading = useThemeIsLoading(); | ||
const theme = useTheme(); | ||
|
||
if (themeIsLoading) { | ||
return <p>…</p>; | ||
return <p>Loading theme resources…</p>; | ||
} | ||
|
||
return ( | ||
<ThemeProvider theme={customTheme}> | ||
<div style={{ backgroundColor: "var(--gd-palette-complementary-0)" }}> | ||
<Page> | ||
<div style={{ height: 580 }}> | ||
{/* line below renders a column chart create in analytical designer */} | ||
<InsightView insight="aby6oS6DbpFX" /> | ||
</div> | ||
</Page> | ||
</div> | ||
</ThemeProvider> | ||
<div style={{ backgroundColor: theme.palette.complementary.c0 }}> | ||
<Page> | ||
<div style={{ height: 580 }}> | ||
{/* line below renders a column chart create in analytical designer */} | ||
<InsightView insight="aby6oS6DbpFX" /> | ||
</div> | ||
</Page> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Home; | ||
export default ThemedHome; |