tanstak table corrected adaptive layout

This commit is contained in:
smanylov
2026-01-04 13:27:59 +07:00
parent edcac25b02
commit 6c46a1a655
6 changed files with 63 additions and 26 deletions
+2 -2
View File
@@ -14,7 +14,7 @@ export default function Page() {
const t = useTranslations('Global'); const t = useTranslations('Global');
return ( return (
<div> <>
<Suspense fallback={<>...</>}> <Suspense fallback={<>...</>}>
<PageTitle title="statistics"> <PageTitle title="statistics">
</PageTitle> </PageTitle>
@@ -24,6 +24,6 @@ export default function Page() {
</div> </div>
<FilesTable fileType={'all'}/> <FilesTable fileType={'all'}/>
</Suspense> </Suspense>
</div> </>
); );
} }
+5 -5
View File
@@ -336,29 +336,29 @@ export default function TanstakFilesTable({ fileType }: { fileType: string }) {
) )
}, },
cell: ({ row }) => ( cell: ({ row }) => (
<div className="flex space-x-2 justify-center"> <div className="actions">
<button <button
onClick={() => handleView(row.original)} onClick={() => handleView(row.original)}
className="px-3 py-1 bg-blue-500 text-white rounded hover:bg-blue-600 text-sm" className="bg-blue-500 hover:bg-blue-600"
> >
<IconEye /> <IconEye />
</button> </button>
<button <button
onClick={() => handleDownload(row.original)} onClick={() => handleDownload(row.original)}
disabled={isFileLoading} disabled={isFileLoading}
className="px-3 py-1 bg-green-500 text-white rounded hover:bg-green-600 text-sm" className="bg-green-500 hover:bg-green-600"
> >
<IconFileOpen /> <IconFileOpen />
</button> </button>
<button <button
onClick={() => handleProtect(row.original)} onClick={() => handleProtect(row.original)}
className="px-3 py-1 bg-violet-500 text-white rounded hover:bg-violet-600 text-sm" className="bg-violet-500 hover:bg-violet-600"
> >
<IconShieldExclamation /> <IconShieldExclamation />
</button> </button>
<button <button
onClick={() => handleOpenWindowForRemove(row.original)} onClick={() => handleOpenWindowForRemove(row.original)}
className="px-3 py-1 bg-red-700 text-white rounded hover:bg-red-800 text-sm" className="bg-red-700 hover:bg-red-800"
> >
<IconDelete /> <IconDelete />
</button> </button>
+18 -2
View File
@@ -33,7 +33,7 @@
} }
.main-containter-wrapper { .main-containter-wrapper {
margin-left: 280px; margin-left: var(--side-bar-width);;
flex: 1; flex: 1;
padding: 30px; padding: 30px;
background: v.$bg-light; background: v.$bg-light;
@@ -45,6 +45,21 @@
margin: 0 auto; margin: 0 auto;
} }
.block-wrapper {
background: v.$white;
border-radius: 20px;
padding: 25px;
box-shadow: 0 4px 20px v.$shadow-1;
border: 1px solid v.$b-color-1;
margin-bottom: 30px;
width: 100%;
max-width: calc(100vw - var(--side-bar-width) - 60px);
&.auto {
width: auto;
}
}
.btn { .btn {
padding: 12px 24px; padding: 12px 24px;
border-radius: 10px; border-radius: 10px;
@@ -165,7 +180,8 @@
} }
.sidebar { .sidebar {
width: 280px; /* width: v.$side-bar-width; */
width: var(--side-bar-width);
background: linear-gradient(180deg, v.$p-color 0%, v.$s-color 100%); background: linear-gradient(180deg, v.$p-color 0%, v.$s-color 100%);
padding: 30px 0; padding: 30px 0;
position: fixed; position: fixed;
+28 -15
View File
@@ -281,15 +281,6 @@
} }
} }
.block-wrapper {
background: v.$white;
border-radius: 20px;
padding: 25px;
box-shadow: 0 4px 20px v.$shadow-1;
border: 1px solid v.$b-color-1;
margin-bottom: 30px;
}
.upload-section { .upload-section {
background: v.$white; background: v.$white;
border-radius: 20px; border-radius: 20px;
@@ -547,7 +538,6 @@
} }
.tanstak-table-block { .tanstak-table-block {
width: 100%;
overflow-x: auto; overflow-x: auto;
border-radius: 0.5rem; border-radius: 0.5rem;
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
@@ -557,6 +547,11 @@
width: 100%; width: 100%;
table-layout: fixed; table-layout: fixed;
@media (max-width: 1200px) {
width: 1200px;
}
>*+* { >*+* {
border-top: 1px solid v.$b-color-2; border-top: 1px solid v.$b-color-2;
} }
@@ -565,9 +560,6 @@
border-bottom: 1px solid v.$b-color-2; border-bottom: 1px solid v.$b-color-2;
} }
@media (min-width: 768px) {
table-layout: auto;
}
&-head { &-head {
background-color: v.$b-color-1; background-color: v.$b-color-1;
@@ -629,11 +621,32 @@
padding-bottom: 1rem; padding-bottom: 1rem;
white-space: nowrap; white-space: nowrap;
} }
.actions {
display: flex;
justify-content: center;
gap: 0.5rem;
flex-wrap: wrap;
button {
padding: 4px 12px;
font-size: 14px;
line-height: 20px;
border-radius: 4px;
color: v.$white;
.icon {}
@media (max-width: 1200px) {
padding: 4px;
}
}
}
} }
} }
} }
@media (max-width: 1300px) { /* @media (max-width: 1300px) {
.tanstak-table { .tanstak-table {
max-width: 800px; max-width: 800px;
margin: 0 auto; margin: 0 auto;
@@ -645,4 +658,4 @@
max-width: 500px; max-width: 500px;
margin: 0 auto; margin: 0 auto;
} }
} } */
+9 -1
View File
@@ -15,4 +15,12 @@ $red: #dc2626;
$color-image: #f08c00; $color-image: #f08c00;
$color-video: #2f9e44; $color-video: #2f9e44;
$color-audio: #1971c2; $color-audio: #1971c2;
:root {
--side-bar-width: 280px;
@media (max-width: 1200px) {
--side-bar-width: 180px;
}
}
+1 -1
View File
@@ -4,7 +4,7 @@ export default function StatsGrid() {
const t = useTranslations("Global"); const t = useTranslations("Global");
return ( return (
<div className="block-wrapper stats-wrapper grow"> <div className="block-wrapper stats-wrapper grow auto">
<h3> <h3>
{t('your-content')} {t('your-content')}
</h3> </h3>