Skip to content

Commit 7efc078

Browse files
authored
Merge branch 'develop' into feature-2/interactive-console
2 parents d504864 + 093c8ff commit 7efc078

File tree

96 files changed

+2511
-873
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+2511
-873
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ S3_BUCKET_URL_BASE=<alt-for-s3-url>
2626
SESSION_SECRET=whatever_you_want_this_to_be_it_only_matters_for_production
2727
UI_ACCESS_TOKEN_ENABLED=false
2828
UPLOAD_LIMIT=250000000
29+
MOBILE_ENABLED=true

client/common/icons.jsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,16 @@ import Exit from '../images/exit.svg';
1212
import DropdownArrow from '../images/down-filled-triangle.svg';
1313
import Preferences from '../images/preferences.svg';
1414
import Play from '../images/triangle-arrow-right.svg';
15+
import More from '../images/more.svg';
1516
import Code from '../images/code.svg';
1617
import Terminal from '../images/terminal.svg';
1718

19+
import Folder from '../images/folder-padded.svg';
20+
21+
import CircleTerminal from '../images/circle-terminal.svg';
22+
import CircleFolder from '../images/circle-folder.svg';
23+
import CircleInfo from '../images/circle-info.svg';
24+
1825

1926
// HOC that adds the right web accessibility props
2027
// https://www.scottohara.me/blog/2019/05/22/contextual-images-svgs-and-a11y.html
@@ -77,4 +84,12 @@ export const ExitIcon = withLabel(Exit);
7784
export const DropdownArrowIcon = withLabel(DropdownArrow);
7885
export const PreferencesIcon = withLabel(Preferences);
7986
export const PlayIcon = withLabel(Play);
87+
export const MoreIcon = withLabel(More);
8088
export const TerminalIcon = withLabel(Terminal);
89+
export const CodeIcon = withLabel(Code);
90+
91+
export const FolderIcon = withLabel(Folder);
92+
93+
export const CircleTerminalIcon = withLabel(CircleTerminal);
94+
export const CircleFolderIcon = withLabel(CircleFolder);
95+
export const CircleInfoIcon = withLabel(CircleInfo);

client/components/Dropdown.jsx

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
3+
import { Link } from 'react-router';
4+
import styled from 'styled-components';
5+
import { remSize, prop, common } from '../theme';
6+
import IconButton from './mobile/IconButton';
7+
import Button from '../common/Button';
8+
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 { border-radius: ${remSize(5)} ${remSize(5)} 0 0; }
32+
& li:last-child { border-radius: 0 0 ${remSize(5)} ${remSize(5)}; }
33+
34+
& li:hover {
35+
36+
background-color: ${prop('Button.hover.background')};
37+
color: ${prop('Button.hover.foreground')};
38+
39+
& button, & a {
40+
color: ${prop('Button.hover.foreground')};
41+
}
42+
}
43+
44+
li {
45+
height: ${remSize(36)};
46+
cursor: pointer;
47+
display: flex;
48+
align-items: center;
49+
50+
& button,
51+
& a {
52+
color: ${prop('primaryTextColor')};
53+
width: 100%;
54+
text-align: left;
55+
padding: ${remSize(8)} ${remSize(16)};
56+
}
57+
}
58+
`;
59+
60+
// TODO: Add Icon to the left of the items in the menu
61+
// const MaybeIcon = (Element, label) => Element && <Element aria-label={label} />;
62+
63+
const Dropdown = ({ items, align }) => (
64+
<DropdownWrapper align={align} >
65+
{/* className="nav__items-left" */}
66+
{items && items.map(({ title, icon, href }) => (
67+
<li key={`nav-${title && title.toLowerCase()}`}>
68+
<Link to={href}>
69+
{/* {MaybeIcon(icon, `Navigate to ${title}`)} */}
70+
{title}
71+
</Link>
72+
</li>
73+
))
74+
}
75+
</DropdownWrapper>
76+
);
77+
78+
Dropdown.propTypes = {
79+
align: PropTypes.oneOf(['left', 'right']),
80+
items: PropTypes.arrayOf(PropTypes.shape({
81+
action: PropTypes.func,
82+
icon: PropTypes.func,
83+
href: PropTypes.string
84+
})),
85+
};
86+
87+
Dropdown.defaultProps = {
88+
items: [],
89+
align: null
90+
};
91+
92+
export default Dropdown;

0 commit comments

Comments
 (0)