Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ecommerce-maven
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ascend
ecommerce-maven
Commits
1240e5af
Commit
1240e5af
authored
May 13, 2021
by
Christopher Cottier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
protect place order button if user not logged in
parent
762f9031
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
SubmitOrder.js
ecom-web/src/components/checkout/SubmitOrder.js
+7
-1
No files found.
ecom-web/src/components/checkout/SubmitOrder.js
View file @
1240e5af
import
React
,
{
useState
,
useEffect
}
from
'react'
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
useSelector
}
from
'react-redux'
;
export
default
function
SubmitOrder
(
props
)
{
export
default
function
SubmitOrder
(
props
)
{
const
{
currentUser
}
=
useSelector
(
state
=>
state
);
let
handleSubmitClick
=
(
e
)
=>
{
let
handleSubmitClick
=
(
e
)
=>
{
console
.
log
(
"Submit Button Clicked"
)
console
.
log
(
"Submit Button Clicked"
)
...
@@ -18,7 +21,10 @@ export default function SubmitOrder(props) {
...
@@ -18,7 +21,10 @@ export default function SubmitOrder(props) {
<
div
id
=
"SubmitButtonContainer"
>
<
div
id
=
"SubmitButtonContainer"
>
<
p
className
=
"errorMessage"
>
{(
props
.
errorWhileValidating
===
1
&&
props
.
allFieldsValidated
[
0
]
===
0
)?
'One or more fields is missing a value'
:
''
}
<
/p
>
<
p
className
=
"errorMessage"
>
{(
props
.
errorWhileValidating
===
1
&&
props
.
allFieldsValidated
[
0
]
===
0
)?
'One or more fields is missing a value'
:
''
}
<
/p
>
<
button
id
=
"SubmitButtonInput"
onClick
=
{()
=>
{
handleSubmitClick
()}}
>
Submit
Order
<
/button
>
<
button
id
=
"SubmitButtonInput"
onClick
=
{()
=>
{
handleSubmitClick
()}}
disabled
=
{
currentUser
?
false
:
true
}
>
Submit
Order
<
/button
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
...
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