Skip to content

Commit 438fe1d

Browse files
committed
Merge branch 'beanie'
2 parents ff7b99c + b43be26 commit 438fe1d

File tree

6 files changed

+36
-6
lines changed

6 files changed

+36
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ The options can be passed into genConfig or as React props
6868
| `faceColor` | string | | | |
6969
| `earSize` | string | | small, big | |
7070
| `hairColor` | string | | | |
71-
| `hairStyle` | string | | normal, thick, mohawk, womanLong, womanShort | |
71+
| `hairStyle` | string | | normal, thick, mohawk, womanLong, womanShort, beanie | |
7272
| `hairColorRandom` | boolean | false | | thick,mohawk default only be black |
7373
| `eyeStyle` | string | | circle, oval, smile | |
7474
| `glassesStyle` | string | | none, round, square | Usually is none |

demo/Single.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@ export default class Single extends Component {
230230
onClick={this.updateConfig.bind(this, "hairStyle", "turban")}>
231231
Turban
232232
</p>
233+
<p
234+
className={classnames("opt", { active: config.hairStyle === "beanie" })}
235+
onClick={this.updateConfig.bind(this, "hairStyle", "beanie")}>
236+
Beanie
237+
</p>
233238
</div>
234239

235240
{/* Eyes */}

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' | 'turban',
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/beanie.js

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/hair/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Mohawk from "./mohawk";
66
import WomanLong from "./womanLong";
77
import WomanShort from "./womanShort";
88
import Turban from './turban';
9+
import Beanie from "./beanie";
910

1011
export default function (props) {
1112
const { style, color, colorRandom } = props;
@@ -14,8 +15,9 @@ export default function (props) {
1415
case "mohawk": return <Mohawk color={color} colorRandom={colorRandom} />;
1516
case "womanLong": return <WomanLong color={color} />;
1617
case "womanShort": return <WomanShort color={color} />;
17-
case "turban" : return <Turban color={color}/>
18-
case "normal":
18+
case 'beanie': return <Beanie color={color} />;
19+
case "turban" : return <Turban color={color}/>;
20+
case "normal":
1921
default:
2022
return <Normal color={color} />;
2123
}

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const sex = ["man", "woman"];
1515
const faceColor = ["#F9C9B6", "#AC6651"];
1616
const earSize = ["small", "big"];
1717
const hairColor = ["#000", "#fff", "#77311D", "#FC909F", "#D2EFF3", "#506AF4", "#F48150"];
18-
const hairStyleMan = ["normal", "thick", "mohawk","turban"];
18+
const hairStyleMan = ["normal", "thick", "mohawk","beanie","turban"];
1919
const hairStyleWoman = ["normal", "womanLong", "womanShort"];
2020
const eyeBrowWoman = ["up", "upWoman"];
2121
const eyeStyle = ["circle", "oval", "smile"];
@@ -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","turban"]),
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)