Skip to content

Commit 160a962

Browse files
committed
Dropdown: Migrate DropdownWrapper to DropdownMenu and delete file due to none-use
1 parent 4b03c97 commit 160a962

File tree

2 files changed

+67
-111
lines changed

2 files changed

+67
-111
lines changed

client/components/Dropdown.jsx

Lines changed: 0 additions & 110 deletions
This file was deleted.

client/components/Dropdown/DropdownMenu.jsx

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,76 @@
11
import PropTypes from 'prop-types';
22
import React, { forwardRef, useCallback, useRef, useState } from 'react';
3+
import styled from 'styled-components';
4+
import { remSize, prop } from '../../theme';
35
import { useModalClose } from '../../common/useModalClose';
46
import DownArrowIcon from '../../images/down-filled-triangle.svg';
5-
import { DropdownWrapper } from '../Dropdown';
67

78
// TODO: enable arrow keys to navigate options from list
9+
const DropdownWrapper = styled.ul`
10+
background-color: ${prop('Modal.background')};
11+
border: 1px solid ${prop('Modal.border')};
12+
box-shadow: 0 0 18px 0 ${prop('shadowColor')};
13+
color: ${prop('primaryTextColor')};
14+
15+
position: absolute;
16+
right: ${(props) => (props.right ? 0 : 'initial')};
17+
left: ${(props) => (props.left ? 0 : 'initial')};
18+
19+
${(props) => props.align === 'right' && 'right: 0;'}
20+
${(props) => props.align === 'left' && 'left: 0;'}
21+
22+
23+
text-align: left;
24+
width: ${remSize(180)};
25+
display: flex;
26+
flex-direction: column;
27+
height: auto;
28+
z-index: 2;
29+
border-radius: ${remSize(6)};
30+
31+
& li:first-child {
32+
border-radius: ${remSize(5)} ${remSize(5)} 0 0;
33+
}
34+
& li:last-child {
35+
border-radius: 0 0 ${remSize(5)} ${remSize(5)};
36+
}
37+
38+
& li:hover {
39+
background-color: ${prop('Button.primary.hover.background')};
40+
color: ${prop('Button.primary.hover.foreground')};
41+
42+
* {
43+
color: ${prop('Button.primary.hover.foreground')};
44+
}
45+
}
46+
47+
li {
48+
height: ${remSize(36)};
49+
cursor: pointer;
50+
display: flex;
51+
align-items: center;
52+
53+
& button,
54+
& button span,
55+
& a {
56+
padding: ${remSize(8)} ${remSize(16)};
57+
font-size: ${remSize(12)};
58+
}
59+
60+
* {
61+
text-align: left;
62+
justify-content: left;
63+
64+
color: ${prop('primaryTextColor')};
65+
width: 100%;
66+
justify-content: flex-start;
67+
}
68+
69+
& button span {
70+
padding: 0px;
71+
}
72+
}
73+
`;
874

975
const DropdownMenu = forwardRef(
1076
(

0 commit comments

Comments
 (0)