Skip to content

Commit 26e0a36

Browse files
authored
Merge branch 'main' into beanie
2 parents 4984d84 + b1a560f commit 26e0a36

File tree

5 files changed

+31
-2
lines changed

5 files changed

+31
-2
lines changed

demo/Single.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,11 @@ export default class Single extends Component {
225225
onClick={this.updateConfig.bind(this, "hairStyle", "womanShort")}>
226226
Woman Short
227227
</p>
228+
<p
229+
className={classnames("opt", { active: config.hairStyle === "turban" })}
230+
onClick={this.updateConfig.bind(this, "hairStyle", "turban")}>
231+
Turban
232+
</p>
228233
<p
229234
className={classnames("opt", { active: config.hairStyle === "beanie" })}
230235
onClick={this.updateConfig.bind(this, "hairStyle", "beanie")}>

react-nice-avatar.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export interface AvatarConfig {
99
faceColor?: string,
1010
earSize?: 'small' | 'big',
1111
hairColor?: string,
12-
hairStyle?: 'normal' | 'thick' | 'mohawk' | 'womanLong' | 'womanShort' | 'beanie',
12+
hairStyle?: 'normal' | 'thick' | 'mohawk' | 'womanLong' | 'womanShort' | 'beanie' |'turban',
1313
eyeStyle?: 'circle' | 'oval' | 'smile',
1414
glassesStyle?: 'round' | 'square' | 'none',
1515
noseStyle?: 'short' | 'long' | 'round',

src/hair/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Thick from "./thick";
55
import Mohawk from "./mohawk";
66
import WomanLong from "./womanLong";
77
import WomanShort from "./womanShort";
8+
import Turban from './turban';
89
import Beanie from "./beanie";
910

1011
export default function (props) {
@@ -15,6 +16,7 @@ export default function (props) {
1516
case "womanLong": return <WomanLong color={color} />;
1617
case "womanShort": return <WomanShort color={color} />;
1718
case 'beanie': return <Beanie color={color} />;
19+
case "turban" : return <Turban color={color}/>;
1820
case "normal":
1921
default:
2022
return <Normal color={color} />;

src/hair/turban.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from "react";
2+
3+
export default function (props) {
4+
const { color } = props;
5+
return (
6+
<svg
7+
style={{
8+
position: "absolute",
9+
bottom: "34%",
10+
left: "13.5%"
11+
}}
12+
width="240"
13+
height="212"
14+
viewBox="0 0 240 212"
15+
fill="none"
16+
xmlns="http://www.w3.org/2000/svg">
17+
<path d="M222.726 112.791C222.726 46.702 186.268 2.00007 141.859 2C84.9656 2 27 23.3414 27 124.255C27 149.223 37.6589 167.827 52.5644 181.54C51.0704 179.671 49.8666 177.996 49.0668 176.619C46.176 149.638 78.2326 128.929 109.601 108.665C126.254 97.907 142.712 87.2746 153.646 75.8956C163.24 81.3324 191.44 104.109 196.813 113.32C199.695 118.26 204.322 135.189 207.484 154.95C217.822 142.532 222.726 130.107 222.726 112.791Z"
18+
fill={color} stroke="rgba(0,0,0,0.1)" strokeWidth="4"/>
19+
<path d="M154.264 75.2457C167.438 63.3013 187.146 36.0399 185.881 18.334" stroke="rgba(0,0,0,0.1)" strokeWidth="4"/>
20+
</svg>
21+
);
22+
}

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default class ReactNiceAvatar extends Component {
4646
faceColor: PropTypes.string,
4747
earSize: PropTypes.oneOf(["small", "big"]),
4848
hairColor: PropTypes.string,
49-
hairStyle: PropTypes.oneOf(["normal", "thick", "mohawk", "womanLong", "womanShort", "beanie"]),
49+
hairStyle: PropTypes.oneOf(["normal", "thick", "mohawk", "womanLong", "womanShort","beanie","turban"]),
5050
hairColorRandom: PropTypes.bool,
5151
eyeStyle: PropTypes.oneOf(["circle", "oval", "smile"]),
5252
glassesStyle: PropTypes.oneOf(["round", "square", "none"]),

0 commit comments

Comments
 (0)