X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Fusers%2FBox.js;h=d7ee3af9944ac3c736678f11d40ec0ad1c91cbb8;hb=d32516335ea2534e15256c948e9c38d3de40794b;hp=7bbc186eaacc54e4e934b8fdef82d2b71aa9b24d;hpb=21cc6fddc58d14a635cafa0add99a39fdbca0e9a;p=alttp.git
diff --git a/resources/js/components/users/Box.js b/resources/js/components/users/Box.js
index 7bbc186..d7ee3af 100644
--- a/resources/js/components/users/Box.js
+++ b/resources/js/components/users/Box.js
@@ -1,12 +1,24 @@
import PropTypes from 'prop-types';
import React from 'react';
+import { Button } from 'react-bootstrap';
import { withTranslation } from 'react-i18next';
+import { useNavigate } from 'react-router-dom';
import { getAvatarUrl } from '../../helpers/User';
import i18n from '../../i18n';
-const Box = ({ discriminator, user }) => user ?
-
+const Box = ({ discriminator, user }) => {
+ const navigate = useNavigate();
+
+ if (!user) {
+ return {i18n.t('general.anonymous')};
+ }
+
+ return
: null}
-
-:
- {i18n.t('general.anonymous')}
-;
+ ;
+};
Box.propTypes = {
discriminator: PropTypes.bool,
user: PropTypes.shape({
discriminator: PropTypes.string,
+ id: PropTypes.string,
username: PropTypes.string,
}),
};