Skip to content

Commit ca4502d

Browse files
authored
Merge pull request #1459 from ghalestrilo/feature/mobile-ide
Add Editor component to the Mobile IDE View
2 parents b8ba3b9 + a99d2b8 commit ca4502d

File tree

4 files changed

+319
-17
lines changed

4 files changed

+319
-17
lines changed

Diff for: client/common/Icons.jsx

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3+
import styled from 'styled-components';
4+
import { remSize, prop } from '../theme';
35
import SortArrowUp from '../images/sort-arrow-up.svg';
46
import SortArrowDown from '../images/sort-arrow-down.svg';
57
import Github from '../images/github.svg';
68
import Google from '../images/google.svg';
79
import Plus from '../images/plus-icon.svg';
810
import Close from '../images/close.svg';
11+
import Exit from '../images/exit.svg';
912
import DropdownArrow from '../images/down-filled-triangle.svg';
1013

1114
// HOC that adds the right web accessibility props
@@ -15,16 +18,33 @@ import DropdownArrow from '../images/down-filled-triangle.svg';
1518
// Need to add size to these - like small icon, medium icon, large icon. etc.
1619
function withLabel(SvgComponent) {
1720
const Icon = (props) => {
21+
const StyledIcon = styled(SvgComponent)`
22+
&&& {
23+
color: ${prop('Icon.default')};
24+
& g, & path, & polygon {
25+
opacity: 1;
26+
fill: ${prop('Icon.default')};
27+
}
28+
&:hover {
29+
color: ${prop('Icon.hover')};
30+
& g, & path, & polygon {
31+
opacity: 1;
32+
fill: ${prop('Icon.hover')};
33+
}
34+
}
35+
}
36+
`;
37+
1838
const { 'aria-label': ariaLabel } = props;
1939
if (ariaLabel) {
20-
return (<SvgComponent
40+
return (<StyledIcon
2141
{...props}
2242
aria-label={ariaLabel}
2343
role="img"
2444
focusable="false"
2545
/>);
2646
}
27-
return (<SvgComponent
47+
return (<StyledIcon
2848
{...props}
2949
aria-hidden
3050
focusable="false"
@@ -48,4 +68,5 @@ export const GithubIcon = withLabel(Github);
4868
export const GoogleIcon = withLabel(Google);
4969
export const PlusIcon = withLabel(Plus);
5070
export const CloseIcon = withLabel(Close);
71+
export const ExitIcon = withLabel(Exit);
5172
export const DropdownArrowIcon = withLabel(DropdownArrow);

Diff for: client/common/icons.jsx

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3+
import styled from 'styled-components';
4+
import { remSize, prop } from '../theme';
35
import SortArrowUp from '../images/sort-arrow-up.svg';
46
import SortArrowDown from '../images/sort-arrow-down.svg';
57
import Github from '../images/github.svg';
68
import Google from '../images/google.svg';
79
import Plus from '../images/plus-icon.svg';
810
import Close from '../images/close.svg';
11+
import Exit from '../images/exit.svg';
912
import DropdownArrow from '../images/down-filled-triangle.svg';
1013

1114
// HOC that adds the right web accessibility props
@@ -15,16 +18,33 @@ import DropdownArrow from '../images/down-filled-triangle.svg';
1518
// Need to add size to these - like small icon, medium icon, large icon. etc.
1619
function withLabel(SvgComponent) {
1720
const Icon = (props) => {
21+
const StyledIcon = styled(SvgComponent)`
22+
&&& {
23+
color: ${prop('Icon.default')};
24+
& g, & path, & polygon {
25+
opacity: 1;
26+
fill: ${prop('Icon.default')};
27+
}
28+
&:hover {
29+
color: ${prop('Icon.hover')};
30+
& g, & path, & polygon {
31+
opacity: 1;
32+
fill: ${prop('Icon.hover')};
33+
}
34+
}
35+
}
36+
`;
37+
1838
const { 'aria-label': ariaLabel } = props;
1939
if (ariaLabel) {
20-
return (<SvgComponent
40+
return (<StyledIcon
2141
{...props}
2242
aria-label={ariaLabel}
2343
role="img"
2444
focusable="false"
2545
/>);
2646
}
27-
return (<SvgComponent
47+
return (<StyledIcon
2848
{...props}
2949
aria-hidden
3050
focusable="false"
@@ -48,4 +68,5 @@ export const GithubIcon = withLabel(Github);
4868
export const GoogleIcon = withLabel(Google);
4969
export const PlusIcon = withLabel(Plus);
5070
export const CloseIcon = withLabel(Close);
71+
export const ExitIcon = withLabel(Exit);
5172
export const DropdownArrowIcon = withLabel(DropdownArrow);

0 commit comments

Comments
 (0)