From 3a278fec10ad6b68a6ce22573b447ec45984551b Mon Sep 17 00:00:00 2001 From: Divlo Date: Tue, 27 Jul 2021 11:36:35 +0000 Subject: [PATCH] feat: add version number in footer --- .releaserc.json | 1 + CONTRIBUTING.md | 4 +- components/Footer.tsx | 37 +- components/__test__/Footer.test.tsx | 21 +- package-lock.json | 629 +++++++--------------------- package.json | 1 + pages/404.tsx | 18 +- pages/500.tsx | 18 +- pages/_app.tsx | 9 +- pages/index.tsx | 83 ++-- 10 files changed, 290 insertions(+), 531 deletions(-) diff --git a/.releaserc.json b/.releaserc.json index 70146fd..0749a4a 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -13,6 +13,7 @@ "preset": "conventionalcommits" } ], + "@semantic-release/npm", "@semantic-release/github" ] } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d0bd1ae..b0882b8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -51,8 +51,8 @@ Scopes define what part of the code changed. ### Prerequisites -- [Node.js](https://nodejs.org/) >= 14 -- [npm](https://www.npmjs.com/) >= 7 +- [Node.js](https://nodejs.org/) >= 14.0.0 +- [npm](https://www.npmjs.com/) >= 7.0.0 ### Installation diff --git a/components/Footer.tsx b/components/Footer.tsx index 5ae92c3..1058755 100644 --- a/components/Footer.tsx +++ b/components/Footer.tsx @@ -1,13 +1,42 @@ +import { useMemo } from 'react' +import Link from 'next/link' import useTranslation from 'next-translate/useTranslation' -export const Footer: React.FC = () => { +export interface FooterProps { + version: string +} + +export const Footer: React.FC = (props) => { const { t } = useTranslation() + const { version } = props + + const versionLink = useMemo(() => { + if (version !== '0.0.0-development') { + return `https://github.com/Divlo/Divlo/releases/tag/v${version}` + } + return 'https://github.com/Divlo/Divlo/tree/develop' + }, [version]) return ( -