Show buttons to get to open clues even if that clue has no associated plot (#37)

* Add button to home page if there is no plot for a puzzle

* Actual fix

* SOBBB

* SSSSSOOOOOOB
This commit is contained in:
Alex Marcellus 2024-07-22 13:37:15 -07:00 коммит произвёл GitHub
Родитель 964092b720
Коммит b09e1bd173
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 13 добавлений и 9 удалений

Просмотреть файл

@ -5,7 +5,7 @@ import {AdditionalContent} from "components/staff/presentation/AdditionalContent
import {CallManager} from "./CallManager";
import {PlayerClue, usePlayerClues} from "modules/player";
import {SolvedPlot, UnsolvedPlot} from "modules/types";
import {FaPuzzlePiece, FaChevronDown} from "react-icons/fa";
import {FaPuzzlePiece, FaChevronDown, FaLocationArrow} from "react-icons/fa";
import moment from 'moment';
import _ from 'lodash';
@ -20,7 +20,7 @@ const PlotItem = ({clue}: {clue: PlayerClue}) => {
if (solvedPlot.length > 0) {
if (clue.submittableType === 'Plot') {
return (
<Container fluid>
<Container fluid style={{marginBottom: '37px'}}>
<ListGroup.Item>
{clueSolveTimeAnchor}
<Row style={{justifyContent: 'center', display: 'flex'}}>
@ -31,7 +31,7 @@ const PlotItem = ({clue}: {clue: PlayerClue}) => {
);
} else {
return (
<Container fluid>
<Container fluid style={{marginBottom: '37px'}}>
<ListGroup.Item>
{clueSolveTimeAnchor}
<Row style={{justifyContent: 'center', display: 'flex'}}>
@ -39,7 +39,7 @@ const PlotItem = ({clue}: {clue: PlayerClue}) => {
</Row>
<Row style={{justifyContent: 'center', display: 'flex'}}>
<LinkContainer to={`/player/clue/${clue.tableOfContentId}`} style={{ color: "#FFFFFF" }}>
<Button><FaPuzzlePiece /> Puzzle</Button>
<Button>{(clue.submittableType === "Puzzle") && <FaPuzzlePiece />}{(clue.submittableType === "LocUnlock") && <FaLocationArrow />}{clue.submittableTitle}</Button>
</LinkContainer>
</Row>
</ListGroup.Item>
@ -59,7 +59,7 @@ const PlotItem = ({clue}: {clue: PlayerClue}) => {
// color of the LinkContainer here. If we ever configure site-wide themes this will need to
// get pulled into that.
return (
<Container fluid>
<Container fluid style={{marginBottom: '37px'}}>
<ListGroup.Item>
{clueSolveTimeAnchor}
<Row style={{justifyContent: 'center', display: 'flex'}}>
@ -67,7 +67,7 @@ const PlotItem = ({clue}: {clue: PlayerClue}) => {
</Row>
<Row style={{justifyContent: 'center', display: 'flex'}}>
<LinkContainer to={`/player/clue/${clue.tableOfContentId}`} style={{ color: "#FFFFFF" }}>
<Button><FaPuzzlePiece /> Puzzle</Button>
<Button>{(clue.submittableType === "Puzzle") && <FaPuzzlePiece />}{(clue.submittableType === "LocUnlock") && <FaLocationArrow />}{clue.submittableTitle}</Button>
</LinkContainer>
</Row>
</ListGroup.Item>
@ -75,8 +75,10 @@ const PlotItem = ({clue}: {clue: PlayerClue}) => {
);
} else {
return (
<Container fluid>
No plot for <em>{clue.submittableTitle}</em>
<Container fluid style={{marginBottom: '37px'}}>
<LinkContainer to={`/player/clue/${clue.tableOfContentId}`} style={{ color: "#FFFFFF" }}>
<Button>{(clue.submittableType === "Puzzle") && <FaPuzzlePiece />}{(clue.submittableType === "LocUnlock") && <FaLocationArrow />}{clue.submittableTitle}</Button>
</LinkContainer>
</Container>
);
}
@ -105,7 +107,9 @@ export const PlayerPlot = () => {
</Button>}
<ListGroup>
{sortedClues.map(clue =>
<div>
<PlotItem key={clue.tableOfContentId} clue={clue} />
</div>
)}
</ListGroup>
</div>