mirror of
https://github.com/checktheroads/hyperglass
synced 2024-05-11 05:55:08 +00:00
Refactor React components & update deps
This commit is contained in:
@@ -1,24 +1,37 @@
|
||||
import React from "react";
|
||||
import * as React from "react";
|
||||
import { Box, useColorMode } from "@chakra-ui/core";
|
||||
|
||||
const Table = props => <Box as="table" textAlign="left" mt={4} width="full" {...props} />;
|
||||
const Table = props => (
|
||||
<Box as="table" textAlign="left" mt={4} width="full" {...props} />
|
||||
);
|
||||
|
||||
const bg = { light: "blackAlpha.50", dark: "whiteAlpha.50" };
|
||||
|
||||
const TableHeader = props => {
|
||||
const { colorMode } = useColorMode();
|
||||
const bg = { light: "blackAlpha.50", dark: "whiteAlpha.50" };
|
||||
return <Box as="th" bg={bg[colorMode]} fontWeight="semibold" p={2} fontSize="sm" {...props} />;
|
||||
const { colorMode } = useColorMode();
|
||||
|
||||
return (
|
||||
<Box
|
||||
as="th"
|
||||
bg={bg[colorMode]}
|
||||
fontWeight="semibold"
|
||||
p={2}
|
||||
fontSize="sm"
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
const TableCell = ({ isHeader = false, ...props }) => (
|
||||
<Box
|
||||
as={isHeader ? "th" : "td"}
|
||||
p={2}
|
||||
borderTopWidth="1px"
|
||||
borderColor="inherit"
|
||||
fontSize="sm"
|
||||
whiteSpace="normal"
|
||||
{...props}
|
||||
/>
|
||||
<Box
|
||||
as={isHeader ? "th" : "td"}
|
||||
p={2}
|
||||
borderTopWidth="1px"
|
||||
borderColor="inherit"
|
||||
fontSize="sm"
|
||||
whiteSpace="normal"
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
|
||||
export { TableCell, TableHeader, Table };
|
||||
|
Reference in New Issue
Block a user