Skip to content

Commit 3734f31

Browse files
committed
make mods table scrollable
1 parent 0caa63c commit 3734f31

File tree

2 files changed

+61
-54
lines changed

2 files changed

+61
-54
lines changed

src/main/webapp/src/components/modsTable.jsx

Lines changed: 56 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -32,60 +32,62 @@ const ModsTable = ({mods, onUpdateClicked, onUninstallClicked, onActiveChange, o
3232
</p>
3333
</div>
3434
}
35-
<table className="table">
36-
<thead>
37-
<tr>
38-
<th scope="col">Id</th>
39-
<th scope="col">Name</th>
40-
<th scope="col">File size</th>
41-
<th scope="col" className="text-center">Installed</th>
42-
<th scope="col">Last update</th>
43-
<th scope="col"/>
44-
<th scope="col"/>
45-
<th scope="col" className="text-center">Active</th>
46-
</tr>
47-
</thead>
48-
<tbody>
49-
{mods.map(mod => (
50-
<tr key={mod.id} className={mod.failed ? "table-danger" : ""}>
51-
<td>
52-
<a href={getWorkshopUrl(mod.id)}
53-
target="_blank"
54-
rel="noopener noreferrer"
55-
>
56-
{mod.id}
57-
</a>
58-
</td>
59-
<td>{mod.name}</td>
60-
<td>{mod.fileSize && humanFileSize(mod.fileSize)}</td>
61-
<td className="text-center">{getInstalledIcon(mod)}</td>
62-
<td>{mod.lastUpdated}</td>
63-
<td>
64-
<button className="btn btn-sm btn-primary"
65-
onClick={() => onUpdateClicked(mod.id)}
66-
>
67-
Update
68-
</button>
69-
</td>
70-
<td>
71-
<button className="btn btn-sm btn-danger"
72-
onClick={() => onUninstallClicked(mod.id)}
73-
>
74-
Uninstall
75-
</button>
76-
</td>
77-
<td className="text-center">
78-
<input type="checkbox"
79-
value={mod.id}
80-
checked={mod.active}
81-
disabled={!mod.active && mod.failed}
82-
onChange={onActiveChange}/>
83-
</td>
84-
</tr>
85-
)
86-
)}
87-
</tbody>
88-
</table>
35+
<div className="mods-table__wrapper">
36+
<table className="table">
37+
<thead>
38+
<tr>
39+
<th scope="col">Id</th>
40+
<th scope="col">Name</th>
41+
<th scope="col">File size</th>
42+
<th scope="col" className="text-center">Installed</th>
43+
<th scope="col">Last update</th>
44+
<th scope="col"/>
45+
<th scope="col"/>
46+
<th scope="col" className="text-center">Active</th>
47+
</tr>
48+
</thead>
49+
<tbody>
50+
{mods.map(mod => (
51+
<tr key={mod.id} className={mod.failed ? "table-danger" : ""}>
52+
<td>
53+
<a href={getWorkshopUrl(mod.id)}
54+
target="_blank"
55+
rel="noopener noreferrer"
56+
>
57+
{mod.id}
58+
</a>
59+
</td>
60+
<td>{mod.name}</td>
61+
<td>{mod.fileSize && humanFileSize(mod.fileSize)}</td>
62+
<td className="text-center">{getInstalledIcon(mod)}</td>
63+
<td>{mod.lastUpdated}</td>
64+
<td>
65+
<button className="btn btn-sm btn-primary"
66+
onClick={() => onUpdateClicked(mod.id)}
67+
>
68+
Update
69+
</button>
70+
</td>
71+
<td>
72+
<button className="btn btn-sm btn-danger"
73+
onClick={() => onUninstallClicked(mod.id)}
74+
>
75+
Uninstall
76+
</button>
77+
</td>
78+
<td className="text-center">
79+
<input type="checkbox"
80+
value={mod.id}
81+
checked={mod.active}
82+
disabled={!mod.active && mod.failed}
83+
onChange={onActiveChange}/>
84+
</td>
85+
</tr>
86+
)
87+
)}
88+
</tbody>
89+
</table>
90+
</div>
8991

9092
<button className="float-right btn btn-primary"
9193
onClick={onApplyClicked}>

src/main/webapp/src/index.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,8 @@ code {
1111
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
1212
monospace;
1313
}
14+
15+
.mods-table__wrapper {
16+
max-height: 600px;
17+
overflow: auto;
18+
}

0 commit comments

Comments
 (0)