]> git.localhorst.tv Git - alttp.git/commitdiff
don't plaster everything with discriminators
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Wed, 16 Mar 2022 15:38:33 +0000 (16:38 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Wed, 16 Mar 2022 15:38:33 +0000 (16:38 +0100)
resources/js/components/users/Box.js
resources/sass/results.scss

index 139e6f65573081dda97849ead6a0681b5ae292b4..7bbc186eaacc54e4e934b8fdef82d2b71aa9b24d 100644 (file)
@@ -5,20 +5,23 @@ import { withTranslation } from 'react-i18next';
 import { getAvatarUrl } from '../../helpers/User';
 import i18n from '../../i18n';
 
-const Box = ({ user }) => user ?
+const Box = ({ discriminator, user }) => user ?
        <span className="user-box">
                <img alt="" src={getAvatarUrl(user)} />
                <span>{user.username}</span>
-               <span className="text-muted">
-                       {'#'}
-                       {user.discriminator}
-               </span>
+               {discriminator ?
+                       <span className="text-muted">
+                               {'#'}
+                               {user.discriminator}
+                       </span>
+               : null}
        </span>
 :
        <span>{i18n.t('general.anonymous')}</span>
 ;
 
 Box.propTypes = {
+       discriminator: PropTypes.bool,
        user: PropTypes.shape({
                discriminator: PropTypes.string,
                username: PropTypes.string,
index c5a7ce6e4f1ed254eb3347142f3d081e8dcbe68b..1bde5557f4371f0c491751aa444e0f286c074ce9 100644 (file)
@@ -8,6 +8,7 @@
                        justify-content: space-between;
                        margin-top: 1ex;
                        padding: 0.5em;
+                       min-width: 15ex;
                        border-radius: 1ex;
                        background: $dark;
                        color: $light;