Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { getGameIdBasedOnHref } from "./utils";
import { Privacy } from "./pages/Privacy";
import ContractService from "./services/ContractService";
import { Ended } from "./pages/Ended";
import { ArtistEnded } from "./pages/Artist/ArtistEnded";

function App() {
setupSDK();
Expand Down Expand Up @@ -173,6 +174,20 @@ function App() {
/>
}
/>

<Route
path="/artistEnded/:artistId"
element={
<ArtistEnded
user={user}
showPickArtistModal={showPickArtistModal}
setShowPickArtistModal={setShowPickArtistModal}
setChooseArtistView={setChooseArtistView}
selectedArtist={selectedArtist}
setSelectedArtist={setSelectedArtist}
/>
}
/>
</Routes>
)}
<Footer />
Expand Down
12 changes: 10 additions & 2 deletions frontend/src/components/GameCards/GameCards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ interface GameCardsProps {
The current game
*/
currentGame?: any;

selectedLevel: number;
currentLevel: number;

nftCount: any;
userIsFullSetHolder: boolean;
ended: boolean;

/**
* Click handler for each level
Expand All @@ -42,7 +41,10 @@ export const GameCards = (props: GameCardsProps) => {
onLevelSelected,
nftCount,
userIsFullSetHolder,
ended,
} = props;
console.log(ended, "ended props gamecards");

const [burnStatus, setBurnStatus] = useState({});

const { levelSettings } = useContext(DataContext);
Expand Down Expand Up @@ -84,6 +86,7 @@ export const GameCards = (props: GameCardsProps) => {
burnStatus={burnStatus[1]}
currentLevel={currentLevel}
levelSettings={levelSettings}
ended={ended}
/>
<Level2
selectedLevel={selectedLevel}
Expand All @@ -94,6 +97,7 @@ export const GameCards = (props: GameCardsProps) => {
burnStatus={burnStatus[2]}
currentLevel={currentLevel}
levelSettings={levelSettings}
ended={ended}
/>
<Level3
selectedLevel={selectedLevel}
Expand All @@ -104,6 +108,7 @@ export const GameCards = (props: GameCardsProps) => {
burnStatus={burnStatus[3]}
currentLevel={currentLevel}
levelSettings={levelSettings}
ended={ended}
/>
<Level4
selectedLevel={selectedLevel}
Expand All @@ -115,6 +120,7 @@ export const GameCards = (props: GameCardsProps) => {
currentLevel={currentLevel}
levelSettings={levelSettings}
currentGame={currentGame}
ended={ended}
/>
<Level5
selectedLevel={selectedLevel}
Expand All @@ -126,6 +132,7 @@ export const GameCards = (props: GameCardsProps) => {
currentLevel={currentLevel}
levelSettings={levelSettings}
currentGame={currentGame}
ended={ended}
/>
<Level6
selectedLevel={selectedLevel}
Expand All @@ -138,6 +145,7 @@ export const GameCards = (props: GameCardsProps) => {
levelSettings={levelSettings}
currentGame={currentGame}
userIsFullSetHolder={userIsFullSetHolder}
ended={ended}
/>
</div>
);
Expand Down
9 changes: 7 additions & 2 deletions frontend/src/components/GameCards/Level1.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ export const Level1 = (props) => {
onGetMoreClick,
nftCount,
burnStatus,
currentLevel
currentLevel,
ended,
} = props;
const status = getLevelsStatuses(currentLevel || 1)[1];
const level1Count = nftCount["1"] || 0;
let instructions = `You have ${level1Count === -1 ? 0 : level1Count} cards.`;
let tradeActionText = "";
let actionLocked = false;
let actionLocked = ended;
let lessThan2NftsAndBurnt = level1Count < 2 && burnStatus;
let lessThan2NftsAndNeverBurnt = level1Count < 2 && !burnStatus;

Expand Down Expand Up @@ -46,26 +47,30 @@ export const Level1 = (props) => {
onActionClick: (level) => onTradeClick(level),
label: tradeActionText,
mode: actionLocked ? "pinkStroke" : "default",
disabled: actionLocked,
});
if (!burnStatus || burnStatus) {
actions.push({
onActionClick: (level) => onGetMoreClick(level),
label: "Get more",
mode: "default",
link: true,
disabled: actionLocked,
});
}
} else if (level1Count === 0) {
actions.push({
onActionClick: (level) => onGetMoreClick(level),
label: tradeActionText,
mode: "default",
disabled: actionLocked,
});
} else if (lessThan2NftsAndBurnt || lessThan2NftsAndNeverBurnt) {
actions.push({
onActionClick: (level) => onGetMoreClick(level),
label: tradeActionText,
mode: "default",
disabled: actionLocked,
});
}

Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/GameCards/Level2.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const Level2 = (props) => {
onTradeClick,
nftCount,
burnStatus,
ended,
} = props;
const level2Count = nftCount["2"] || 0;
const status = getLevelsStatuses(currentLevel || 1)[2];
Expand Down Expand Up @@ -44,7 +45,7 @@ export const Level2 = (props) => {
onActionClick: (level) => onTradeClick(level),
label: tradeActionText,
mode: actionLocked ? "pinkStroke" : "default",
disabled: actionDisabled,
disabled: ended ? ended : actionDisabled,
useIcon: actionDisabled,
},
];
Expand Down
11 changes: 6 additions & 5 deletions frontend/src/components/GameCards/Level3.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export const Level3 = (props) => {
onTradeClick,
nftCount,
burnStatus,
levelSettings
levelSettings,
ended,
} = props;
const level3Count = nftCount["3"] || 0;
const status = getLevelsStatuses(currentLevel || 1)[3];
Expand Down Expand Up @@ -37,10 +38,10 @@ export const Level3 = (props) => {
tradeActionText = "Start Trading";
}
// if the next level has a count down
if(applyCountDown(levelSettings?.[4])) {
if (applyCountDown(levelSettings?.[4])) {
noActions = true;
if(currentLevel ===3) {
instructions += ' Level 4 unlocks after the countdown.'
if (currentLevel === 3) {
instructions += " Level 4 unlocks after the countdown.";
}
}
}
Expand All @@ -52,7 +53,7 @@ export const Level3 = (props) => {
onActionClick: (level) => onTradeClick(level),
label: tradeActionText,
mode: actionLocked ? "pinkStroke" : "default",
disabled: actionDisabled,
disabled: ended ? ended : actionDisabled,
useIcon: actionDisabled,
},
];
Expand Down
35 changes: 20 additions & 15 deletions frontend/src/components/GameCards/Level4.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { LevelCard } from "../LevelCard/LevelCard";
import { applyCountDown, getLevelsStatuses, getDifferenceBetweenDates } from "../../utils";
import {
applyCountDown,
getLevelsStatuses,
getDifferenceBetweenDates,
} from "../../utils";
import { useEarlyBirdInfo } from "../../hooks/useEarlyBirdCount";

export const Level4 = (props) => {
Expand All @@ -12,6 +16,7 @@ export const Level4 = (props) => {
nftCount,
burnStatus,
currentGame,
ended,
} = props;
const level4Count = nftCount["4"] || 0;
let status = getLevelsStatuses(currentLevel || 1)[4];
Expand Down Expand Up @@ -46,10 +51,9 @@ export const Level4 = (props) => {
if (unlockDate > today) {
// show the timer
noActions = true;
if (status === 'next') {
if (status === "next") {
status = "next-locked";
} else {

status = "locked";
}
const difference = getDifferenceBetweenDates(today, unlockDate);
Expand Down Expand Up @@ -80,8 +84,9 @@ export const Level4 = (props) => {
"You have 0 cards. Trade 2 cards from the previous level.";
noActions = true;
} else {
instructions = `You have ${level4Count === -1 ? 0 : level4Count
} cards. Get 1 more from the previous level.`;
instructions = `You have ${
level4Count === -1 ? 0 : level4Count
} cards. Get 1 more from the previous level.`;
tradeActionText = "Start Trading";
actionDisabled = true;
actionLocked = true;
Expand Down Expand Up @@ -116,22 +121,22 @@ export const Level4 = (props) => {
if (applyCountDown(levelSettings?.[5])) {
noActions = true;
if (currentLevel === 4) {
instructions += ' Level 5 unlocks after the countdown.'
instructions += " Level 5 unlocks after the countdown.";
}

}

const actions = noActions
? []
: [
{
onActionClick: (level) => onTradeClick(level),
label: tradeActionText,
mode: actionLocked ? "pinkStroke" : "default",
disabled: actionDisabled,
useIcon: actionDisabled,
},
];
{
onActionClick: (level) => onTradeClick(level),
label: tradeActionText,
mode: actionLocked ? "pinkStroke" : "default",
disabled: ended ? ended : actionDisabled,

useIcon: actionDisabled,
},
];

return (
<LevelCard
Expand Down
15 changes: 10 additions & 5 deletions frontend/src/components/GameCards/Level5.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { LevelCard } from "../LevelCard/LevelCard";
import { applyCountDown, getLevelsStatuses, getDifferenceBetweenDates } from "../../utils";
import {
applyCountDown,
getLevelsStatuses,
getDifferenceBetweenDates,
} from "../../utils";
import { useEarlyBirdInfo } from "../../hooks/useEarlyBirdCount";

export const Level5 = (props) => {
Expand All @@ -12,6 +16,7 @@ export const Level5 = (props) => {
nftCount,
burnStatus,
currentGame,
ended,
} = props;
const level5Count = nftCount["5"] || 0;
let status = getLevelsStatuses(currentLevel || 1)[5];
Expand Down Expand Up @@ -104,10 +109,10 @@ export const Level5 = (props) => {
}

// if the next level has a count down
if(applyCountDown(levelSettings?.[6])) {
if (applyCountDown(levelSettings?.[6])) {
noActions = true;
if(currentLevel === 5) {
instructions += ' Level 6 unlocks after the countdown.'
if (currentLevel === 5) {
instructions += " Level 6 unlocks after the countdown.";
}
}

Expand All @@ -118,7 +123,7 @@ export const Level5 = (props) => {
onActionClick: (level) => onTradeClick(level),
label: tradeActionText,
mode: actionLocked ? "pinkStroke" : "default",
disabled: actionDisabled,
disabled: ended ? ended : actionDisabled,
useIcon: actionDisabled,
},
];
Expand Down
47 changes: 47 additions & 0 deletions frontend/src/images/Artist/game_ended_won_concert.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions frontend/src/images/game_ended_won_concert.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/src/images/you_won_concert_ended.zip
Binary file not shown.
Loading