Skip to content

Commit

Permalink
introduced disabled switches
Browse files Browse the repository at this point in the history
  • Loading branch information
jzakotnik committed Aug 2, 2021
1 parent e5ea068 commit cd489e4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions nextjs/mwe/pages/lunchprofile.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export default function LunchProfile(props) {
});

const readOnly = !props.admin;

console.log("This page read only? Lets see: " + readOnly);
const authid = props.authid;
const readerid = props.reader;

Expand Down Expand Up @@ -127,6 +129,7 @@ export default function LunchProfile(props) {
name="mon"
checked={dayselection.mon}
onChange={handleInput}
disabled={readOnly}
inputProps={{ "aria-label": "controlled" }}
/>
}
Expand All @@ -137,6 +140,7 @@ export default function LunchProfile(props) {
<Switch
name="tue"
checked={dayselection.tue}
disabled={readOnly}
onChange={handleInput}
inputProps={{ "aria-label": "controlled" }}
/>
Expand All @@ -148,6 +152,7 @@ export default function LunchProfile(props) {
<Switch
name="wed"
checked={dayselection.wed}
disabled={readOnly}
onChange={handleInput}
inputProps={{ "aria-label": "controlled" }}
/>
Expand All @@ -159,6 +164,7 @@ export default function LunchProfile(props) {
<Switch
name="thu"
checked={dayselection.thu}
disabled={readOnly}
onChange={handleInput}
inputProps={{ "aria-label": "controlled" }}
/>
Expand All @@ -170,6 +176,7 @@ export default function LunchProfile(props) {
<Switch
name="fri"
checked={dayselection.fri}
disabled={readOnly}
onChange={handleInput}
inputProps={{ "aria-label": "controlled" }}
/>
Expand Down

0 comments on commit cd489e4

Please sign in to comment.