Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add home screen with a welcome message

Patryk Zawadzki40aa41aef2d8
diff --git a/.editorconfig b/.editorconfig
index 988be9ee06..7b905be679 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -23,6 +23,12 @@ indent_size = 2
[*.scss]
indent_size = 2
+[*.ts]
+indent_size = 2
+
+[*.tsx]
+indent_size = 2
+
[*.yml]
indent_size = 2
diff --git a/saleor/static/dashboard-next/home/components/HomeScreen.tsx b/saleor/static/dashboard-next/home/components/HomeScreen.tsx
new file mode 100644
index 0000000000..25dee21ca1
--- /dev/null
+++ b/saleor/static/dashboard-next/home/components/HomeScreen.tsx
@@ -0,0 +1,40 @@
+import Card from "@material-ui/core/Card";
+import CardContent from "@material-ui/core/CardContent";
+import Typography from "@material-ui/core/Typography";
+import * as React from "react";
+
+import CardTitle from "../../components/CardTitle";
+import Container from "../../components/Container";
+import PageHeader from "../../components/PageHeader";
+import i18n from "../../i18n";
+
+interface HomeScreenProps {
+ user: {
+ email: string;
+ };
+}
+
+export const HomeScreen: React.StatelessComponent<HomeScreenProps> = ({
+ user
+}) => (
+ <Container width="md">
+ <PageHeader
+ title={i18n.t("Hello there, {{userName}}", { userName: user.email })}
+ />
+ <Card>
+ <CardTitle title={i18n.t("Disclaimer")} />
+ <CardContent>
+ <Typography>
+ {i18n.t(
+ "The new dashboard and the GraphQL API are preview-quality software."
+ )}
+ </Typography>
+ <Typography>
+ {i18n.t(
+ "The GraphQL API is beta quality. It is not fully optimized and some mutations or queries may be missing."
+ )}
+ </Typography>
+ </CardContent>
+ </Card>
+ </Container>
+);
diff --git a/saleor/static/dashboard-next/home/index.tsx b/saleor/static/dashboard-next/home/index.tsx
new file mode 100644
index 0000000000..4b81dad399
--- /dev/null
+++ b/saleor/static/dashboard-next/home/index.tsx
@@ -0,0 +1,7 @@
+import * as React from "react";
+
+import HomePage from "./views/HomePage";
+
+const Component = () => <HomePage />;
+
+export default Component;
diff --git a/saleor/static/dashboard-next/home/views/HomePage.tsx b/saleor/static/dashboard-next/home/views/HomePage.tsx
new file mode 100644
index 0000000000..383d057728
--- /dev/null
+++ b/saleor/static/dashboard-next/home/views/HomePage.tsx
@@ -0,0 +1,12 @@
+import * as React from "react";
+
+import { UserContext } from "../../auth";
+import { HomeScreen } from "../components/HomeScreen";
+
+const HomePage = () => (
+ <UserContext.Consumer>
+ {({ user }) => <HomeScreen user={user} />}
+ </UserContext.Consumer>
+);
+
+export default HomePage;
diff --git a/saleor/static/dashboard-next/index.tsx b/saleor/static/dashboard-next/index.tsx
index c01347804d..41de5119e2 100644
--- a/saleor/static/dashboard-next/index.tsx
+++ b/saleor/static/dashboard-next/index.tsx
@@ -19,6 +19,7 @@ import { DateProvider } from "./components/DateFormatter";
import { LocaleProvider } from "./components/Locale";
import { MessageManager } from "./components/messages";
import { ConfigurationSection } from "./configuration";
+import HomePage from "./home";
import "./i18n";
import PageSection from "./pages";
import ProductSection from "./products";
@@ -78,6 +79,7 @@ render(
isAuthenticated ? (
<AppRoot>
<Switch>
+ <Route exact path="/" component={HomePage} />
<Route path="/categories" component={CategorySection} />
<Route path="/pages" component={PageSection} />
<Route path="/products" component={ProductSection} />