],
[
'username' => $user->username,
+ 'discord_nickname' => isset($user->global_name) ? $user->global_name : NULL,
'discriminator' => $user->discriminator,
'email' => isset($user->email) ? $user->email : NULL,
'avatar' => $user->avatar ?: NULL,
protected $fillable = [
'id',
'username',
+ 'discord_nickname',
'discriminator',
'email',
'avatar',
--- /dev/null
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ Schema::table('users', function(Blueprint $table) {
+ $table->string('discord_nickname')->nullable()->default(null);
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::table('users', function(Blueprint $table) {
+ $table->dropColumn('discord_nickname');
+ });
+ }
+};
</Nav.Link>
</LinkContainer>
</Nav.Item>
+ <Nav.Item as="li">
+ <Nav.Link
+ className="p-0 text-muted"
+ href="https://glitchmaps.mfns.dev/"
+ target="_blank"
+ >
+ {t('footer.muffins')}
+ </Nav.Link>
+ </Nav.Item>
<Nav.Item as="li">
<Nav.Link
className="p-0 text-muted"
<Nav.Link>
<img alt="" src={getAvatarUrl(user)} />
{user.username}
- <span className="text-muted">#{user.discriminator}</span>
+ {user.discriminator && user.discriminator !== '0' ?
+ <span className="text-muted">#{user.discriminator}</span>
+ : null}
</Nav.Link>
</LinkContainer>
<Button
import { withTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom';
-import { getAvatarUrl } from '../../helpers/User';
+import { getAvatarUrl, getUserName } from '../../helpers/User';
import i18n from '../../i18n';
const Box = ({ discriminator, noLink, user }) => {
const content = <>
<img alt="" src={getAvatarUrl(user)} />
- <span>{discriminator || !user.nickname ? user.username : user.nickname}</span>
- {discriminator && user.discriminator ?
+ <span>{discriminator ? user.username : getUserName(user)}</span>
+ {discriminator && user.discriminator && user.discriminator !== '0' ?
<span className="text-muted">
{'#'}
{user.discriminator}
-import moment from 'moment';
-
export const compareFinished = round => (a, b) => {
const a_result = findResult(a, round);
const b_result = findResult(b, round);
return '/default-avatar.png';
};
-export const getUserName = user => (user && (user.nickname || user.username)) || '';
+export const getUserName = user => (user &&
+ (user.nickname || user.discord_nickname || user.username)) || '';
export const hasFinishedRound = (user, round) => {
const result = findResult(user, round);
alttpwiki: 'ALttP Speedrunning Wiki',
competitions: 'Wettbewerbe',
connect: 'Connect Spedruns Discord',
- contact: 'Wenn du gerne ein Turnier auf dieser Seite organisieren möchtest, wende dich bitte an HolySmoke#5229 im Discord.',
+ contact: 'Wenn du gerne ein Turnier auf dieser Seite organisieren möchtest, wende dich bitte an holysmoke86 im Discord.',
info: 'Infos',
map: 'ALttP Karte',
+ muffins: 'Muffins\' Glitch Map (EN)',
privacy: 'Datenschutz',
resources: 'Ressourcen',
smd: 'Deutscher Super Metroid Discord',
alttpwiki: 'ALttP Speedrunning Wiki',
competitions: 'Competitions',
connect: 'Connect Spedruns Discord',
- contact: 'If you would like to organize a Tournament on this site, please contact HolySmoke#5229 on Discord.',
+ contact: 'If you would like to organize a Tournament on this site, please contact holysmoke86 on Discord.',
info: 'Infos',
map: 'ALttP Map',
+ muffins: 'Muffins\' Glitch Map',
privacy: 'Privacy',
resources: 'Resources',
smd: 'German Super Metroid Discord',