Icon.DISCORD = makePreset('DiscordIcon', ['fab', 'discord']);
Icon.EDIT = makePreset('EditIcon', 'edit');
Icon.FINISHED = makePreset('FinishedIcon', 'square-check');
+Icon.FIRST_PLACE = makePreset('FirstPlaceIcon', 'trophy');
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.THIRD_PLACE = makePreset('ThirdPlaceIcon', 'award');
export default Icon;
const getEntryDescription = entry => {
switch (entry.type) {
+ case 'result.report':
case 'round.create':
return i18n.t(
`protocol.description.${entry.type}`,
import { maySeeResults } from '../../helpers/permissions';
import { withUser } from '../../helpers/UserContext';
+const getIcon = (result, index) => {
+ if (!result || !result.has_finished) {
+ return <Icon.PENDING className="text-muted" size="lg" />;
+ }
+ if (index === 0) {
+ return <Icon.FIRST_PLACE className="text-gold" size="lg" />;
+ }
+ if (index === 1) {
+ return <Icon.SECOND_PLACE className="text-silver" size="lg" />;
+ }
+ if (index === 2) {
+ return <Icon.THIRD_PLACE className="text-bronze" size="lg" />;
+ }
+ return <Icon.FINISHED className="text-success" size="lg" />;
+};
+
const Item = ({
+ index,
participant,
round,
tournament,
formatTime(result)
: null}
</span>
- {result && result.has_finished ?
- <Icon.FINISHED className="text-success" size="lg" />
- :
- <Icon.PENDING size="lg" />
- }
+ {getIcon(result, index)}
</div>
</div>
);
};
Item.propTypes = {
+ index: PropTypes.number,
participant: PropTypes.shape({
user: PropTypes.shape({
}),
import { sortByResult } from '../../helpers/Participant';
const List = ({ round, tournament }) => <div className="results d-flex flex-wrap">
- {sortByResult(tournament.participants, round).map(participant =>
+ {sortByResult(tournament.participants, round).map((participant, index) =>
<Item
+ index={index}
key={participant.id}
participant={participant}
round={round}
import i18n from '../../i18n';
const Item = ({
+ index,
round,
tournament,
user,
}) =>
<li className="round d-flex">
<div className="info">
- <p className="date">{i18n.t('rounds.date', { date: new Date(round.created_at) })}</p>
+ <p className="date">
+ {`#${index + 1} `}
+ {i18n.t('rounds.date', { date: new Date(round.created_at) })}
+ </p>
<p className="seed">
<SeedButton
round={round}
</li>;
Item.propTypes = {
+ index: PropTypes.number,
round: PropTypes.shape({
created_at: PropTypes.string,
seed: PropTypes.string,
tournament,
}) => rounds && rounds.length ?
<ol className="rounds">
- {rounds.map(round =>
+ {rounds.map((round, index) =>
<Item
+ index={index}
key={round.id}
round={round}
tournament={tournament}
},
protocol: {
description: {
+ result: {
+ report: 'Ergebnis eingetragen',
+ },
round: {
create: 'Runde hinzugefĆ¼gt',
},
$font-size-base: 0.9rem;
$line-height-base: 1.6;
+// Colors
+$bronze: #ad8a56;
+$discord: #5865f2;
+$gold: #c9b037;
+$silver: #b4b4b4;
+
// Custom variant
$custom-colors: (
- "discord": #5865f2
+ "discord": $discord
);
margin-top: 2.5rem;
margin-bottom: 2rem;
}
+
+.text-gold {
+ color: $gold;
+}
+.text-silver {
+ color: $silver;
+}
+.text-bronze {
+ color: $bronze;
+}
.info {
padding-right: 1rem;
min-width: 13em;
+
+ .date {
+ font-size: 125%;
+ }
}
}
}