Skip to content

Commit fb10f13

Browse files
committed
Add icons
1 parent a7dfc8d commit fb10f13

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

src/components/icons.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
export default function Icon(props) {
2+
let icon;
3+
4+
switch (props.name) {
5+
case 'chevron-up':
6+
icon = <ChevronUp />;
7+
break;
8+
case 'chevron-down':
9+
icon = <ChevronDown />;
10+
break;
11+
}
12+
13+
return (
14+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" className={"rjf-icon rjf-icon-" + props.name} viewBox="0 0 16 16">
15+
{icon}
16+
</svg>
17+
);
18+
}
19+
20+
function ChevronUp(props) {
21+
return (
22+
<path fillRule="evenodd" d="M7.646 4.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1-.708.708L8 5.707l-5.646 5.647a.5.5 0 0 1-.708-.708l6-6z"/>
23+
);
24+
}
25+
26+
function ChevronDown(props) {
27+
return (
28+
<path fillRule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"/>
29+
);
30+
}

src/components/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ import {FormInput, FormCheckInput, FormRadioInput, FormSelectInput, FormFileInpu
33
FormTextareaInput} from './form';
44
import {FormRow, FormGroup, FormRowControls} from './containers';
55
import Loader from './loaders';
6+
import Icon from './icons';
67

78
export {
89
Button,
910
FormInput, FormCheckInput, FormRadioInput, FormSelectInput, FormFileInput,
1011
FormTextareaInput,
1112
FormRow, FormGroup, FormRowControls,
1213
Loader,
14+
Icon,
1315
};

0 commit comments

Comments
 (0)