aboutsummaryrefslogtreecommitdiff
path: root/src/client/react/components/presentational/IconFromUserType.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/react/components/presentational/IconFromUserType.js')
-rw-r--r--src/client/react/components/presentational/IconFromUserType.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/client/react/components/presentational/IconFromUserType.js b/src/client/react/components/presentational/IconFromUserType.js
index 3a7350c..0cb5154 100644
--- a/src/client/react/components/presentational/IconFromUserType.js
+++ b/src/client/react/components/presentational/IconFromUserType.js
@@ -37,7 +37,8 @@ class IconFromUserType extends React.Component {
};
render() {
- switch (this.props.userType) {
+ const { userType, defaultIcon } = this.props;
+ switch (userType) {
case 'c':
return <ClassIcon />;
case 't':
@@ -47,8 +48,8 @@ class IconFromUserType extends React.Component {
case 'r':
return <RoomIcon />;
default:
- if (this.props.defaultIcon) {
- return this.props.defaultIcon;
+ if (defaultIcon) {
+ return defaultIcon;
}
throw new Error('`userType` was invalid or not given, but `defaultIcon` is not defined.');