-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
Nav.tsx
115 lines (101 loc) · 3.19 KB
/
Nav.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import { Link } from '@tanstack/react-router';
import { css } from '@linaria/core';
import type { Direction } from '../src/types';
const navClassname = css`
display: flex;
flex-direction: column;
white-space: nowrap;
border-inline-start: 4px solid light-dark(hsl(210deg 50% 80%), hsl(210deg 50% 40%));
h1,
h2 {
margin: 8px;
}
a {
color: inherit;
font-size: 14px;
line-height: 22px;
text-decoration: none;
padding-block: 0;
padding-inline: 16px;
transition: 0.1s background-color;
&:hover {
background-color: light-dark(hsl(210deg 50% 90%), hsl(210deg 50% 30%));
}
&[aria-current='page'] {
font-weight: 500;
background-color: light-dark(hsl(210deg 50% 80%), hsl(210deg 50% 40%));
&:hover {
background-color: light-dark(hsl(210deg 50% 70%), hsl(210deg 50% 50%));
}
}
}
`;
const rtlCheckboxClassname = css`
padding-inline-start: 8px;
`;
interface Props {
direction: Direction;
onDirectionChange: (direction: Direction) => void;
}
export default function Nav({ direction, onDirectionChange }: Props) {
return (
<nav className={navClassname}>
<h1>react-data-grid</h1>
<h2>Demos</h2>
<Link to="/CommonFeatures">Common Features</Link>
<Link to="/AllFeatures">All Features</Link>
<Link to="/CellNavigation">Cell Navigation</Link>
<Link to="/ColumnSpanning">Column Spanning</Link>
<Link to="/ColumnGrouping">Column Grouping</Link>
<Link to="/ColumnsReordering">Columns Reordering</Link>
<Link to="/ContextMenu">Context Menu</Link>
<Link to="/CustomizableRenderers">Customizable Renderers</Link>
<Link to="/RowGrouping">Row Grouping</Link>
<Link to="/HeaderFilters">Header Filters</Link>
<Link to="/InfiniteScrolling">Infinite Scrolling</Link>
<Link to="/MasterDetail">Master Detail</Link>
<Link to="/MillionCells">A Million Cells</Link>
<Link to="/NoRows">No Rows</Link>
<Link to="/ResizableGrid">Resizable Grid</Link>
<Link to="/RowsReordering">Rows Reordering</Link>
<Link to="/ScrollToCell">Scroll To Cell</Link>
<Link to="/TreeView">Tree View</Link>
<Link to="/VariableRowHeight">Variable Row Height</Link>
<Link to="/Animation">Animation</Link>
<h2>Links</h2>
<a
href="https://github.com/adazzle/react-data-grid/blob/main/README.md"
target="_blank"
rel="noreferrer"
>
Documentation
</a>
<a
href="https://github.com/adazzle/react-data-grid/blob/main/CHANGELOG.md"
target="_blank"
rel="noreferrer"
>
Changelog
</a>
<a
href="https://github.com/adazzle/react-data-grid/discussions"
target="_blank"
rel="noreferrer"
>
Discussions
</a>
<a href="https://github.com/adazzle/react-data-grid/issues" target="_blank" rel="noreferrer">
Issues
</a>
<h2>Direction</h2>
<label className={rtlCheckboxClassname}>
<input
type="checkbox"
checked={direction === 'rtl'}
onChange={() => onDirectionChange(direction === 'rtl' ? 'ltr' : 'rtl')}
/>
Right to left
</label>
</nav>
);
}