Commit 5ccaa161 by Ajmal.S

form stories added

parent 037d1541
const Form = ({ onAdd, editId, text, setText, mark, setMark, onEdit, editMode }) => {
import React from 'react';
import PropTypes from 'prop-types';
import '../../src/index.css'
export const Form = ({ onAdd, editId, text, setText, mark, setMark, onEdit, editMode }) => {
const handleSubmit = (e) => {
e.preventDefault()
......@@ -7,7 +11,7 @@ const Form = ({ onAdd, editId, text, setText, mark, setMark, onEdit, editMode })
alert('Please Enter Student Name');
return;
} else if (!mark) {
alert('Please Enter Mark')
alert('Please Enter Mark');
return;
}
......@@ -37,4 +41,16 @@ const Form = ({ onAdd, editId, text, setText, mark, setMark, onEdit, editMode })
)
}
Form.propTypes = {
editMode: PropTypes.bool,
handleSubmit: PropTypes.func,
onEdit: PropTypes.func,
editId: PropTypes.string,
text: PropTypes.string,
mark: PropTypes.string,
// setText: PropTypes.func,
// setMark: PropTypes.func,
onAdd: PropTypes.func
};
export default Form
import React from 'react';
import { Form } from '../components/Form';
export default {
title: 'Todo/Components',
component: Form,
};
const Template = (args) => <Form {...args} />;
export const studentForm = Template.bind({});
studentForm.args = {
// text: '90',
};
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