Skip to content

Commit e9bb80e

Browse files
committed
Added Google Analytics
1 parent 35b926b commit e9bb80e

File tree

4 files changed

+49
-32
lines changed

4 files changed

+49
-32
lines changed

demo/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@
1414
"node-sass": "^4.12.0",
1515
"react": "^16.8.6",
1616
"react-dom": "^16.8.6",
17+
"react-ga": "^2.6.0",
1718
"react-scripts": "3.0.1",
19+
"react-spaces": "file:../react-spaces",
1820
"react-syntax-highlighter": "^11.0.2",
19-
"typescript": "^3.5.3",
20-
"react-spaces": "file:../react-spaces"
21+
"typescript": "^3.5.3"
2122
},
2223
"scripts": {
2324
"start": "react-scripts start",

demo/src/App.scss

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ h2 {
1414
border-bottom: 1px solid #ddd;
1515

1616
&.sidebar-header {
17-
margin-top: -5px;
17+
margin-top: 20px;
1818
padding-top: 0;
1919
border-bottom: none;
2020
}
@@ -32,6 +32,16 @@ h3 {
3232
}
3333
}
3434

35+
ul {
36+
li {
37+
margin-bottom: 15px;
38+
}
39+
40+
li:last-child {
41+
margin-bottom: 0;
42+
}
43+
}
44+
3545
pre {
3646
background-color: #f8f8f8 !important;
3747
margin: 0 0 15px 0;
@@ -41,6 +51,7 @@ pre {
4151
.examples {
4252
.spaces-fixedsize-layout {
4353
margin: 0 25px;
54+
font-size: 14px;
4455
}
4556
}
4657

demo/src/App.tsx

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
import React from 'react';
22
import * as Space from 'react-spaces';
3-
import { Tabs, Anchor, Divider, Button, Icon } from 'antd';
3+
import { Tabs, Anchor, Button, Icon } from 'antd';
44
import 'antd/dist/antd.css';
55
import SyntaxHighlighter from 'react-syntax-highlighter';
66
import './App.scss';
7+
import ReactGA from 'react-ga';
8+
9+
ReactGA.initialize("UA-144490437-1");
10+
ReactGA.pageview(window.location.pathname + window.location.search);
711

812
const Description = (props: string) => (
913
<Space.Centered>
@@ -30,13 +34,7 @@ const App: React.FC = () => {
3034
<Button type="primary" onClick={() => window.location.href = 'https://github.com/aeagle/react-spaces'}><Icon type="github" /> View on GitHub</Button>
3135
</div>
3236

33-
<h3 className="sidebar-header">NPM <img alt="NPM version" src="https://img.shields.io/npm/v/react-spaces.svg" /></h3>
34-
<div style={{ marginBottom: 15 }}>
35-
<Button type="primary" onClick={() => window.location.href = 'https://www.npmjs.com/package/react-spaces'}>View on NPM</Button>
36-
</div>
37-
38-
Maintained by
39-
<h2 className="sidebar-header"><a style={{ color: 'black', fontSize: 24 }} href="https://twitter.com/allaneagle">@allaneagle</a></h2>
37+
<h3 className="sidebar-header">NPM <img style={{ position: 'relative', top: -2 }} alt="NPM version" src="https://img.shields.io/npm/v/react-spaces.svg" /></h3>
4038

4139
<Anchor offsetTop={30}>
4240
<Anchor.Link href="#getting-started" title="Getting started" />
@@ -50,6 +48,8 @@ const App: React.FC = () => {
5048
<Anchor.Link href="#changes" title="Version history" />
5149
</Anchor>
5250

51+
<h2 className="sidebar-header"><a style={{ color: 'black', fontSize: 24 }} href="https://twitter.com/allaneagle">@allaneagle</a></h2>
52+
5353
</Space.Left>
5454
<Space.Fill scrollable={true} style={{ padding: 30, paddingTop: 0 }} className="examples">
5555

@@ -78,12 +78,12 @@ const App: React.FC = () => {
7878

7979
<ul>
8080
<li>
81-
<strong>ViewPort</strong> - a top level space. This space will take over the
81+
<strong>&lt;ViewPort /&gt;</strong> a top level space. This space will take over the
8282
full viewport of the browser window. Resizing the browser window will automatically
8383
adjust the size of this space and all the nested spaces.
8484
</li>
8585
<li>
86-
<strong>Fixed</strong> - this space can be given a height and optionally
86+
<strong>&lt;Fixed /&gt;</strong> - this space can be given a height and optionally
8787
a width (by default it will size to 100% of it's container). All nested spaces will be
8888
contained within this fixed size space.
8989
</li>
@@ -97,27 +97,27 @@ const App: React.FC = () => {
9797

9898
<ul>
9999
<li>
100-
<strong>Left</strong> - a space anchored to the left of the parent
100+
<strong>&lt;Left /&gt;</strong> a space anchored to the left of the parent
101101
container/space. A size can be specified in pixels to determine its width.
102102
</li>
103103
<li>
104-
<strong>Right</strong> - a space anchored to the right of the parent
104+
<strong>&lt;Right /&gt;</strong> a space anchored to the right of the parent
105105
container/space. A size can be specified in pixels to determine its width.
106106
</li>
107107
<li>
108-
<strong>Top</strong> - a space anchored to the top of the parent
108+
<strong>&lt;Top /&gt;</strong> a space anchored to the top of the parent
109109
container/space. A size can be specified in pixels to determine its height.
110110
</li>
111111
<li>
112-
<strong>Bottom</strong> - a space anchored to the bottom of the parent
112+
<strong>&lt;Bottom /&gt;</strong> a space anchored to the bottom of the parent
113113
container/space. A size can be specified in pixels to determine its height.
114114
</li>
115115
</ul>
116116
</Tabs.TabPane>
117117
<Tabs.TabPane tab="Other" key="3">
118118
<ul>
119119
<li>
120-
<strong>Fill</strong> - a space which consumes any available area left in the
120+
<strong>&lt;Fill /&gt;</strong> a space which consumes any available area left in the
121121
parent container/space taking into account any anchored spaces on every side.
122122
</li>
123123
</ul>
@@ -146,7 +146,7 @@ const App: React.FC = () => {
146146
</SyntaxHighlighter>
147147

148148
<Space.Fixed height={400}>
149-
<Space.Left size={200} style={{ backgroundColor: '#e0eee0' }}>
149+
<Space.Left size={100} style={{ backgroundColor: '#e0eae0' }}>
150150
{Description("Left")}
151151
</Space.Left>
152152
<Space.Fill style={{ backgroundColor: '#eee0e0' }}>
@@ -392,31 +392,31 @@ const App: React.FC = () => {
392392
{
393393
"const App = () => (\r\n" +
394394
" <Space.Fixed height={400}>\r\n" +
395-
" <Space.LeftResizable size={200} order={1} />\r\n" +
396-
" <Space.LeftResizable size={125} order={2} />\r\n" +
395+
" <Space.LeftResizable size={100} order={1} />\r\n" +
396+
" <Space.LeftResizable size={100} order={2} />\r\n" +
397397
" <Space.Fill />\r\n" +
398-
" <Space.RightResizable size={125} order={2} />\r\n" +
399-
" <Space.RightResizable size={200} order={1} />\r\n" +
398+
" <Space.RightResizable size={100} order={2} />\r\n" +
399+
" <Space.RightResizable size={100} order={1} />\r\n" +
400400
" </Space.Fixed>\r\n" +
401401
")"
402402
}
403403
</SyntaxHighlighter>
404404

405405
<Space.Fixed height={400}>
406-
<Space.LeftResizable trackSize={true} size={200} order={1} style={{ backgroundColor: '#e0eee0' }}>
407-
{Description("Left resizable 1")}
406+
<Space.LeftResizable trackSize={true} size={100} order={1} style={{ backgroundColor: '#e0eee0' }}>
407+
{Description("Left 1")}
408408
</Space.LeftResizable>
409-
<Space.LeftResizable trackSize={true} size={125} order={2} style={{ backgroundColor: '#e0eeee' }}>
410-
{Description("Left resizable 2")}
409+
<Space.LeftResizable trackSize={true} size={100} order={2} style={{ backgroundColor: '#e0eeee' }}>
410+
{Description("Left 2")}
411411
</Space.LeftResizable>
412412
<Space.Fill trackSize={true} style={{ backgroundColor: '#eee0e0' }}>
413413
{Description("Fill")}
414414
</Space.Fill>
415-
<Space.RightResizable trackSize={true} size={125} order={2} style={{ backgroundColor: '#e0eeee' }}>
416-
{Description("Right resizable 2")}
415+
<Space.RightResizable trackSize={true} size={100} order={2} style={{ backgroundColor: '#e0eeee' }}>
416+
{Description("Right 2")}
417417
</Space.RightResizable>
418-
<Space.RightResizable trackSize={true} size={200} order={1} style={{ backgroundColor: '#e0eee0' }}>
419-
{Description("Right resizable 1")}
418+
<Space.RightResizable trackSize={true} size={100} order={1} style={{ backgroundColor: '#e0eee0' }}>
419+
{Description("Right 1")}
420420
</Space.RightResizable>
421421
</Space.Fixed>
422422

demo/yarn.lock

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9087,6 +9087,11 @@ react-error-overlay@^5.1.6:
90879087
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-5.1.6.tgz#0cd73407c5d141f9638ae1e0c63e7b2bf7e9929d"
90889088
integrity sha512-X1Y+0jR47ImDVr54Ab6V9eGk0Hnu7fVWGeHQSOXHf/C2pF9c6uy3gef8QUeuUiWlNb0i08InPSE5a/KJzNzw1Q==
90899089

9090+
react-ga@^2.6.0:
9091+
version "2.6.0"
9092+
resolved "https://registry.yarnpkg.com/react-ga/-/react-ga-2.6.0.tgz#c3fe830ead2ad25117e1d33280d9698de9b28496"
9093+
integrity sha512-GWHBWZDFjDGMkIk1LzroIn0mNTygKw3adXuqvGvheFZvlbpqMPbHsQsTdQBIxRRdXGQM/Zq+dQLRPKbwIHMTaw==
9094+
90909095
react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.4:
90919096
version "16.8.6"
90929097
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16"
@@ -9179,7 +9184,7 @@ react-slick@~0.24.0:
91799184
resize-observer-polyfill "^1.5.0"
91809185

91819186
"react-spaces@file:../react-spaces":
9182-
version "0.1.1"
9187+
version "0.1.2"
91839188
dependencies:
91849189
css-element-queries "^1.2.1"
91859190
guid-typescript "^1.0.9"

0 commit comments

Comments
 (0)