This repository has been archived by the owner on Jan 10, 2024. It is now read-only.
forked from adazzle/react-data-grid
-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
root.tsx
155 lines (140 loc) · 3.84 KB
/
root.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
import { StrictMode } from 'react';
import { render } from 'react-dom';
import { css } from '@linaria/core';
import { HashRouter as Router, Switch, Redirect, Route } from 'react-router-dom';
import Nav from './Nav';
import CommonFeatures from './demos/CommonFeatures';
import AllFeatures from './demos/AllFeatures';
import CellNavigation from './demos/CellNavigation';
import ColumnSpanning from './demos/ColumnSpanning';
import ColumnsReordering from './demos/ColumnsReordering';
import ContextMenuDemo from './demos/ContextMenu';
import Grouping from './demos/Grouping';
import HeaderFilters from './demos/HeaderFilters';
import InfiniteScrolling from './demos/InfiniteScrolling';
import MasterDetail from './demos/MasterDetail';
import MillionCells from './demos/MillionCells';
import NoRows from './demos/NoRows';
import ResizableGrid from './demos/Resizable';
import RowsReordering from './demos/RowsReordering';
import ScrollToRow from './demos/ScrollToRow';
import TreeView from './demos/TreeView';
import VariableRowHeight from './demos/VariableRowHeight';
css`
@at-root {
:root,
body {
padding: 0;
margin: 0;
font-family: sans-serif;
}
:root {
color-scheme: light dark;
@media (prefers-color-scheme: light) {
background-color: #fff;
color: #111;
}
@media (prefers-color-scheme: dark) {
background-color: hsl(0deg 0% 10%);
color: #fff;
}
}
#root {
display: grid;
grid-template-columns: auto 1fr;
}
.rdg.fill-grid {
height: 100%;
}
.rdg.small-grid {
height: 300px;
}
.rdg.big-grid {
height: 600px;
}
.rdg-cell .Select {
max-height: 30px;
font-size: 12px;
font-weight: normal;
}
}
`;
const mainClassname = css`
display: flex;
flex-direction: column;
box-sizing: border-box;
height: 100vh;
padding: 8px;
`;
function Root() {
return (
<Router>
<Nav />
<main className={mainClassname}>
<Switch>
<Redirect exact from="/" to="/common-features" />
<Route exact path="/common-features">
<CommonFeatures />
</Route>
<Route exact path="/all-features">
<AllFeatures />
</Route>
<Route exact path="/cell-navigation">
<CellNavigation />
</Route>
<Route exact path="/column-spanning">
<ColumnSpanning />
</Route>
<Route exact path="/columns-reordering">
<ColumnsReordering />
</Route>
<Route exact path="/context-menu">
<ContextMenuDemo />
</Route>
<Route exact path="/grouping">
<Grouping />
</Route>
<Route exact path="/header-filters">
<HeaderFilters />
</Route>
<Route exact path="/infinite-scrolling">
<InfiniteScrolling />
</Route>
<Route exact path="/master-detail">
<MasterDetail />
</Route>
<Route exact path="/million-cells">
<MillionCells />
</Route>
<Route exact path="/no-rows">
<NoRows />
</Route>
<Route exact path="/resizable-grid">
<ResizableGrid />
</Route>
<Route exact path="/rows-reordering">
<RowsReordering />
</Route>
<Route exact path="/scroll-to-row">
<ScrollToRow />
</Route>
<Route exact path="/tree-view">
<TreeView />
</Route>
<Route exact path="/variable-row-height">
<VariableRowHeight />
</Route>
<Route>
<>Nothing to see here</>
</Route>
</Switch>
</main>
</Router>
);
}
render(
<StrictMode>
<Root />
</StrictMode>,
document.getElementById('root')
);