@@ -36,9 +36,7 @@ const DropdownWrapper = styled.ul`
3636 background-color: ${ prop ( 'Button.hover.background' ) } ;
3737 color: ${ prop ( 'Button.hover.foreground' ) } ;
3838
39- & button, & a {
40- color: ${ prop ( 'Button.hover.foreground' ) } ;
41- }
39+ * { color: ${ prop ( 'Button.hover.foreground' ) } ; }
4240 }
4341
4442 li {
@@ -48,12 +46,21 @@ const DropdownWrapper = styled.ul`
4846 align-items: center;
4947
5048 & button,
49+ & button span,
5150 & a {
51+ padding: ${ remSize ( 8 ) } ${ remSize ( 16 ) } ;
52+ }
53+
54+ * {
55+ text-align: left;
56+ justify-content: left;
57+
5258 color: ${ prop ( 'primaryTextColor' ) } ;
5359 width: 100%;
54- text-align: left;
55- padding: ${ remSize ( 8 ) } ${ remSize ( 16 ) } ;
60+ justify-content: flex-start;
5661 }
62+
63+ & button span { padding: 0px }
5764 }
5865` ;
5966
@@ -63,24 +70,29 @@ const DropdownWrapper = styled.ul`
6370const Dropdown = ( { items, align } ) => (
6471 < DropdownWrapper align = { align } >
6572 { /* className="nav__items-left" */ }
66- { items && items . map ( ( { title, icon, href } ) => (
73+ { items && items . map ( ( {
74+ title, icon, href, action
75+ } ) => (
6776 < li key = { `nav-${ title && title . toLowerCase ( ) } ` } >
68- < Link to = { href } >
69- { /* {MaybeIcon(icon, `Navigate to ${title}`) } */ }
70- { title }
71- </ Link >
77+ { /* {MaybeIcon(icon, `Navigate to ${title}`) } */ }
78+ { href
79+ ? < IconButton to = { href } > { title } </ IconButton >
80+ : < IconButton onClick = { ( ) => action ( ) } > { title } </ IconButton > }
81+
7282 </ li >
7383 ) )
7484 }
7585 </ DropdownWrapper >
7686) ;
7787
88+
7889Dropdown . propTypes = {
7990 align : PropTypes . oneOf ( [ 'left' , 'right' ] ) ,
8091 items : PropTypes . arrayOf ( PropTypes . shape ( {
8192 action : PropTypes . func ,
8293 icon : PropTypes . func ,
83- href : PropTypes . string
94+ href : PropTypes . string ,
95+ title : PropTypes . string
8496 } ) ) ,
8597} ;
8698
0 commit comments