Skip to content

Commit

Permalink
Merge pull request #146 from joshzcold/feat/homepage-versioning
Browse files Browse the repository at this point in the history
feat(ui): add version indicator to home page
  • Loading branch information
joshzcold authored Jan 11, 2025
2 parents c972619 + 667e4fd commit 18e68a3
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ NEXT_PUBLIC_MAX_IMAGE_UPLOAD_SIZE_MB=2

# Maximum size in megabytes for CSV file uploads
NEXT_PUBLIC_MAX_CSV_UPLOAD_SIZE_MB=2

# Application version number
# Displayed in bottom right corner of home page
# Remove or leave empty to hide version number
NEXT_PUBLIC_APP_VERSION=2.0.0
2 changes: 2 additions & 0 deletions components/Login/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useTranslation } from "react-i18next";
import "i18n/i18n";
import { Coffee, Mail } from "lucide-react";
import Link from "next/link";
import Version from "components/Title/Version";

const Donate = () => {
const { t } = useTranslation();
Expand Down Expand Up @@ -57,6 +58,7 @@ export default function Footer(props) {
<Email />
<Donate />
</div>
<Version />
</div>
);
}
24 changes: 24 additions & 0 deletions components/Title/Version.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import Link from 'next/link';
import { useTranslation } from 'react-i18next';

const Version = () => {
const { t } = useTranslation();
const version = process.env.NEXT_PUBLIC_APP_VERSION;

if (!version) return null;

return (
<div className="absolute bottom-2 right-2">
<Link
href={'https://github.com/joshzcold/Friendly-Feud/releases'}
target="_blank"
rel="noopener noreferrer"
className="text-sm text-secondary-900 hover:underline"
>
{t('Version')} {version}
</Link>
</div>
);
};

export default Version;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cold_friendly_feud",
"version": "1.1.0",
"version": "2.0.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
Expand Down
3 changes: 1 addition & 2 deletions public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@
"email": "email",
"source code": "source code",
"Question": "Question",
"Join at": "Join at",
"Room Code": "Room Code",
"First Buzzer": "First Buzzer",
"Select question set": "Select question set",
"Join at": "Join at",
Expand All @@ -130,6 +128,7 @@
"First Press Only": "First Press Only",
"You have been blindfolded...": "You have been blindfolded...",
"Reset Mistakes": "Reset Mistakes",
"Version": "Version",
"errors": {
"room_not_found": "Room not found",
"host_quit": "Host quit the game",
Expand Down
1 change: 1 addition & 0 deletions public/locales/et/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
"First Press Only": "Ainult esimene summer",
"You have been blindfolded...": "Sind on pimestatud...",
"Reset Mistakes": "Lähtesta vead",
"Version": "Versioon",
"errors": {
"room_not_found": "Mängu ei leitud",
"host_quit": "Mängu juht lahkus mängust",
Expand Down

0 comments on commit 18e68a3

Please sign in to comment.