True mobile layout with responsive table rows (sticky header)

This commit is contained in:
7heMech
2025-11-13 02:44:24 +02:00
parent dadd10f89b
commit 1c442dcce6
3 changed files with 8 additions and 6 deletions

View File

@@ -2,5 +2,5 @@ interface Props {
children: React.ReactNode; children: React.ReactNode;
} }
export function SiteContainer({ children }: Props) { export function SiteContainer({ children }: Props) {
return <div className="container-xl py-3">{children}</div>; return <div className="container-xl py-3 min-w-0 overflow-x-auto">{children}</div>;
} }

View File

@@ -25,7 +25,7 @@ export function SiteHeader() {
> >
<span className="navbar-toggler-icon" /> <span className="navbar-toggler-icon" />
</button> </button>
<div className="navbar-brand navbar-brand-autodark d-none-navbar-horizontal pe-0 pe-md-3"> <div className="navbar-brand navbar-brand-autodark pe-0 pe-md-3">
<NavLink to="/"> <NavLink to="/">
<div className={styles.logo}> <div className={styles.logo}>
<img <img

View File

@@ -12,10 +12,12 @@ interface TableLayoutProps<TFields> {
function TableLayout<TFields>(props: TableLayoutProps<TFields>) { function TableLayout<TFields>(props: TableLayoutProps<TFields>) {
const hasRows = props.tableInstance.getRowModel().rows.length > 0; const hasRows = props.tableInstance.getRowModel().rows.length > 0;
return ( return (
<table className="table table-vcenter table-selectable mb-0"> <div className="table-responsive">
{hasRows ? <TableHeader tableInstance={props.tableInstance} /> : null} <table className="table table-vcenter table-selectable mb-0">
<TableBody {...props} /> {hasRows ? <TableHeader tableInstance={props.tableInstance} /> : null}
</table> <TableBody {...props} />
</table>
</div>
); );
} }