Added additional precuations for users that do not exist and verified auth access.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Col, Row, Tabs } from "antd";
|
||||
import { Col, Row, Tabs, Grid } from "antd";
|
||||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
@@ -10,10 +10,27 @@ const mapStateToProps = createStructuredSelector({});
|
||||
const mapDispatchToProps = (dispatch) => ({});
|
||||
|
||||
export function JobsPage() {
|
||||
const selectedBreakpoint = Object.entries(Grid.useBreakpoint())
|
||||
.filter((screen) => !!screen[1])
|
||||
.slice(-1)[0];
|
||||
|
||||
const bpoints = {
|
||||
xs: { l: 12, r: 12 },
|
||||
sm: { l: 10, r: 14 },
|
||||
md: { l: 10, r: 14 },
|
||||
lg: { l: 8, r: 16 },
|
||||
xl: { l: 6, r: 18 },
|
||||
xxl: { l: 5, r: 19 },
|
||||
};
|
||||
|
||||
const selectedSpans = selectedBreakpoint
|
||||
? bpoints[selectedBreakpoint[0]]
|
||||
: { l: 18, r: 6 };
|
||||
|
||||
return (
|
||||
<div style={{ height: "100%" }}>
|
||||
<Row gutter={[16, 16]} style={{ height: "100%" }}>
|
||||
<Col span={6} style={{ height: "100%" }}>
|
||||
<Col span={selectedSpans.l} style={{ height: "100%" }}>
|
||||
<Tabs defaultActiveKey="latest" style={{ height: "100%" }}>
|
||||
<Tabs.TabPane key="latest" tab="Latest" style={{ height: "100%" }}>
|
||||
<JobsListOrganism />
|
||||
@@ -23,7 +40,7 @@ export function JobsPage() {
|
||||
</Tabs.TabPane>
|
||||
</Tabs>
|
||||
</Col>
|
||||
<Col span={18} style={{ height: "100%" }}>
|
||||
<Col span={selectedSpans.r} style={{ height: "100%" }}>
|
||||
<JobsDetailOrganism />
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
@@ -6,14 +6,26 @@ import { createStructuredSelector } from "reselect";
|
||||
import SiderMenuOrganism from "../../organisms/sider-menu/sider-menu.organism";
|
||||
import Jobs from "../jobs/jobs.page";
|
||||
import SettingsPage from "../settings/settings.page";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({});
|
||||
import { selectBodyshop } from "../../../redux/user/user.selectors";
|
||||
import ErrorResultAtom from "../../atoms/error-result/error-result.atom";
|
||||
const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop });
|
||||
const mapDispatchToProps = (dispatch) => ({});
|
||||
|
||||
export function RoutesPage() {
|
||||
export function RoutesPage({ bodyshop }) {
|
||||
if (bodyshop === false)
|
||||
return (
|
||||
<ErrorResultAtom
|
||||
title="No shop access"
|
||||
errorMessage="You do not currently have access to any shop. Please reach out to technical support."
|
||||
/>
|
||||
);
|
||||
return (
|
||||
<Layout style={{ background: "#fff", height: "100vh" }} hasSider>
|
||||
<Layout.Sider style={{ background: "#fff" }} collapsible>
|
||||
<Layout.Sider
|
||||
style={{ background: "#fff" }}
|
||||
collapsible
|
||||
defaultCollapsed="true"
|
||||
>
|
||||
<SiderMenuOrganism />
|
||||
</Layout.Sider>
|
||||
<Layout style={{ background: "#fff" }}>
|
||||
|
||||
@@ -2,7 +2,6 @@ import { LockOutlined, UserOutlined } from "@ant-design/icons";
|
||||
import { Alert, Button, Form, Input, Typography } from "antd";
|
||||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { Link } from "react-router-dom";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import ImEXOnlineLogo from "../../../assets/logo192.png";
|
||||
import { emailSignInStart } from "../../../redux/user/user.actions";
|
||||
@@ -58,9 +57,6 @@ export function SignInPage({ emailSignInStart, signInError, loginLoading }) {
|
||||
Login
|
||||
</Button>
|
||||
</Form>
|
||||
<Link to={"/resetpassword"}>
|
||||
<Button>Reset Password</Button>
|
||||
</Link>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user