WIP for manual job creation
This commit is contained in:
@@ -2,18 +2,19 @@ import { Button, message, Steps } from "antd";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import JobsCreateVehicleInfoContainer from "../../components/jobs-create-vehicle-info/jobs-create-vehicle-info.container";
|
||||
import JobsCreateOwnerInfoContainer from "../../components/jobs-create-owner-info/jobs-create-owner-info.container";
|
||||
|
||||
export default function JobsCreateComponent({ form }) {
|
||||
export default function JobsCreateComponent() {
|
||||
const [pageIndex, setPageIndex] = useState(0);
|
||||
const { t } = useTranslation();
|
||||
const steps = [
|
||||
{
|
||||
title: t("jobs.labels.create.vehicleinfo"),
|
||||
content: <JobsCreateVehicleInfoContainer form={form} />
|
||||
content: <JobsCreateVehicleInfoContainer />
|
||||
},
|
||||
{
|
||||
title: t("jobs.labels.create.ownerinfo"),
|
||||
content: "Second-content"
|
||||
content: <JobsCreateOwnerInfoContainer />
|
||||
},
|
||||
{
|
||||
title: t("jobs.labels.create.jobinfo"),
|
||||
@@ -50,23 +51,22 @@ export default function JobsCreateComponent({ form }) {
|
||||
</div>
|
||||
))}
|
||||
|
||||
<div className="steps-action">
|
||||
<div className='steps-action'>
|
||||
{pageIndex > 0 && (
|
||||
<Button style={{ margin: 8 }} onClick={() => prev()}>
|
||||
Previous
|
||||
</Button>
|
||||
)}
|
||||
{pageIndex < steps.length - 1 && (
|
||||
<Button type="primary" onClick={() => next()}>
|
||||
<Button type='primary' onClick={() => next()}>
|
||||
Next
|
||||
</Button>
|
||||
)}
|
||||
{pageIndex === steps.length - 1 && (
|
||||
<Button
|
||||
type="primary"
|
||||
htmlType="submit"
|
||||
onClick={() => message.success("Processing complete!")}
|
||||
>
|
||||
type='primary'
|
||||
htmlType='submit'
|
||||
onClick={() => message.success("Processing complete!")}>
|
||||
Done
|
||||
</Button>
|
||||
)}
|
||||
|
||||
@@ -7,11 +7,11 @@ export default function JobsCreateContainer() {
|
||||
|
||||
const contextState = useState({
|
||||
vehicle: { new: false, search: "", selectedid: null },
|
||||
owner: { new: false },
|
||||
owner: { new: false, search: "", selectedid: null },
|
||||
job: null
|
||||
});
|
||||
|
||||
const [state, setState] = contextState;
|
||||
const [state] = contextState;
|
||||
|
||||
const handleFinish = values => {
|
||||
console.log("Form Values", values);
|
||||
|
||||
Reference in New Issue
Block a user