Import Soapbox version/metadata from package.json

This commit is contained in:
Alex Gleason 2021-03-30 12:19:42 -05:00
parent f116d57d11
commit dfa1443832
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
2 changed files with 8 additions and 6 deletions

View file

@ -7,13 +7,15 @@ import { connect } from 'react-redux';
import { openModal } from '../../../actions/modal'; import { openModal } from '../../../actions/modal';
import { logOut } from 'soapbox/actions/auth'; import { logOut } from 'soapbox/actions/auth';
import { isStaff } from 'soapbox/utils/accounts'; 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 = { const sourceCode = {
name: 'soapbox-fe', name: pkg.name,
url: 'https://gitlab.com/soapbox-pub/soapbox-fe', url: pkg.repository.url,
repository: 'soapbox-pub/soapbox-fe', repository: shortRepoName(pkg.repository.url),
version: '1.1.0', version: pkg.version,
}; };
const mapStateToProps = state => { const mapStateToProps = state => {

View file

@ -5,7 +5,7 @@
"homepage": "https://soapbox.pub/", "homepage": "https://soapbox.pub/",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://gitlab.com/soapbox-pub/soapbox-fe.git" "url": "https://gitlab.com/soapbox-pub/soapbox-fe"
}, },
"keywords": [ "keywords": [
"fediverse", "fediverse",