Skip to content

Commit

Permalink
feat(Table): migrate TableHead to Tailwind
Browse files Browse the repository at this point in the history
  • Loading branch information
oreqizer committed Nov 8, 2023
1 parent f18a75c commit ef0a54e
Showing 1 changed file with 5 additions and 22 deletions.
27 changes: 5 additions & 22 deletions packages/orbit-components/src/Table/TableHead/index.tsx
@@ -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;

0 comments on commit ef0a54e

Please sign in to comment.