-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExpandableRow.tsx
More file actions
46 lines (45 loc) · 1.25 KB
/
ExpandableRow.tsx
File metadata and controls
46 lines (45 loc) · 1.25 KB
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
import * as React from "react";
import { Override } from "framer";
import { FlightRow, Caret, FlightDetail } from "./canvas";
export function TableGoogleFlights(): Override {
return {
showDefaultColumns: false,
columns: [
{
id: "info",
Cell: ({ row: { original } }) => (
<FlightRow
{...original}
times={`${original.startTime} - ${original.endTime}`}
airports={`${original.departure} - ${original.arrival}`}
stops={`${original.stops} stops`}
price={"$" + original.price}
logo={`https://www.gstatic.com/flights/airline_logos/70px/${
original.airline === "Alaska" ? "AS" : "AC"
}.png`}
position="relative"
/>
),
},
{
id: "expander",
Cell: ({ row }) => (
<span {...row.getExpandedToggleProps()}>
<Caret
position="relative"
animate={{ rotate: row.isExpanded ? -180 : 0 }}
/>
</span>
),
},
],
subRow: (
<FlightDetail
position="relative"
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
/>
),
rowProps: { positionTransition: { duration: 0.2 } },
};
}