Commit 3feec0c2 authored by janithgamage1.ed's avatar janithgamage1.ed

fix: update

Desc : update project
parent e8822483
......@@ -4,6 +4,7 @@ export interface dataProps {
_id: number | string | undefined;
tutorialCode: String;
tutorialTitle: String;
tutorialDescription: String;
tutorialImage: String;
status: Number;
createdBy: String;
......@@ -23,6 +24,7 @@ export interface tutorialProps {
_id: number | string | undefined;
tutorialCode: String;
tutorialTitle: String;
tutorialDescription: String;
tutorialImage: String;
status: Number;
createdBy: String;
......
......@@ -26,6 +26,7 @@ import IconButton from 'components/@extended/IconButton';
// assets
import { DeleteFilled } from '@ant-design/icons';
import { InputLabel, TextField } from '@mui/material';
import AlertTutorialDelete from './AlertTutorialDelete';
// types
......@@ -35,6 +36,20 @@ const getInitialValues = (tutorial: FormikValues | null) => {
const newTutorial = {
_id: undefined,
tutorialCode: "",
tutorialTitle: "",
tutorialImage: "",
tutorialDescription: "",
taskItems: [
{
_id: undefined,
title: "",
description: "",
howToDo: "",
referenceImage: "",
referenceVideo: "",
}
]
}
if (tutorial) {
......@@ -51,6 +66,7 @@ export interface Props {
_id: number | string | undefined
tutorialCode: String;
tutorialTitle: String;
tutorialDescription: String;
tutorialImage: String;
status: Number;
createdBy: String;
......@@ -105,8 +121,8 @@ const AddEditTutorial = ({ tutorial, onCancel }: Props) => {
}
});
// const { errors, touched, handleSubmit, isSubmitting, getFieldProps } = formik;
const { handleSubmit, isSubmitting} = formik;
const { errors, touched, handleSubmit, isSubmitting, getFieldProps } = formik;
// const { handleSubmit, isSubmitting } = formik;
return (
<>
......@@ -119,6 +135,60 @@ const AddEditTutorial = ({ tutorial, onCancel }: Props) => {
<Grid container spacing={3}>
<Grid item xs={12} md={12}>
<Grid container spacing={3}>
<Grid item xs={6}>
<Stack spacing={1.25}>
<InputLabel htmlFor="tutorialCode">Tutorial Code</InputLabel>
<TextField
fullWidth
id="tutorialCode"
placeholder="Enter Tutorial Code"
{...getFieldProps('tutorialCode')}
error={Boolean(touched.tutorialCode && errors.tutorialCode)}
helperText={touched.tutorialCode && errors.tutorialCode}
/>
</Stack>
</Grid>
<Grid item xs={6}>
<Stack spacing={1.25}>
<InputLabel htmlFor="tutorialTitle">Tutorial Title</InputLabel>
<TextField
fullWidth
id="tutorialTitle"
placeholder="Enter Tutorial Title"
{...getFieldProps('tutorialTitle')}
error={Boolean(touched.tutorialTitle && errors.tutorialTitle)}
helperText={touched.tutorialTitle && errors.tutorialTitle}
/>
</Stack>
</Grid>
<Grid item xs={12}>
<Stack spacing={1.25}>
<InputLabel htmlFor="tutorialImage">Tutorial Image</InputLabel>
<TextField
fullWidth
id="tutorialImage"
placeholder="Enter Tutorial Image"
{...getFieldProps('tutorialImage')}
error={Boolean(touched.tutorialImage && errors.tutorialImage)}
helperText={touched.tutorialImage && errors.tutorialImage}
/>
</Stack>
</Grid>
<Grid item xs={12}>
<Stack spacing={1.25}>
<InputLabel htmlFor="tutorialDescription">Tutorial Description</InputLabel>
<TextField
multiline
rows={2}
fullWidth
id="tutorialDescription"
placeholder="Enter Tutorial Description"
{...getFieldProps('tutorialDescription')}
error={Boolean(touched.tutorialDescription && errors.tutorialDescription)}
helperText={touched.tutorialDescription && errors.tutorialDescription}
/>
</Stack>
</Grid>
</Grid>
</Grid>
</Grid>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment