Adjust APP_NAME to be inside utils

APP_NAME should be visible from any component and module, so putting it
in utils makes the most sense.
This commit is contained in:
Joey Payne 2016-03-04 08:57:45 -07:00
commit cc759a2995
4 changed files with 12 additions and 2 deletions

View file

@ -11,6 +11,8 @@ import { connect } from 'react-redux'
import LibraryNav from 'LibraryNav' import LibraryNav from 'LibraryNav'
import EntrySelector from 'EntrySelector' import EntrySelector from 'EntrySelector'
import * as utils from 'utils'
const { const {
Popover, Popover,
Menu, Menu,
@ -44,6 +46,10 @@ class App extends React.Component {
} }
} }
static defaultProps = {
name: utils.APP_NAME
};
static get childContextTypes(){ static get childContextTypes(){
return {muiTheme: React.PropTypes.object} return {muiTheme: React.PropTypes.object}
} }
@ -95,7 +101,10 @@ class App extends React.Component {
className="left inline fill-height" className="left inline fill-height"
{...contextMenuActions} {...contextMenuActions}
/> />
<EntrySelector id="entry-selector" className="left inline fill-height" /> <EntrySelector
id="entry-selector"
className="left inline fill-height"
/>
</div> </div>
) )

View file

@ -9,6 +9,7 @@ import mkdirp from 'mkdirp'
import jsfile from 'jsonfile' import jsfile from 'jsonfile'
import rmdir from 'rimraf' import rmdir from 'rimraf'
var APP_NAME = 'TechNote'
export function getAppDataPath(){ export function getAppDataPath(){
return path.datadir(APP_NAME) return path.datadir(APP_NAME)

View file

@ -13,7 +13,6 @@
<div id="main"> <div id="main">
</div> </div>
<script> <script>
var APP_NAME = 'TechNote'
window.$ = window.jQuery = require('./app/static/jquery-1.12.0.min.js'); window.$ = window.jQuery = require('./app/static/jquery-1.12.0.min.js');
$(document).ready(function(){ $(document).ready(function(){
document.addEventListener("keydown", function (e) { document.addEventListener("keydown", function (e) {

View file

@ -1,4 +1,5 @@
var path = require('path'); var path = require('path');
var webpack = require('webpack');
module.exports = { module.exports = {
entry: './index.jsx', entry: './index.jsx',