@preval sourceCode
This commit is contained in:
parent
dfa1443832
commit
f97bba2308
2 changed files with 12 additions and 10 deletions
|
@ -7,16 +7,7 @@ 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';
|
import sourceCode from 'soapbox/utils/code';
|
||||||
|
|
||||||
const shortRepoName = url => new URL(url).pathname.substring(1);
|
|
||||||
|
|
||||||
const sourceCode = {
|
|
||||||
name: pkg.name,
|
|
||||||
url: pkg.repository.url,
|
|
||||||
repository: shortRepoName(pkg.repository.url),
|
|
||||||
version: pkg.version,
|
|
||||||
};
|
|
||||||
|
|
||||||
const mapStateToProps = state => {
|
const mapStateToProps = state => {
|
||||||
const me = state.get('me');
|
const me = state.get('me');
|
||||||
|
|
11
app/soapbox/utils/code.js
Normal file
11
app/soapbox/utils/code.js
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
// @preval
|
||||||
|
const pkg = require('../../../package.json');
|
||||||
|
|
||||||
|
const shortRepoName = url => new URL(url).pathname.substring(1);
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
name: pkg.name,
|
||||||
|
url: pkg.repository.url,
|
||||||
|
repository: shortRepoName(pkg.repository.url),
|
||||||
|
version: pkg.version,
|
||||||
|
};
|
Loading…
Reference in a new issue