Skip to content

Commit fdc9803

Browse files
vweeboxbooc0mtaco
authored andcommitted
feat(app-recommendations): add box square icon and double arrows icons (#1092)
1 parent 2d08be1 commit fdc9803

File tree

7 files changed

+147
-0
lines changed

7 files changed

+147
-0
lines changed

src/icons/general/IconBoxSquare.js

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// @flow
2+
import * as React from 'react';
3+
4+
import AccessibleSVG from '../accessible-svg';
5+
6+
type Props = {
7+
className?: string,
8+
height?: number,
9+
title?: string | React.Element<any>,
10+
width?: number,
11+
};
12+
13+
const IconBoxSquare = ({ className = '', height = 72, title, width = 72 }: Props) => (
14+
<AccessibleSVG
15+
className={`box-square-icon ${className}`}
16+
height={height}
17+
title={title}
18+
viewBox="0 0 72 72"
19+
width={width}
20+
>
21+
<rect width="72" height="72" rx="8" ry="8" fill="#0061d5" />
22+
<path
23+
d="M37.39 28.57A10.26 10.26 0 0 0 28.33 34a10.31 10.31 0 0 0-15.23-3.39V22A2.05 2.05 0 0 0 9 22v17a10.27 10.27 0 0 0 19.33 4.62 10.25 10.25 0 1 0 9.06-15zM19.26 44.91a6.13 6.13 0 1 1 6.15-6.13 6.14 6.14 0 0 1-6.15 6.13zm18.13 0a6.13 6.13 0 1 1 6.15-6.13 6.14 6.14 0 0 1-6.15 6.13z"
24+
fill="#fff"
25+
/>
26+
<path
27+
d="M58 38.77l5.58-6.83a1.93 1.93 0 0 0-.47-2.82 2.37 2.37 0 0 0-3.1.37l-4.81 5.86-4.8-5.86a2.35 2.35 0 0 0-3.09-.37 1.92 1.92 0 0 0-.47 2.82l5.57 6.83-5.57 6.81a1.93 1.93 0 0 0 .47 2.83A2.36 2.36 0 0 0 50.4 48l4.8-5.85L60 48a2.37 2.37 0 0 0 3.1.38 1.93 1.93 0 0 0 .47-2.83z"
28+
fill="#fff"
29+
/>
30+
</AccessibleSVG>
31+
);
32+
33+
export default IconBoxSquare;

src/icons/general/IconBoxSquare.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```
2+
<IconBoxSquare />
3+
```

src/icons/general/IconDoubleArrows.js

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// @flow
2+
import * as React from 'react';
3+
import AccessibleSVG from '../accessible-svg';
4+
5+
type Props = {
6+
className?: string,
7+
color?: string,
8+
height?: number,
9+
/** A text-only string describing the icon if it's not purely decorative for accessibility */
10+
title?: string | React.Element<any>,
11+
width?: number,
12+
};
13+
14+
const IconDoubleArrows = ({ className = '', color = '#bfbfbf', height = 32, title, width = 32 }: Props) => (
15+
<AccessibleSVG
16+
className={`icon-double-arrows ${className}`}
17+
height={height}
18+
title={title}
19+
viewBox="0 0 32 32"
20+
width={width}
21+
>
22+
<path
23+
d="M3.8 6l3.5-3.44a1 1 0 0 0 0-1.36 1 1 0 0 0-1.39 0L.72 6.29a1 1 0 0 0 0 1.41l5.19 5.1a1 1 0 0 0 1.39 0 .94.94 0 0 0 0-1.35L3.8 8H23a1 1 0 0 0 0-2zM28.2 24l-3.5-3.44a1 1 0 0 1 0-1.36 1 1 0 0 1 1.39 0l5.19 5.1a1 1 0 0 1 0 1.41l-5.19 5.1a1 1 0 0 1-1.39 0 .94.94 0 0 1 0-1.35L28.2 26H9a1 1 0 0 1 0-2z"
24+
fill={color}
25+
/>
26+
</AccessibleSVG>
27+
);
28+
29+
export default IconDoubleArrows;

src/icons/general/IconDoubleArrows.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```
2+
<IconDoubleArrows />
3+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import React from 'react';
2+
3+
import IconBoxSquare from '../IconBoxSquare';
4+
5+
describe('icons/general/IconBoxSquare', () => {
6+
test('should correctly render default icon', () => {
7+
const wrapper = shallow(<IconBoxSquare />);
8+
9+
expect(wrapper.is('AccessibleSVG')).toBe(true);
10+
expect(wrapper.prop('height')).toEqual(72);
11+
expect(wrapper.prop('height')).toEqual(72);
12+
expect(wrapper.hasClass('box-square-icon')).toEqual(true);
13+
});
14+
15+
test('should correctly render icon with specified width and height', () => {
16+
const width = 50;
17+
const height = 50;
18+
const wrapper = shallow(<IconBoxSquare height={height} width={width} />);
19+
20+
expect(wrapper.find('AccessibleSVG').prop('width')).toEqual(width);
21+
expect(wrapper.find('AccessibleSVG').prop('height')).toEqual(height);
22+
});
23+
24+
test('should correctly render icon with title', () => {
25+
const title = 'hellojello';
26+
const wrapper = shallow(<IconBoxSquare title={title} />);
27+
28+
expect(wrapper.find('AccessibleSVG').prop('title')).toEqual(title);
29+
});
30+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import React from 'react';
2+
3+
import IconDoubleArrows from '../IconDoubleArrows';
4+
5+
describe('icons/general/IconDoubleArrows', () => {
6+
test('should correctly render default icon', () => {
7+
const wrapper = shallow(<IconDoubleArrows />);
8+
9+
expect(wrapper.hasClass('icon-double-arrows')).toEqual(true);
10+
});
11+
12+
test('should correctly render icon with specified color', () => {
13+
const color = '#bfbfbf';
14+
const wrapper = shallow(<IconDoubleArrows color={color} />);
15+
16+
expect(wrapper).toMatchSnapshot();
17+
});
18+
19+
test('should correctly render icon with specified width and height', () => {
20+
const width = 50;
21+
const height = 50;
22+
const wrapper = shallow(<IconDoubleArrows height={height} width={width} />);
23+
24+
expect(wrapper.find('AccessibleSVG').prop('width')).toEqual(width);
25+
expect(wrapper.find('AccessibleSVG').prop('height')).toEqual(height);
26+
});
27+
28+
test('should correctly render icon with title', () => {
29+
const title = 'whazzah';
30+
const wrapper = shallow(<IconDoubleArrows title={title} />);
31+
32+
expect(wrapper.find('AccessibleSVG').prop('title')).toEqual(title);
33+
});
34+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`icons/general/IconDoubleArrows should correctly render icon with specified color 1`] = `
4+
<AccessibleSVG
5+
className="icon-double-arrows "
6+
height={32}
7+
viewBox="0 0 32 32"
8+
width={32}
9+
>
10+
<path
11+
d="M3.8 6l3.5-3.44a1 1 0 0 0 0-1.36 1 1 0 0 0-1.39 0L.72 6.29a1 1 0 0 0 0 1.41l5.19 5.1a1 1 0 0 0 1.39 0 .94.94 0 0 0 0-1.35L3.8 8H23a1 1 0 0 0 0-2zM28.2 24l-3.5-3.44a1 1 0 0 1 0-1.36 1 1 0 0 1 1.39 0l5.19 5.1a1 1 0 0 1 0 1.41l-5.19 5.1a1 1 0 0 1-1.39 0 .94.94 0 0 1 0-1.35L28.2 26H9a1 1 0 0 1 0-2z"
12+
fill="#bfbfbf"
13+
/>
14+
</AccessibleSVG>
15+
`;

0 commit comments

Comments
 (0)