Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ESAP GUI
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ASTRON SDC
ESCAPE WP5
ESAP GUI
Merge requests
!10
Dev nico
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Dev nico
dev-nico
into
master
Overview
0
Commits
2
Pipelines
1
Changes
8
Merged
Nico Vermaas
requested to merge
dev-nico
into
master
3 years ago
Overview
0
Commits
2
Pipelines
1
Changes
8
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
dc476ac3
2 commits,
3 years ago
8 files
+
60
−
9
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
8
Search (e.g. *.vue) (Ctrl+P)
src/components/basket/addtobasket.js
+
5
−
2
Options
@@ -4,7 +4,7 @@ import { Form } from "react-bootstrap";
import
{
GlobalContext
}
from
"
../../contexts/GlobalContext
"
;
import
{
BasketContext
}
from
"
../../contexts/BasketContext
"
;
export
default
function
Addto
b
asket
(
props
)
{
export
default
function
Addto
B
asket
(
props
)
{
const
{
isAuthenticated
}
=
useContext
(
GlobalContext
);
const
basketContext
=
useContext
(
BasketContext
);
@@ -23,7 +23,10 @@ export default function Addtobasket(props) {
console
.
log
([
removeFromBasketItem
,
basketContext
]);
}
if
(
isAuthenticated
){
// fake authentication when in 'development' mode.
let
authenticated
=
isAuthenticated
||
(
process
.
env
.
NODE_ENV
===
"
development
"
)
if
(
authenticated
){
return
(
<
Form
.
Check
id
=
{
props
.
id
}
type
=
"
checkbox
"
onChange
=
{(
event
)
=>
{
const
action
=
event
.
target
.
checked
?
addToBasket
:
removeFromBasket
;
Loading