Skip to content

Commit

Permalink
feat(edit): grid layout for toggle lines (#1110)
Browse files Browse the repository at this point in the history
  • Loading branch information
stianjsu authored Jul 6, 2023
1 parent d22b92e commit 245d3c4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
32 changes: 17 additions & 15 deletions next-tavla/src/Admin/scenarios/SelectLines/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,23 @@ function SelectLines<T extends TStopPlaceTile | TQuayTile>({
return (
<div className={classes.lineToggleContainer}>
<ExpandablePanel title="Velg linjer">
{uniqLines.map((line) => (
<div key={line.id}>
<Switch
checked={
tile.whitelistedLines?.includes(line.id) ??
false
}
onChange={() => {
toggleLine(line.id)
}}
>
{line.publicCode} {line.name}
</Switch>
</div>
))}
<div className={classes.linesGrid}>
{uniqLines.map((line) => (
<div key={line.id}>
<Switch
checked={
tile.whitelistedLines?.includes(line.id) ??
false
}
onChange={() => {
toggleLine(line.id)
}}
>
{line.publicCode} {line.name}
</Switch>
</div>
))}
</div>
</ExpandablePanel>
</div>
)
Expand Down
5 changes: 5 additions & 0 deletions next-tavla/src/Admin/scenarios/SelectLines/styles.module.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.lineToggleContainer {
margin-bottom: 0.5em;
}

.linesGrid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(30em, 1fr));
}

0 comments on commit 245d3c4

Please sign in to comment.