diff --git a/samples/react-avatar/src/webparts/avatarGenerator/components/AvatarGenerator.tsx b/samples/react-avatar/src/webparts/avatarGenerator/components/AvatarGenerator.tsx index 95e2c0bd0..28830a17f 100644 --- a/samples/react-avatar/src/webparts/avatarGenerator/components/AvatarGenerator.tsx +++ b/samples/react-avatar/src/webparts/avatarGenerator/components/AvatarGenerator.tsx @@ -1,3 +1,5 @@ +/* global _topvar, var2 */ + import * as PropTypes from 'prop-types'; import * as React from 'react'; import styles from './AvatarGenerator.module.scss'; @@ -18,6 +20,8 @@ import DialogContent from '@material-ui/core/DialogContent'; import DialogContentText from '@material-ui/core/DialogContentText'; import DialogTitle from '@material-ui/core/DialogTitle'; + + const options: IChoiceGroupOption[] = [ { key: AvatarStyle.Circle, text: 'Circle' }, { key: AvatarStyle.Transparent, text: 'Transparent' } @@ -201,16 +205,20 @@ export default class AvatarGenerator extends React.Component { return (
{ + var selectedData = this.optionContext["_data"]; selectedData[`${option.key}`] = type; - this.optionContext.setData(selectedData as any); - }} + this.optionContext.setData(selectedData as any); + let _topvar = "LongHairFro"; + }} >
); - })} + topType={type} />); + }) } + ; + break; case "accessoriesType": return {optionState.options @@ -227,7 +235,28 @@ export default class AvatarGenerator extends React.Component); })} ; - case "hairColor": + break; + case "hairColor": + return + {optionState.options + .map(type => { + return (
{ + var selectedData = this.optionContext["_data"]; + selectedData[`${option.key}`] = type; + this.optionContext.setData(selectedData as any); + + }} + > +
); + })} +
; + break; + case "hatColor": return {optionState.options .map(type => { @@ -241,9 +270,8 @@ export default class AvatarGenerator extends React.Component - ); + topType="WinterHat1" + hatColor={type} />); })} ; break; @@ -263,6 +291,24 @@ export default class AvatarGenerator extends React.Component); })} ; + break; + case "facialHairColor": + return + {optionState.options + .map(type => { + return (
{ + var selectedData = this.optionContext["_data"]; + selectedData[`${option.key}`] = type; + this.optionContext.setData(selectedData as any); + }} + >
); + })} +
; break; case "clotheType": return @@ -292,8 +338,9 @@ export default class AvatarGenerator extends React.Component); })} ; @@ -310,7 +357,8 @@ export default class AvatarGenerator extends React.Component); })} ;