-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHoverActions.tsx
More file actions
38 lines (37 loc) · 1.29 KB
/
Copy pathHoverActions.tsx
File metadata and controls
38 lines (37 loc) · 1.29 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
import * as React from "react"
import { Override, Data } from "framer"
const hoverData = Data({ hoveredIndex: -1 })
export function TableHoverActions(): Override {
return {
showDefaultColumns: false,
columns: [
{ accessor: "symbol" },
{ accessor: "market" },
{ accessor: "price" },
{
accessor: "actions",
Cell: ({ row: { index } }) => (
<div style={{ width: 80 }}>
{index === hoverData.hoveredIndex && (
<div
style={{
width: "100%",
display: "flex",
justifyContent: "space-between",
cursor: "pointer",
}}
>
<span>🗑</span>
<span>✋</span>
<span>💾</span>
</div>
)}
</div>
),
},
],
rowProps: ({ index }) => ({
onMouseEnter: () => (hoverData.hoveredIndex = index),
}),
}
}