]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/components/events/Detail.js
show some past episodes on concluded events
[alttp.git] / resources / js / components / events / Detail.js
index 3626fbd4cc4db9e390fbc9d7d64d227b167707b7..65895482d320dd6b1ca07b740794e0435cc2b2ce 100644 (file)
@@ -1,10 +1,11 @@
 import PropTypes from 'prop-types';
 import React from 'react';
-import { Button } from 'react-bootstrap';
+import { Alert, Button } from 'react-bootstrap';
 import { useTranslation } from 'react-i18next';
 
 import Icon from '../common/Icon';
 import RawHTML from '../common/RawHTML';
+import { hasConcluded } from '../../helpers/Event';
 import { getTranslation } from '../../helpers/Technique';
 import i18n from '../../i18n';
 
@@ -13,7 +14,10 @@ const Detail = ({ actions, event }) => {
 
        return <>
                <div className="d-flex align-items-center justify-content-between">
-                       <h1>{event.title}</h1>
+                       <h1>
+                               {(event.description && getTranslation(event.description, 'title', i18n.language))
+                                       || event.title}
+                       </h1>
                        {event.description && actions.editContent ?
                                <Button
                                        className="ms-3"
@@ -29,6 +33,11 @@ const Detail = ({ actions, event }) => {
                {event.description ?
                        <RawHTML html={getTranslation(event.description, 'description', i18n.language)} />
                : null}
+               {hasConcluded(event) ?
+                       <Alert variant="info">
+                               {t('events.concluded')}
+                       </Alert>
+               : null}
        </>;
 };
 
@@ -39,6 +48,7 @@ Detail.propTypes = {
        event: PropTypes.shape({
                description: PropTypes.shape({
                }),
+               end: PropTypes.string,
                title: PropTypes.string,
        }),
 };