forked from processing/p5.js-web-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTableDropdown.jsx
46 lines (41 loc) · 1.06 KB
/
TableDropdown.jsx
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 React from 'react';
import styled from 'styled-components';
import { prop, remSize } from '../../theme';
import DropdownMenu from './DropdownMenu';
import DownFilledTriangleIcon from '../../images/down-filled-triangle.svg';
import MoreIconSvg from '../../images/more.svg';
import useIsMobile from '../../modules/IDE/hooks/useIsMobile';
const DotsHorizontal = styled(MoreIconSvg)`
transform: rotate(90deg);
`;
const TableDropdownIcon = () => {
const isMobile = useIsMobile();
return isMobile ? (
<DotsHorizontal focusable="false" aria-hidden="true" />
) : (
<DownFilledTriangleIcon focusable="false" aria-hidden="true" />
);
};
const TableDropdown = styled(DropdownMenu).attrs({
align: 'right',
anchor: <TableDropdownIcon />
})`
& > button {
width: ${remSize(25)};
height: ${remSize(25)};
padding: 0;
& svg {
max-width: 100%;
max-height: 100%;
}
& polygon,
& path {
fill: ${prop('inactiveTextColor')};
}
}
& ul {
top: 63%;
right: calc(100% - 26px);
}
`;
export default TableDropdown;