From: Daniel Karbach Date: Thu, 17 Mar 2022 20:42:47 +0000 (+0100) Subject: add user stream links X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=9e52cf7a5fc89a89301e00e9595c80b783449bbe;p=alttp.git add user stream links --- diff --git a/database/migrations/2022_03_17_185202_user_stream_link.php b/database/migrations/2022_03_17_185202_user_stream_link.php new file mode 100644 index 0000000..e8abfa3 --- /dev/null +++ b/database/migrations/2022_03_17_185202_user_stream_link.php @@ -0,0 +1,32 @@ +text('stream_link')->nullable()->default(null); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('users', function(Blueprint $table) { + $table->dropColumn('stream_link'); + }); + } +}; diff --git a/resources/js/components/common/Icon.js b/resources/js/components/common/Icon.js index 8b49c7e..53f251c 100644 --- a/resources/js/components/common/Icon.js +++ b/resources/js/components/common/Icon.js @@ -67,6 +67,7 @@ Icon.LOGOUT = makePreset('LogoutIcon', 'sign-out-alt'); Icon.PENDING = makePreset('PendingIcon', 'clock'); Icon.PROTOCOL = makePreset('ProtocolIcon', 'file-alt'); Icon.SECOND_PLACE = makePreset('SecondPlaceIcon', 'medal'); +Icon.STREAM = makePreset('StreamIcon', ['fab', 'twitch']); Icon.THIRD_PLACE = makePreset('ThirdPlaceIcon', 'award'); export default Icon; diff --git a/resources/js/components/tournament/Scoreboard.js b/resources/js/components/tournament/Scoreboard.js index 008974b..e142a80 100644 --- a/resources/js/components/tournament/Scoreboard.js +++ b/resources/js/components/tournament/Scoreboard.js @@ -1,8 +1,9 @@ import PropTypes from 'prop-types'; import React from 'react'; -import { Table } from 'react-bootstrap'; +import { Button, Table } from 'react-bootstrap'; import { withTranslation } from 'react-i18next'; +import Icon from '../common/Icon'; import Box from '../users/Box'; import { calculateScores } from '../../helpers/Tournament'; import i18n from '../../i18n'; @@ -18,7 +19,22 @@ const Scoreboard = ({ tournament }) => {calculateScores(tournament).map(score => - + +
+ + {score.participant.user.stream_link ? + + : null} +
+ {score.score} )} diff --git a/resources/js/i18n/de.js b/resources/js/i18n/de.js index 27a2a40..e7c5086 100644 --- a/resources/js/i18n/de.js +++ b/resources/js/i18n/de.js @@ -28,6 +28,7 @@ export default { PendingIcon: 'Ausstehend', SecondPlaceIcon: 'Zweiter Platz', ThirdPlaceIcon: 'Dritter Platz', + StreamIcon: 'Stream', zelda: { 'big-key': 'Big Key', 'blue-boomerang': 'Boomerang', @@ -124,6 +125,9 @@ export default { tournaments: { scoreboard: 'Scoreboard', }, + users: { + stream: 'Stream', + }, validation: { error: { required: 'Bitte ausfüllen', diff --git a/resources/js/i18n/en.js b/resources/js/i18n/en.js index 80c091a..0f8b744 100644 --- a/resources/js/i18n/en.js +++ b/resources/js/i18n/en.js @@ -28,6 +28,7 @@ export default { PendingIcon: 'Pending', SecondPlaceIcon: 'Second Place', ThirdPlaceIcon: 'Third Place', + StreamIcon: 'Stream', zelda: { 'big-key': 'Big Key', 'blue-boomerang': 'Boomerang', @@ -124,6 +125,9 @@ export default { tournaments: { scoreboard: 'Scoreboard', }, + users: { + stream: 'Stream', + }, validation: { error: { required: 'Please tell me', diff --git a/resources/sass/_variables.scss b/resources/sass/_variables.scss index aadcd83..886d1d2 100644 --- a/resources/sass/_variables.scss +++ b/resources/sass/_variables.scss @@ -11,8 +11,10 @@ $bronze: #ad8a56; $discord: #5865f2; $gold: #c9b037; $silver: #b4b4b4; +$twitch: #6441a5; // Custom variant $custom-colors: ( - "discord": $discord + "discord": $discord, + "twitch": $twitch );