Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
simple-todo-app
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ajmal.S
simple-todo-app
Commits
5ccaa161
Commit
5ccaa161
authored
Mar 15, 2022
by
Ajmal.S
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
form stories added
parent
037d1541
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
2 deletions
+35
-2
Form.js
src/components/Form.js
+18
-2
Form.stories.js
src/stories/Form.stories.js
+17
-0
No files found.
src/components/Form.js
View file @
5ccaa161
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
src/stories/Form.stories.js
0 → 100644
View file @
5ccaa161
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',
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment