Skip to content

Commit 7ff2174

Browse files
committed
Merge branch 'master' of https://github.com/Rajan/lesspod
2 parents b88c83e + 15afebc commit 7ff2174

File tree

7 files changed

+2811
-2693
lines changed

7 files changed

+2811
-2693
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,20 @@ $ npm install
6262
$ npm run dev
6363
```
6464

65+
66+
#### Running the vuejs client in another commandline window: http://localhost:3000
67+
68+
```
69+
$ cd client/react
70+
$ npm install
71+
$ npm run start
72+
```
73+
74+
Keep things as simple to understand for others as possible. Also, add comments to any code being contributed.
75+
=======
6576
To deploy Vuejs client to Firebase
6677

78+
6779
1. Create a Firebase project and enable email auth, create firestore db, enable storage etc.
6880
2. Execute npm init with all options ON.
6981
3. Add firebase properties in the /client/vue/src/config.js

client/react/package-lock.json

Lines changed: 52 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/react/src/App.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@ import { STTButton } from './components/ScrollToTopButton';
2525
import "react-image-gallery/styles/css/image-gallery.css";
2626

2727
// google analytics for react
28-
2928
import ReactGA from 'react-ga';
30-
ReactGA.initialize('UA-125120010-1');
31-
ReactGA.pageview('/home');
32-
3329

3430

3531
const styles = {
@@ -64,6 +60,10 @@ class App extends Component {
6460
settingsStore.global = response.data.global;
6561
settingsStore.landingPage = response.data.landingPage;
6662
settingsStore.footer = response.data.footer;
63+
64+
if (settingsStore.global.trackerID != '') {
65+
ReactGA.initialize(settingsStore.global.trackerID);
66+
}
6767
}
6868
});
6969

@@ -93,6 +93,9 @@ class App extends Component {
9393
};
9494

9595
render() {
96+
if (settingsStore.global.trackerID != '') {
97+
ReactGA.pageview(window.location.pathname);
98+
}
9699
return (
97100
<div>
98101
<CustomFavicon />

client/react/src/components/SettingsTabs/GlobalSettingsForm.jsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class SettingsForm extends React.Component {
5353
disableNewRegistrations: false,
5454
squareLogoURL: '',
5555
horizontalLogoURL: '',
56+
trackerID: 'GA tracker ID',
5657
isSaving: false,
5758
};
5859

@@ -121,6 +122,7 @@ class SettingsForm extends React.Component {
121122
horizontalLogoURL,
122123
disableBlogMenu,
123124
disableNewRegistrations,
125+
trackerID,
124126
} = this.state;
125127

126128
return (
@@ -302,6 +304,26 @@ class SettingsForm extends React.Component {
302304
</label>
303305
</div>
304306
</div>
307+
308+
309+
<div className="field">
310+
<label className="label">Google Analytics tracker ID</label>
311+
<div className="control has-icons-left">
312+
<input
313+
className="input"
314+
type="name"
315+
id="trackerID"
316+
name="trackerID"
317+
value={trackerID}
318+
placeholder="e.g. UA-123456789-1"
319+
onChange={this.handleInputChange}
320+
/>
321+
{/* <span className="icon is-small is-left">
322+
<i className="fa fa-user-circle" />
323+
</span> */}
324+
</div>
325+
</div>
326+
305327
<div className="field is-grouped" style={{ marginTop: '2rem' }}>
306328
<div className="control">
307329
<div

client/react/src/stores/settingsStore.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const settingsStore = store({
88
disableNewRegistrations: false,
99
squareLogoURL: '',
1010
horizontalLogoURL: '',
11+
trackerID: '',
1112
},
1213
landingPage: {
1314
headline: 'Headline',

0 commit comments

Comments
 (0)