fix: changed back table style to side scrolling on mobile
This commit is contained in:
+18
-16
@@ -123,23 +123,25 @@ export const AdminPage = ({}) => {
|
||||
<>
|
||||
<hr />
|
||||
<div class="subtitle">Controlli speciali solo per Admin</div>
|
||||
<div class="users-table" style={{ '--cols': 4 }}>
|
||||
<div class="cell header">Username Ateneo</div>
|
||||
<div class="cell header">Nome Utente</div>
|
||||
<div class="cell header">Ruolo</div>
|
||||
<div class="cell header last-col">Azioni</div>
|
||||
<div class="scrollable">
|
||||
<div class="users-table" style={{ '--cols': 4 }}>
|
||||
<div class="cell header">Username Ateneo</div>
|
||||
<div class="cell header">Nome Utente</div>
|
||||
<div class="cell header">Ruolo</div>
|
||||
<div class="cell header last-col">Azioni</div>
|
||||
|
||||
{users.map(user => (
|
||||
<>
|
||||
<div class="cell mono">{user.id}</div>
|
||||
<div class="cell">{user.fullName}</div>
|
||||
<div class="cell">{user.role}</div>
|
||||
<div class="cell last-col">
|
||||
<button>Boh 1</button>
|
||||
<button>Boh 2</button>
|
||||
</div>
|
||||
</>
|
||||
))}
|
||||
{users.map(user => (
|
||||
<>
|
||||
<div class="cell mono">{user.id}</div>
|
||||
<div class="cell">{user.fullName}</div>
|
||||
<div class="cell">{user.role}</div>
|
||||
<div class="cell last-col">
|
||||
<button>Boh 1</button>
|
||||
<button>Boh 2</button>
|
||||
</div>
|
||||
</>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form">
|
||||
<div class="fill subtitle mono">su $USER</div>
|
||||
|
||||
+56
-142
@@ -24,6 +24,8 @@ body {
|
||||
font-weight: 300;
|
||||
font-size: 18px;
|
||||
|
||||
color: #222;
|
||||
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
@@ -385,135 +387,42 @@ main.page-problem {
|
||||
}
|
||||
|
||||
main.page-scores {
|
||||
.scrollable {
|
||||
display: flex;
|
||||
overflow: auto;
|
||||
.table {
|
||||
grid-template-columns: repeat(3, auto);
|
||||
|
||||
max-width: 100%;
|
||||
padding: 1rem;
|
||||
|
||||
.table {
|
||||
grid-template-columns: repeat(3, auto);
|
||||
|
||||
.icon {
|
||||
cursor: pointer;
|
||||
display: grid;
|
||||
place-content: center;
|
||||
}
|
||||
|
||||
.cell {
|
||||
padding: 1rem 2rem 1rem 1rem;
|
||||
|
||||
&.header {
|
||||
font-weight: 400;
|
||||
font-size: 22px;
|
||||
|
||||
padding-right: 0.5rem;
|
||||
|
||||
background: #f0f0f0;
|
||||
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
.icon {
|
||||
cursor: pointer;
|
||||
display: grid;
|
||||
place-content: center;
|
||||
}
|
||||
|
||||
// .table {
|
||||
// display: grid;
|
||||
.cell {
|
||||
padding: 1rem 2rem 1rem 1rem;
|
||||
|
||||
// grid-template-columns: auto auto auto;
|
||||
&.header {
|
||||
font-weight: 400;
|
||||
font-size: 22px;
|
||||
|
||||
// box-shadow: -2px 4px 6px 1px #00000018, 0 0 4px 0px #00000010;
|
||||
// // border: 1px solid #ddd;
|
||||
// border-radius: 0.5rem;
|
||||
// background: #ffffff;
|
||||
padding-right: 0.5rem;
|
||||
|
||||
// user-select: none;
|
||||
background: #f0f0f0;
|
||||
|
||||
// position: relative;
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
|
||||
// .cell {
|
||||
// padding: 1rem 2rem;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
// gap: 0.5rem;
|
||||
&:nth-child(3) {
|
||||
border-top-right-radius: 0.5rem;
|
||||
}
|
||||
|
||||
// border-left: 1px solid #ddd;
|
||||
// border-top: 1px solid #ddd;
|
||||
|
||||
// &:nth-child(3n + 3) {
|
||||
// border-right: 1px solid #ddd;
|
||||
// }
|
||||
|
||||
// &:nth-last-child(1),
|
||||
// &:nth-last-child(2),
|
||||
// &:nth-last-child(3) {
|
||||
// border-bottom: 1px solid #ddd;
|
||||
// }
|
||||
|
||||
// &:first-child {
|
||||
// border-top-left-radius: 0.5rem;
|
||||
// }
|
||||
|
||||
// &:nth-child(3) {
|
||||
// border-top-right-radius: 0.5rem;
|
||||
// }
|
||||
|
||||
// &:nth-last-child(3) {
|
||||
// border-bottom-left-radius: 0.5rem;
|
||||
// }
|
||||
|
||||
// &:last-child {
|
||||
// border-bottom-right-radius: 0.5rem;
|
||||
// }
|
||||
|
||||
// &:not(.header) {
|
||||
// user-select: text;
|
||||
|
||||
// &:nth-child(3n + 1) {
|
||||
// text-align: left;
|
||||
// }
|
||||
|
||||
// &:nth-child(3n + 2),
|
||||
// &:nth-child(3n + 3) {
|
||||
// text-align: center;
|
||||
// }
|
||||
|
||||
// &:nth-child(3n + 3) {
|
||||
// &::after {
|
||||
// content: '';
|
||||
// position: absolute;
|
||||
|
||||
// left: 0;
|
||||
// right: 0;
|
||||
// height: 3rem;
|
||||
|
||||
// transform: translate(0, -1rem);
|
||||
|
||||
// pointer-events: none;
|
||||
// background: transparent;
|
||||
// }
|
||||
|
||||
// &:hover::after {
|
||||
// background: #00000006;
|
||||
// }
|
||||
// }
|
||||
|
||||
// &:hover {
|
||||
// &:nth-child(3n + 1) + .cell + .cell::after {
|
||||
// background: #00000006;
|
||||
// }
|
||||
|
||||
// &:nth-child(3n + 2) + .cell::after {
|
||||
// background: #00000006;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
&:nth-last-child(3) {
|
||||
border-bottom-left-radius: 0.5rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -521,6 +430,14 @@ main.page-scores {
|
||||
// Components
|
||||
//
|
||||
|
||||
.scrollable {
|
||||
display: flex;
|
||||
overflow: auto;
|
||||
|
||||
max-width: 100%;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.table {
|
||||
display: grid;
|
||||
|
||||
@@ -533,11 +450,11 @@ main.page-scores {
|
||||
|
||||
user-select: none;
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
.cell {
|
||||
padding: 0.75rem;
|
||||
|
||||
white-space: nowrap;
|
||||
|
||||
border-right: 1px solid #ddd;
|
||||
border-bottom: 1px solid #ddd;
|
||||
|
||||
@@ -547,6 +464,12 @@ main.page-scores {
|
||||
align-items: center;
|
||||
justify-content: start;
|
||||
|
||||
&:first-child {
|
||||
border-top-left-radius: 0.5rem;
|
||||
}
|
||||
&:last-child {
|
||||
border-top-left-radius: 0.5rem;
|
||||
}
|
||||
&.last-col {
|
||||
border-right: none;
|
||||
}
|
||||
@@ -574,27 +497,12 @@ main.page-scores {
|
||||
}
|
||||
|
||||
@media screen and (max-width: $device-s-width), (pointer: coarse) {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
width: 100%;
|
||||
|
||||
.cell {
|
||||
padding: 0.5rem 0.75rem;
|
||||
padding: 0.5rem;
|
||||
gap: 0.5rem;
|
||||
|
||||
border-bottom: 1px dashed #ddd;
|
||||
border-right: none;
|
||||
|
||||
&.last-row {
|
||||
border-bottom: 1px dashed #ddd;
|
||||
}
|
||||
|
||||
&.last-col {
|
||||
border-bottom: 1px solid #bbb;
|
||||
}
|
||||
|
||||
&.last-row.last-col {
|
||||
border-bottom: none;
|
||||
&.header {
|
||||
padding: 0.75rem 0.5rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -907,8 +815,14 @@ main.page-admin {
|
||||
|
||||
grid-template-columns: auto 1fr auto auto;
|
||||
|
||||
width: 100%;
|
||||
max-width: 80ch;
|
||||
.cell {
|
||||
&:nth-child(4) {
|
||||
border-top-right-radius: 0.5rem;
|
||||
}
|
||||
&:nth-last-child(4) {
|
||||
border-bottom-left-radius: 0.5rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user