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:
parent
d4c0955320
commit
32f612f673
@ -1,5 +1,5 @@
|
|||||||
.icon {
|
.icon {
|
||||||
@apply h-5 w-5 cursor-pointer;
|
@apply h-5 w-5 mr-3 cursor-pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon:hover {
|
.icon:hover {
|
||||||
|
|||||||
@ -12,5 +12,5 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
margin-bottom: 6px!important;
|
margin-bottom: 0!important;
|
||||||
}
|
}
|
||||||
@ -116,9 +116,8 @@ export function InstalledExtensions({ extensions, uninstall }: Props) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<section>
|
<section>
|
||||||
<h2 className={styles.title}>Installed</h2>
|
|
||||||
<List
|
<List
|
||||||
title="Manage your extensions in here."
|
title={<h2 className={styles.title}>Installed</h2>}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
data={data}
|
data={data}
|
||||||
items={extensions}
|
items={extensions}
|
||||||
|
|||||||
@ -9,7 +9,7 @@ export type SearchFilter = (item: object) => string | number;
|
|||||||
interface Props extends UseTableOptions<any> {
|
interface Props extends UseTableOptions<any> {
|
||||||
items: object[];
|
items: object[];
|
||||||
filters: SearchFilter[];
|
filters: SearchFilter[];
|
||||||
title?: string;
|
title?: React.ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function List({ columns, data, title, items, filters, }: Props) {
|
export function List({ columns, data, title, items, filters, }: Props) {
|
||||||
|
|||||||
@ -12,11 +12,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.thead .tr {
|
.thead .tr {
|
||||||
margin: 0;
|
margin: 0 var(--margin);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tr {
|
.tr {
|
||||||
margin: var(--margin) 0;
|
margin: calc(var(--margin) * 1.6) var(--margin);
|
||||||
}
|
}
|
||||||
|
|
||||||
.th {
|
.th {
|
||||||
@ -30,7 +30,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.disabledArrow {
|
.disabledArrow {
|
||||||
color: #909ba666;
|
opacity: 0.3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.td {
|
.td {
|
||||||
|
|||||||
@ -2,16 +2,14 @@ import styles from "./react-table.module.css";
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { useCallback, useMemo } from "react";
|
import { useCallback, useMemo } from "react";
|
||||||
import { useFlexLayout, useSortBy, useTable, UseTableOptions } from "react-table";
|
import { useFlexLayout, useSortBy, useTable, UseTableOptions } from "react-table";
|
||||||
import { FixedSizeList } from "react-window";
|
|
||||||
import { Icon } from "../icon";
|
import { Icon } from "../icon";
|
||||||
import { cssNames } from "../../utils";
|
import { cssNames } from "../../utils";
|
||||||
|
|
||||||
interface Props extends UseTableOptions<any> {
|
interface Props extends UseTableOptions<any> {
|
||||||
virtual?: boolean;
|
|
||||||
headless?: boolean;
|
headless?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Table({ columns, data, virtual, headless }: Props) {
|
export function Table({ columns, data, headless }: Props) {
|
||||||
const defaultColumn = useMemo(
|
const defaultColumn = useMemo(
|
||||||
() => ({
|
() => ({
|
||||||
minWidth: 20,
|
minWidth: 20,
|
||||||
@ -20,15 +18,11 @@ export function Table({ columns, data, virtual, headless }: Props) {
|
|||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
|
|
||||||
// const scrollBarSize = React.useMemo(() => scrollbarWidth(), [])
|
|
||||||
const scrollBarSize = 10;
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
getTableProps,
|
getTableProps,
|
||||||
getTableBodyProps,
|
getTableBodyProps,
|
||||||
headerGroups,
|
headerGroups,
|
||||||
rows,
|
rows,
|
||||||
totalColumnsWidth,
|
|
||||||
prepareRow,
|
prepareRow,
|
||||||
} = useTable(
|
} = useTable(
|
||||||
{
|
{
|
||||||
@ -87,16 +81,7 @@ export function Table({ columns, data, virtual, headless }: Props) {
|
|||||||
</div>}
|
</div>}
|
||||||
|
|
||||||
<div {...getTableBodyProps()}>
|
<div {...getTableBodyProps()}>
|
||||||
{virtual ? (
|
{rows.map((row, index) => RenderRow({index}))}
|
||||||
<FixedSizeList
|
|
||||||
height={400}
|
|
||||||
itemCount={rows.length}
|
|
||||||
itemSize={35}
|
|
||||||
width={totalColumnsWidth+scrollBarSize}
|
|
||||||
>
|
|
||||||
{RenderRow}
|
|
||||||
</FixedSizeList>
|
|
||||||
) : rows.map((row, index) => RenderRow({index}))}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user