X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=resources%2Fjs%2Fcomponents%2Fusers%2FBox.js;h=bc4673ee9e12d818c209ced29906346bd3ff8f22;hb=72d6c25d3b1a6d79843d5673ba78804dd442ae39;hp=139e6f65573081dda97849ead6a0681b5ae292b4;hpb=edd0e97bfdc544114f30bf4c13a929631c44a555;p=alttp.git
diff --git a/resources/js/components/users/Box.js b/resources/js/components/users/Box.js
index 139e6f6..bc4673e 100644
--- a/resources/js/components/users/Box.js
+++ b/resources/js/components/users/Box.js
@@ -1,26 +1,41 @@
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 = ({ user }) => user ?
-
+const Box = ({ discriminator, user }) => {
+ const navigate = useNavigate();
+
+ if (!user) {
+ return {i18n.t('general.anonymous')};
+ }
+
+ return
-:
- {i18n.t('general.anonymous')}
-;
+ {discriminator || !user.nickname ? user.username : user.nickname}
+ {discriminator ?
+
+ {'#'}
+ {user.discriminator}
+
+ : null}
+ ;
+};
Box.propTypes = {
+ discriminator: PropTypes.bool,
user: PropTypes.shape({
discriminator: PropTypes.string,
+ id: PropTypes.string,
+ nickname: PropTypes.string,
username: PropTypes.string,
}),
};