Skip to content
Snippets Groups Projects
Commit 8acee02c authored by Aggarwal Himanshu's avatar Aggarwal Himanshu
Browse files

Add table header component

parent fc6445a6
No related branches found
No related tags found
2 merge requests!17Merge develop into main,!14Fix Table Header
...@@ -18,6 +18,19 @@ export function TableRow({ children, className }) { ...@@ -18,6 +18,19 @@ export function TableRow({ children, className }) {
); );
} }
export function TableHeader({ children, className }) {
return (
<th
className={classNames(
"w-full flex justify-between dark:bg-dark-800 shadow-lg shadow-dark-800 my-4 mx-2 px-6 text-slate-900 dark:text-white",
className
)}
>
{children}
</th>
);
}
export function TableCell({ children, className }) { export function TableCell({ children, className }) {
return ( return (
<td <td
......
...@@ -21,7 +21,12 @@ import { useFilters, useOnClickOutside } from "../hooks"; ...@@ -21,7 +21,12 @@ import { useFilters, useOnClickOutside } from "../hooks";
import { Filter, FilterButton, Filters } from "../components/filters/Filter"; import { Filter, FilterButton, Filters } from "../components/filters/Filter";
import { FilterDropdown } from "../components/dropdown/FilterDropdown"; import { FilterDropdown } from "../components/dropdown/FilterDropdown";
import { filterOptions } from "../constants"; import { filterOptions } from "../constants";
import { Table, TableCell, TableRow } from "../components/table/Table"; import {
Table,
TableCell,
TableHeader,
TableRow,
} from "../components/table/Table";
import Image from "next/image"; import Image from "next/image";
import CryptoRowLineChart from "../components/charts/CryptoRowLineChart"; import CryptoRowLineChart from "../components/charts/CryptoRowLineChart";
import classNames from "classnames"; import classNames from "classnames";
...@@ -166,8 +171,8 @@ export default function Home() { ...@@ -166,8 +171,8 @@ export default function Home() {
> >
<Table> <Table>
{/* Table Header */} {/* Table Header */}
<TableRow className="h-14 items-center sticky top-0 z-40"> <TableHeader className="h-14 items-center sticky top-0 z-40">
<TableCell className="w-6 h-10"></TableCell> <TableCell className="w-6 h-10 text-center">Icon</TableCell>
<TableCell className="w-24 h-10"> <TableCell className="w-24 h-10">
<p className="font-medium text-base text-center">Name</p> <p className="font-medium text-base text-center">Name</p>
</TableCell> </TableCell>
...@@ -196,7 +201,7 @@ export default function Home() { ...@@ -196,7 +201,7 @@ export default function Home() {
</p> </p>
</div> </div>
</TableCell> </TableCell>
</TableRow> </TableHeader>
{/* Table Content */} {/* Table Content */}
{!listOfCoins.isLoading && {!listOfCoins.isLoading &&
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment