Skip to content

Commit

Permalink
Merge branch 'hotfix/0.7.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
mazhutoanton committed Oct 4, 2023
2 parents 26541b3 + 4ca0f82 commit b983954
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 24 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

-

### v0.7.2

- Added plural versions of the words
- Fixed tournament dayDifference

### v0.7.1

- Added utm parameter in tweet
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "0.7.1"
"version": "0.7.2"
}
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cere/eslint-config-games-sdk",
"version": "0.7.1",
"version": "0.7.2",
"main": "index.js",
"private": true,
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cere/games-sdk",
"version": "0.7.1",
"version": "0.7.2",
"description": "Cere Games SDK to integrate games with CERE infrastructure",
"sideEffects": false,
"main": "dist/bundle.umd.js",
Expand All @@ -26,7 +26,7 @@
},
"dependencies": {
"@cere/embed-wallet": "0.12.0",
"@cere/games-sdk-ui": "0.7.1",
"@cere/games-sdk-ui": "0.7.2",
"react-gtm-module": "^2.0.11"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cere/games-sdk-ui",
"version": "0.7.1",
"version": "0.7.2",
"description": "Cere Games SDK UI Elements",
"sideEffects": false,
"main": "dist/bundle.umd.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/widgets/Leaderboard/Leaderboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const Leaderboard = ({
const tournamentEndDate = new Date(activeTournament.endDate);
const dateNow = new Date();
const diffInTime = tournamentEndDate.getTime() - dateNow.getTime();
return Math.ceil(Math.abs(diffInTime / (1000 * 3600 * 24)));
return diffInTime > 0 ? Math.ceil(Math.abs(diffInTime / (1000 * 3600 * 24))) : 0;
}, [activeTournament]);

return (
Expand All @@ -126,7 +126,7 @@ Be a top 3 player to win a prize"
hasActiveTournament={Boolean(activeTournament)}
tournamentTitle={`${activeTournament ? activeTournament.title : 'Weekly tournament'}`}
tournamentSubtitle={activeTournament ? activeTournament.subtitle : 'TOP 20 WINS UNIQUE NFT'}
amountOfDaysLeft={dayDifference ? dayDifference : 1}
amountOfDaysLeft={Boolean(dayDifference) ? dayDifference : 0}
onPlayAgain={handlePlayAgain}
onTweet={onTweet}
disabled={balance < sessionPrice}
Expand Down
15 changes: 12 additions & 3 deletions packages/ui/src/widgets/Leaderboard/TopWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const DaysLeft = styled.div(({ tournament }: { tournament?: boolean }) => ({
borderRadius: 8,
fontWeight: 600,
fontSize: 14,
whiteSpace: 'nowrap',
display: 'none',
textAlign: 'center',
minWidth: 168,
Expand Down Expand Up @@ -228,16 +229,24 @@ export const TopWidget = ({
window.open(`https://twitter.com/intent/tweet?${tweetBody}`, '_system', 'width=600,height=600');
}, [address, gameInfo.name, gameInfo.tags, onTweet, score]);

const pluralizeWord = (singularWord: string, pluralWord: string, count: number) => {
return count > 1 || count === 0 ? pluralWord : singularWord;
};

return (
<WidgetWrapper layer={`${cdnUrl}/assets/layer.svg`} padding={[3, 3, 3, 3]} tournament={hasActiveTournament}>
<RadialGradientBackGround />
<Content>
<>
<UniqueNFT align="center" tournament>
{tournamentSubtitle}
{amountOfDaysLeft === 0 ? 'Sorry, this tournament is over' : tournamentSubtitle}
</UniqueNFT>
<Typography align="center">{tournamentTitle}</Typography>
<DaysLeft tournament={hasActiveTournament}>{amountOfDaysLeft} day left</DaysLeft>
<Typography align="center">
{amountOfDaysLeft === 0 ? 'Keep playing to practice for the next one' : tournamentTitle}
</Typography>
<DaysLeft tournament={hasActiveTournament}>
{amountOfDaysLeft} {pluralizeWord('day', 'days', amountOfDaysLeft)} left
</DaysLeft>
<RewardsRow>
<RewardColumn>
<span>1st prize</span>
Expand Down
4 changes: 2 additions & 2 deletions playground/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@cere-games-sdk/playground",
"version": "0.7.1",
"version": "0.7.2",
"private": true,
"scripts": {
"start": "craco start"
},
"dependencies": {
"@cere/games-sdk": "0.7.1",
"@cere/games-sdk": "0.7.2",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"@mui/lab": "^5.0.0-alpha.119",
Expand Down
2 changes: 1 addition & 1 deletion tests/wdio/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cere-games-sdk/wdio",
"version": "0.7.1",
"version": "0.7.2",
"private": true,
"scripts": {
"start": "wdio run ./wdio.conf.ts",
Expand Down
4 changes: 2 additions & 2 deletions web/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@cere-games-sdk/web",
"version": "0.7.1",
"version": "0.7.2",
"private": true,
"scripts": {
"start": "webpack serve --open /examples",
"bundle": "webpack"
},
"dependencies": {
"@cere/games-sdk": "0.7.1"
"@cere/games-sdk": "0.7.2"
},
"devDependencies": {
"copy-webpack-plugin": "^11.0.0",
Expand Down

0 comments on commit b983954

Please sign in to comment.