Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021_123
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2021_123
2021_123
Commits
b71b4751
Commit
b71b4751
authored
Nov 22, 2021
by
A.M.R.Y Bandara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Games home page js file
parent
070ec27b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
136 additions
and
0 deletions
+136
-0
games.js
games.js
+136
-0
No files found.
games.js
0 → 100644
View file @
b71b4751
import
React
,
{
Component
}
from
'
react
'
;
import
{
Container
,
Row
}
from
'
reactstrap
'
;
import
homedata
from
'
../../data/home.json
'
;
import
{
Button
}
from
'
react-bootstrap
'
;
import
axios
from
"
axios
"
;
import
Loader
from
'
react-loader-spinner
'
import
Typed
from
'
react-typed
'
;
import
Navbar
from
'
../global-components/navbar
'
;
import
Footer
from
'
../global-components/footer
'
;
import
{
Form
,
Col
,
Card
,
Table
,
Overlay
,
Modal
,
ButtonGroup
}
from
'
react-bootstrap
'
;
class
Mammogram
extends
Component
{
constructor
(){
super
()
this
.
state
=
{
show
:
false
,
Uploadfile
:
null
,
result
:
null
,
loader
:
false
,
imgPath
:
null
,
size
:
null
,
level
:
null
,
nipple
:
null
,
umame
:
null
}
this
.
checkUser
=
this
.
checkUser
.
bind
(
this
);
}
componentDidMount
(){
this
.
setState
({
uname
:
sessionStorage
.
getItem
(
'
userName
'
)});
}
handleAge
=
(
event
)
=>
{
console
.
log
(
event
.
target
.
value
)
this
.
setState
({
age
:
event
.
target
.
value
})
}
handleGender
=
(
event
)
=>
{
console
.
log
(
event
.
target
.
value
)
this
.
setState
({
gender
:
event
.
target
.
value
})
}
handleNewImage
(
e
)
{
let
file
=
e
.
target
.
files
[
0
]
this
.
setState
({
Uploadfile
:
file
})
}
submitData
(
e
){
this
.
setState
({
show
:
false
})
this
.
setState
({
loader
:
true
})
let
file
=
this
.
state
.
Uploadfile
let
currentComponent
=
this
;
const
data
=
new
FormData
();
data
.
append
(
'
file
'
,
file
);
data
.
append
(
'
filename
'
,
"
aa
"
);
axios
({
url
:
'
http://localhost:5000/checkMammogram
'
,
method
:
"
POST
"
,
data
:
data
}).
then
((
response
)
=>
{
currentComponent
.
setState
({
show
:
true
})
currentComponent
.
setState
({
loader
:
false
})
currentComponent
.
setState
({
imgPath
:
response
.
data
[
"
path
"
]})
currentComponent
.
setState
({
size
:
response
.
data
[
"
size
"
]})
if
(
response
.
data
[
"
status
"
]
==
"
1
"
){
currentComponent
.
setState
({
result
:
"
Malignant
"
})
}
else
if
(
response
.
data
[
"
status
"
]
==
"
0
"
){
currentComponent
.
setState
({
result
:
"
Benign
"
})
}
else
{
currentComponent
.
setState
({
result
:
"
Normal
"
})
}
if
(
response
.
data
[
"
nipple
"
]
==
"
0
"
){
currentComponent
.
setState
({
nipple
:
"
Abnormal
"
})
}
else
{
currentComponent
.
setState
({
nipple
:
"
Normal
"
})
}
});
}
checkUser
(){
console
.
log
(
sessionStorage
.
getItem
(
'
userName
'
))
if
(
sessionStorage
.
getItem
(
'
userName
'
)
==
null
){
this
.
setState
({
modelShow
:
true
})
}
else
{
this
.
props
.
history
.
push
({
pathname
:
'
/mam
'
,
search
:
'
?query=
'
,
state
:
{
img
:
this
.
state
.
imgPath
,
size
:
this
.
state
.
size
,
status
:
this
.
state
.
result
,
nipple
:
this
.
state
.
nipple
}
})
}
}
CloseModal
(){
this
.
setState
({
modelShow
:
!
this
.
state
.
modelShow
})
}
render
()
{
let
getData
=
homedata
.
herov2
let
factsInfo
=
homedata
.
results
let
sectionHeadingInfo
=
factsInfo
.
sectionHeading
let
getSpecialFeatures
=
homedata
.
upload
let
publicUrl
=
process
.
env
.
PUBLIC_URL
const
inlineStyle
=
{
backgroundImage
:
'
url(
'
+
publicUrl
+
getSpecialFeatures
.
bgImg
+
'
)
'
}
return
(
<>
<
Navbar
/>
<
br
/>
<
br
/>
<
section
id
=
"
home
"
className
=
"
text-center hero-section-1
"
>
<
ButtonGroup
vertical
>
<
button
className
=
"
games_btn
"
><
a
href
=
"
#leaderboard
"
target
=
"
_blank
"
style
=
{{
color
:
"
#fff
"
}}
>
Leader
Board
<
/a></
button
><
br
/>
<
button
className
=
"
games_btn
"
><
a
href
=
{
'
http://127.0.0.1:5000/addition?name=
'
+
sessionStorage
.
getItem
(
'
userName
'
)}
target
=
"
_blank
"
style
=
{{
color
:
"
#fff
"
}}
>
Addition
<
/a></
button
><
br
/>
<
button
className
=
"
games_btn
"
><
a
href
=
{
'
http://127.0.0.1:5000/substraction?name=
'
+
sessionStorage
.
getItem
(
'
userName
'
)}
target
=
"
_blank
"
style
=
{{
color
:
"
#fff
"
}}
>
Substraction
<
/a></
button
><
br
/>
<
button
className
=
"
games_btn
"
><
a
href
=
{
'
http://127.0.0.1:5000/division?name=
'
+
sessionStorage
.
getItem
(
'
userName
'
)}
target
=
"
_blank
"
style
=
{{
color
:
"
#fff
"
}}
>
Division
<
/a></
button
><
br
/>
<
button
className
=
"
games_btn
"
><
a
href
=
{
'
http://127.0.0.1:5000/multiplication?name=
'
+
sessionStorage
.
getItem
(
'
userName
'
)}
target
=
"
_blank
"
style
=
{{
color
:
"
#fff
"
}}
>
Multiplication
<
/a></
button
>
<
/ButtonGroup
>
<
/section
>
<
br
/>
<
br
/>
<
br
/>
<
Footer
/>
<
/
>
)
}
}
export
default
Mammogram
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