Skip to content

Commit add261b

Browse files
tjguptamergify[bot]
authored andcommitted
feat(icons): add IconFolderTree icon (#1696)
* feat(icons): add IconFolderTree icon * feat(icons): add IconFolderTree icon
1 parent 21af355 commit add261b

File tree

3 files changed

+62
-0
lines changed

3 files changed

+62
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// @flow
2+
import * as React from 'react';
3+
4+
import AccessibleSVG from '../accessible-svg';
5+
import { bdlGray50 } from '../../styles/variables';
6+
import type { Icon } from '../flowTypes';
7+
8+
const IconFolderTree = ({ className = '', color = bdlGray50, height = 16, title, width = 16 }: Icon) => (
9+
<AccessibleSVG
10+
className={`bdl-IconFolderTree ${className}`}
11+
height={height}
12+
title={title}
13+
viewBox="0 0 16 16"
14+
width={width}
15+
>
16+
<path
17+
className="fill-color"
18+
d="M4 1a2 2 0 0 1 .501 3.937L4.5 7h5.563a2 2 0 1 1 0 1.001L4.5 8v4.5h5.563a2 2 0 1 1 0 1.001L3.5 13.5V4.937A2 2 0 0 1 4 1z"
19+
fill={color}
20+
fillRule="evenodd"
21+
/>
22+
</AccessibleSVG>
23+
);
24+
25+
export default IconFolderTree;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```
2+
<IconFolderTree />
3+
```
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import React from 'react';
2+
3+
import IconFolderTree from '../IconFolderTree';
4+
5+
describe('icons/general/IconFolderTree', () => {
6+
test('should correctly render default icon', () => {
7+
const wrapper = shallow(<IconFolderTree />);
8+
9+
expect(wrapper.hasClass('bdl-IconFolderTree')).toEqual(true);
10+
});
11+
12+
test('should correctly render icon with specified color', () => {
13+
const color = '#ffffff';
14+
const wrapper = shallow(<IconFolderTree color={color} />);
15+
16+
expect(wrapper.find('path').prop('fill')).toEqual(color);
17+
});
18+
19+
test('should correctly render icon with specified width and height', () => {
20+
const width = 20;
21+
const height = 20;
22+
const wrapper = shallow(<IconFolderTree 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 = 'Folder tree';
30+
const wrapper = shallow(<IconFolderTree title={title} />);
31+
32+
expect(wrapper.find('AccessibleSVG').prop('title')).toEqual(title);
33+
});
34+
});

0 commit comments

Comments
 (0)