1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fine-tuning overall styling

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2021-05-17 12:02:52 +03:00
parent d4c0955320
commit 32f612f673
6 changed files with 9 additions and 25 deletions

View File

@ -1,5 +1,5 @@
.icon {
@apply h-5 w-5 cursor-pointer;
@apply h-5 w-5 mr-3 cursor-pointer;
}
.icon:hover {

View File

@ -12,5 +12,5 @@
}
.title {
margin-bottom: 6px!important;
margin-bottom: 0!important;
}

View File

@ -116,9 +116,8 @@ export function InstalledExtensions({ extensions, uninstall }: Props) {
return (
<section>
<h2 className={styles.title}>Installed</h2>
<List
title="Manage your extensions in here."
title={<h2 className={styles.title}>Installed</h2>}
columns={columns}
data={data}
items={extensions}

View File

@ -9,7 +9,7 @@ export type SearchFilter = (item: object) => string | number;
interface Props extends UseTableOptions<any> {
items: object[];
filters: SearchFilter[];
title?: string;
title?: React.ReactNode;
}
export function List({ columns, data, title, items, filters, }: Props) {

View File

@ -12,11 +12,11 @@
}
.thead .tr {
margin: 0;
margin: 0 var(--margin);
}
.tr {
margin: var(--margin) 0;
margin: calc(var(--margin) * 1.6) var(--margin);
}
.th {
@ -30,7 +30,7 @@
}
.disabledArrow {
color: #909ba666;
opacity: 0.3;
}
.td {

View File

@ -2,16 +2,14 @@ import styles from "./react-table.module.css";
import React from "react";
import { useCallback, useMemo } from "react";
import { useFlexLayout, useSortBy, useTable, UseTableOptions } from "react-table";
import { FixedSizeList } from "react-window";
import { Icon } from "../icon";
import { cssNames } from "../../utils";
interface Props extends UseTableOptions<any> {
virtual?: boolean;
headless?: boolean;
}
export function Table({ columns, data, virtual, headless }: Props) {
export function Table({ columns, data, headless }: Props) {
const defaultColumn = useMemo(
() => ({
minWidth: 20,
@ -20,15 +18,11 @@ export function Table({ columns, data, virtual, headless }: Props) {
[]
);
// const scrollBarSize = React.useMemo(() => scrollbarWidth(), [])
const scrollBarSize = 10;
const {
getTableProps,
getTableBodyProps,
headerGroups,
rows,
totalColumnsWidth,
prepareRow,
} = useTable(
{
@ -87,16 +81,7 @@ export function Table({ columns, data, virtual, headless }: Props) {
</div>}
<div {...getTableBodyProps()}>
{virtual ? (
<FixedSizeList
height={400}
itemCount={rows.length}
itemSize={35}
width={totalColumnsWidth+scrollBarSize}
>
{RenderRow}
</FixedSizeList>
) : rows.map((row, index) => RenderRow({index}))}
{rows.map((row, index) => RenderRow({index}))}
</div>
</div>
);