Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Table): migrate TableHead to Tailwind
- Loading branch information
Showing
1 changed file
with
5 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,14 @@ | ||
"use client"; | ||
|
||
import * as React from "react"; | ||
import styled from "styled-components"; | ||
|
||
import type * as Common from "../../common/types"; | ||
import defaultTheme from "../../defaultTheme"; | ||
import { StyledTableCell } from "../TableCell"; | ||
|
||
export const StyledTableHead = styled(({ children, className, dataTest }) => ( | ||
<thead className={className} data-test={dataTest}> | ||
const TableHead = ({ children, dataTest }: React.PropsWithChildren<Common.Globals>) => ( | ||
<thead | ||
className="border-b-cloud-dark w-full whitespace-nowrap border-b font-bold" | ||
data-test={dataTest} | ||
> | ||
{children} | ||
</thead> | ||
))` | ||
border-bottom: 1px solid ${({ theme }) => theme.orbit.borderColorTableHead}; | ||
width: 100%; | ||
white-space: nowrap; | ||
${StyledTableCell} { | ||
font-weight: ${({ theme }) => theme.orbit.fontWeightTableHead}; | ||
} | ||
`; | ||
|
||
StyledTableHead.defaultProps = { | ||
theme: defaultTheme, | ||
}; | ||
|
||
const TableHead: React.FC<React.PropsWithChildren<Common.Globals>> = ({ children, dataTest }) => ( | ||
<StyledTableHead dataTest={dataTest}>{children}</StyledTableHead> | ||
); | ||
|
||
export default TableHead; |