Spaces:
Running
Running
Mhamdans17 commited on
Commit ·
1b31428
1
Parent(s): b9857f0
feat: make company column sticky on horizontal scroll
Browse files- src/index.css +25 -0
- src/pages/AdminTenantSettings.jsx +3 -6
src/index.css
CHANGED
|
@@ -163,6 +163,8 @@ h1, h2, h3, .font-headline { font-family: var(--font-headline); }
|
|
| 163 |
/* Modals full-width on mobile */
|
| 164 |
.modal-responsive { max-width: 100% !important; margin: 0 !important; border-radius: 20px 20px 0 0 !important; position: fixed !important; bottom: 0 !important; left: 0 !important; right: 0 !important; }
|
| 165 |
|
|
|
|
|
|
|
| 166 |
/* Grids */
|
| 167 |
.responsive-grid-3 { grid-template-columns: repeat(2, 1fr) !important; }
|
| 168 |
.responsive-grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
|
|
@@ -230,3 +232,26 @@ h1, h2, h3, .font-headline { font-family: var(--font-headline); }
|
|
| 230 |
padding: 16px !important;
|
| 231 |
}
|
| 232 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
/* Modals full-width on mobile */
|
| 164 |
.modal-responsive { max-width: 100% !important; margin: 0 !important; border-radius: 20px 20px 0 0 !important; position: fixed !important; bottom: 0 !important; left: 0 !important; right: 0 !important; }
|
| 165 |
|
| 166 |
+
/* Grids */
|
| 167 |
+
|
| 168 |
/* Grids */
|
| 169 |
.responsive-grid-3 { grid-template-columns: repeat(2, 1fr) !important; }
|
| 170 |
.responsive-grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
|
|
|
|
| 232 |
padding: 16px !important;
|
| 233 |
}
|
| 234 |
}
|
| 235 |
+
|
| 236 |
+
/* Sticky Table Columns */
|
| 237 |
+
.table-row-hover {
|
| 238 |
+
background-color: #ffffff;
|
| 239 |
+
transition: background-color 0.15s;
|
| 240 |
+
}
|
| 241 |
+
.table-row-hover:hover {
|
| 242 |
+
background-color: #ffedeb;
|
| 243 |
+
}
|
| 244 |
+
.sticky-col {
|
| 245 |
+
position: sticky;
|
| 246 |
+
left: 0;
|
| 247 |
+
z-index: 5;
|
| 248 |
+
background-color: inherit;
|
| 249 |
+
border-right: 1px solid rgba(78,33,32,0.06);
|
| 250 |
+
}
|
| 251 |
+
.sticky-header {
|
| 252 |
+
position: sticky;
|
| 253 |
+
left: 0;
|
| 254 |
+
z-index: 10;
|
| 255 |
+
background-color: #ffffff;
|
| 256 |
+
border-right: 1px solid rgba(78,33,32,0.06);
|
| 257 |
+
}
|
src/pages/AdminTenantSettings.jsx
CHANGED
|
@@ -100,7 +100,7 @@ export default function AdminTenantSettings() {
|
|
| 100 |
<table style={{ width: '100%', borderCollapse: 'collapse', fontSize: '14px', minWidth: '800px' }}>
|
| 101 |
<thead>
|
| 102 |
<tr style={{ borderBottom: '1px solid rgba(78,33,32,0.06)' }}>
|
| 103 |
-
<th style={{
|
| 104 |
<th style={{ textAlign: 'left', padding: '16px 24px', fontSize: '11px', fontWeight: 700, letterSpacing: '0.12em', textTransform: 'uppercase', color: 'rgba(78,33,32,0.4)', whiteSpace: 'nowrap' }}>Kontak</th>
|
| 105 |
<th style={{ textAlign: 'center', padding: '16px 12px', fontSize: '11px', fontWeight: 700, letterSpacing: '0.12em', textTransform: 'uppercase', color: 'rgba(78,33,32,0.4)', whiteSpace: 'nowrap' }}>Potong Fee (Awal)</th>
|
| 106 |
<th style={{ textAlign: 'center', padding: '16px 12px', fontSize: '11px', fontWeight: 700, letterSpacing: '0.12em', textTransform: 'uppercase', color: 'rgba(78,33,32,0.4)', whiteSpace: 'nowrap' }}>Enable Member</th>
|
|
@@ -120,11 +120,8 @@ export default function AdminTenantSettings() {
|
|
| 120 |
<p style={{ color: 'rgba(78,33,32,0.4)' }}>Belum ada klien / perusahaan</p>
|
| 121 |
</td></tr>
|
| 122 |
) : companies.map((c) => (
|
| 123 |
-
<tr key={c.id} style={{ borderBottom: '1px solid rgba(78,33,32,0.04)'
|
| 124 |
-
|
| 125 |
-
onMouseLeave={(e) => e.currentTarget.style.background = 'transparent'}
|
| 126 |
-
>
|
| 127 |
-
<td style={{ padding: '16px 24px' }}>
|
| 128 |
<div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>
|
| 129 |
<div style={{
|
| 130 |
width: '36px', height: '36px', borderRadius: '10px', display: 'flex', alignItems: 'center', justifyContent: 'center',
|
|
|
|
| 100 |
<table style={{ width: '100%', borderCollapse: 'collapse', fontSize: '14px', minWidth: '800px' }}>
|
| 101 |
<thead>
|
| 102 |
<tr style={{ borderBottom: '1px solid rgba(78,33,32,0.06)' }}>
|
| 103 |
+
<th className="sticky-header" style={{ padding: '16px 24px', fontSize: '11px', fontWeight: 700, letterSpacing: '0.12em', textTransform: 'uppercase', color: 'rgba(78,33,32,0.4)', whiteSpace: 'nowrap' }}>Perusahaan</th>
|
| 104 |
<th style={{ textAlign: 'left', padding: '16px 24px', fontSize: '11px', fontWeight: 700, letterSpacing: '0.12em', textTransform: 'uppercase', color: 'rgba(78,33,32,0.4)', whiteSpace: 'nowrap' }}>Kontak</th>
|
| 105 |
<th style={{ textAlign: 'center', padding: '16px 12px', fontSize: '11px', fontWeight: 700, letterSpacing: '0.12em', textTransform: 'uppercase', color: 'rgba(78,33,32,0.4)', whiteSpace: 'nowrap' }}>Potong Fee (Awal)</th>
|
| 106 |
<th style={{ textAlign: 'center', padding: '16px 12px', fontSize: '11px', fontWeight: 700, letterSpacing: '0.12em', textTransform: 'uppercase', color: 'rgba(78,33,32,0.4)', whiteSpace: 'nowrap' }}>Enable Member</th>
|
|
|
|
| 120 |
<p style={{ color: 'rgba(78,33,32,0.4)' }}>Belum ada klien / perusahaan</p>
|
| 121 |
</td></tr>
|
| 122 |
) : companies.map((c) => (
|
| 123 |
+
<tr key={c.id} className="table-row-hover" style={{ borderBottom: '1px solid rgba(78,33,32,0.04)' }}>
|
| 124 |
+
<td className="sticky-col" style={{ padding: '16px 24px' }}>
|
|
|
|
|
|
|
|
|
|
| 125 |
<div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>
|
| 126 |
<div style={{
|
| 127 |
width: '36px', height: '36px', borderRadius: '10px', display: 'flex', alignItems: 'center', justifyContent: 'center',
|