-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Restructure Dashboard scaffolding to make it more user friendly…
… and reliable
- Loading branch information
1 parent
b183f4b
commit 78ba3bc
Showing
25 changed files
with
347 additions
and
278 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
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
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
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,67 +1,28 @@ | ||
import React from "react"; | ||
import { Link } from "react-router-dom"; | ||
import { withRouter } from "react-router"; | ||
import { ApolloProvider } from '@apollo/react-hooks'; | ||
import "antd/dist/antd.css"; | ||
import "./index.css"; | ||
import { Layout, Menu } from "antd"; | ||
import { client } from "./DashboardStore"; | ||
import { Layout } from "antd"; | ||
import client from "./graphql/client"; | ||
import Header from "./components/Header"; | ||
|
||
const AppLayout = ({ location, children }) => ( | ||
const AppLayout = ({ children }) => ( | ||
<Layout | ||
style={{ | ||
height: "100%" | ||
}} | ||
> | ||
<Layout.Header | ||
style={{ | ||
padding: "0 32px" | ||
}} | ||
> | ||
<div | ||
style={{ | ||
float: "left" | ||
}} | ||
> | ||
<h2 | ||
style={{ | ||
color: "#fff", | ||
margin: 0, | ||
marginRight: "1em", | ||
display: "inline", | ||
width: 100, | ||
lineHeight: "54px" | ||
}} | ||
> | ||
My Dashboard | ||
</h2> | ||
</div> | ||
<Menu | ||
theme="dark" | ||
mode="horizontal" | ||
selectedKeys={[location.pathname]} | ||
style={{ | ||
lineHeight: "64px" | ||
}} | ||
> | ||
<Menu.Item key="/explore"> | ||
<Link to="/explore">Explore</Link> | ||
</Menu.Item> | ||
<Menu.Item key="/"> | ||
<Link to="/">Dashboard</Link> | ||
</Menu.Item> | ||
</Menu> | ||
</Layout.Header> | ||
<Header/> | ||
<Layout.Content>{children}</Layout.Content> | ||
</Layout> | ||
); | ||
|
||
const App = withRouter(({ location, children }) => ( | ||
const App = ({ children }) => ( | ||
<ApolloProvider client={client}> | ||
<AppLayout location={location}> | ||
<AppLayout> | ||
{children} | ||
</AppLayout> | ||
</ApolloProvider> | ||
)); | ||
); | ||
|
||
export default App; |
138 changes: 0 additions & 138 deletions
138
packages/cubejs-playground/src/scaffolding/react/DashboardStore.js
This file was deleted.
Oops, something went wrong.
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
48 changes: 48 additions & 0 deletions
48
packages/cubejs-playground/src/scaffolding/react/components/Header.js
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import React from "react"; | ||
import { Link } from "react-router-dom"; | ||
import { withRouter } from "react-router"; | ||
import { Layout, Menu } from "antd"; | ||
|
||
const Header = ({ location }) => ( | ||
<Layout.Header | ||
style={{ | ||
padding: "0 32px" | ||
}} | ||
> | ||
<div | ||
style={{ | ||
float: "left" | ||
}} | ||
> | ||
<h2 | ||
style={{ | ||
color: "#fff", | ||
margin: 0, | ||
marginRight: "1em", | ||
display: "inline", | ||
width: 100, | ||
lineHeight: "54px" | ||
}} | ||
> | ||
My Dashboard | ||
</h2> | ||
</div> | ||
<Menu | ||
theme="dark" | ||
mode="horizontal" | ||
selectedKeys={[location.pathname]} | ||
style={{ | ||
lineHeight: "64px" | ||
}} | ||
> | ||
<Menu.Item key="/explore"> | ||
<Link to="/explore">Explore</Link> | ||
</Menu.Item> | ||
<Menu.Item key="/"> | ||
<Link to="/">Dashboard</Link> | ||
</Menu.Item> | ||
</Menu> | ||
</Layout.Header> | ||
); | ||
|
||
export default withRouter(Header); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.