ui(admin): node changes

This commit is contained in:
Matthew Penner 2021-03-23 17:47:24 -06:00
parent 7b38f05019
commit 8a24c1a142
11 changed files with 424 additions and 333 deletions

View file

@ -5,19 +5,11 @@ import styled from 'styled-components/macro';
import tw from 'twin.macro';
import { PaginatedResult } from '@/api/http';
export const TableHead = ({ children }: { children: React.ReactNode }) => {
return (
<thead css={tw`bg-neutral-900 border-t border-b border-neutral-500`}>
<tr>
<th css={tw`px-6 py-2`}/>
export const TableHeader = ({ name }: { name?: string }) => {
if (!name) {
return <th css={tw`px-6 py-2`}/>;
}
{children}
</tr>
</thead>
);
};
export const TableHeader = ({ name }: { name: string }) => {
return (
<th css={tw`px-6 py-2`}>
<span css={tw`flex flex-row items-center cursor-pointer`}>
@ -34,6 +26,17 @@ export const TableHeader = ({ name }: { name: string }) => {
);
};
export const TableHead = ({ children }: { children: React.ReactNode }) => {
return (
<thead css={tw`bg-neutral-900 border-t border-b border-neutral-500`}>
<tr>
<TableHeader/>
{children}
</tr>
</thead>
);
};
export const TableBody = ({ children }: { children: React.ReactNode }) => {
return (
<tbody>
@ -117,7 +120,7 @@ export function Pagination<T> ({ data: { pagination }, onPageSelect, children }:
Showing <span css={tw`text-neutral-300`}>{((pagination.currentPage - 1) * pagination.perPage) + 1}</span> to <span css={tw`text-neutral-300`}>{((pagination.currentPage - 1) * pagination.perPage) + pagination.count}</span> of <span css={tw`text-neutral-300`}>{pagination.total}</span> results
</p>
{ isFirstPage && isLastPage ?
{isFirstPage && isLastPage ?
null
:
<div css={tw`flex flex-row ml-auto`}>
@ -191,7 +194,7 @@ export const ContentWrapper = ({ checked, onSelectAllClick, children }: Params)
</svg>
</div>
<div css={tw`flex flex-row items-center px-2 py-1 ml-auto rounded cursor-pointer bg-neutral-600`}>
{/* <div css={tw`flex flex-row items-center px-2 py-1 ml-auto rounded cursor-pointer bg-neutral-600`}>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" css={tw`w-6 h-6 text-neutral-300`}>
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"/>
</svg>
@ -199,7 +202,7 @@ export const ContentWrapper = ({ checked, onSelectAllClick, children }: Params)
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" css={tw`w-4 h-4 ml-1 text-neutral-200`}>
<path clipRule="evenodd" fillRule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"/>
</svg>
</div>
</div> */}
</div>
{children}