aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/ui/Settings.js
diff options
context:
space:
mode:
Diffstat (limited to 'vnext/src/ui/Settings.js')
-rw-r--r--vnext/src/ui/Settings.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/vnext/src/ui/Settings.js b/vnext/src/ui/Settings.js
index ccafffa3..3ae33567 100644
--- a/vnext/src/ui/Settings.js
+++ b/vnext/src/ui/Settings.js
@@ -6,11 +6,13 @@ import Button from './Button';
import Icon from './Icon';
import UploadButton from './UploadButton';
import Avatar from './Avatar';
+import { useVisitor } from './VisitorContext';
/**
- * @param {{ visitor: import('../api').SecureUser, onChange: function }} props
+ * @param {{ onChange: Function }} props
*/
-function ChangeAvatarForm({ visitor, onChange }) {
+function ChangeAvatarForm({ onChange }) {
+ const [visitor] = useVisitor();
const [avatar, setAvatar] = useState('');
const [preview, setPreview] = useState();
const avatarInput = useRef();
@@ -53,9 +55,11 @@ function ChangeAvatarForm({ visitor, onChange }) {
}
/**
- * @param {{ visitor: import('../api').SecureUser, onChange: function }} props
+ * @param {{ onChange: Function }} props
*/
-export default function Settings({ visitor, onChange }) {
+export default function Settings({ onChange }) {
+
+ const [visitor] = useVisitor();
let passwordChanged = (event) => {
console.log('password changed');
@@ -100,7 +104,7 @@ export default function Settings({ visitor, onChange }) {
<div className="msg-cont">
<fieldset>
<legend><Icon name="ei-user" size="m" />Changing your avatar</legend>
- <ChangeAvatarForm visitor={visitor} onChange={onChange} />
+ <ChangeAvatarForm onChange={onChange} />
</fieldset>
<fieldset>
<legend><Icon name="ei-unlock" size="m" />Changing your password</legend>