From dfa1443832a8f60f756473cab4cd93277c1b3b1f Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 30 Mar 2021 12:19:42 -0500 Subject: [PATCH] Import Soapbox version/metadata from package.json --- app/soapbox/features/ui/components/link_footer.js | 12 +++++++----- package.json | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/soapbox/features/ui/components/link_footer.js b/app/soapbox/features/ui/components/link_footer.js index 6e12f46d2..a903d0e93 100644 --- a/app/soapbox/features/ui/components/link_footer.js +++ b/app/soapbox/features/ui/components/link_footer.js @@ -7,13 +7,15 @@ import { connect } from 'react-redux'; import { openModal } from '../../../actions/modal'; import { logOut } from 'soapbox/actions/auth'; import { isStaff } from 'soapbox/utils/accounts'; +import pkg from '../../../../../package.json'; + +const shortRepoName = url => new URL(url).pathname.substring(1); -// FIXME: Let this be configured const sourceCode = { - name: 'soapbox-fe', - url: 'https://gitlab.com/soapbox-pub/soapbox-fe', - repository: 'soapbox-pub/soapbox-fe', - version: '1.1.0', + name: pkg.name, + url: pkg.repository.url, + repository: shortRepoName(pkg.repository.url), + version: pkg.version, }; const mapStateToProps = state => { diff --git a/package.json b/package.json index bac81c6c8..e85487982 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "homepage": "https://soapbox.pub/", "repository": { "type": "git", - "url": "https://gitlab.com/soapbox-pub/soapbox-fe.git" + "url": "https://gitlab.com/soapbox-pub/soapbox-fe" }, "keywords": [ "fediverse",