Skip to content

Commit 535c2e8

Browse files
committed
Merge pull request #11 from rdio/react
basic-starter-react tweaks
2 parents 43624a7 + 45c4ea5 commit 535c2e8

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ For each example you use, you'll also need to create an Rdio JS API client ID (n
99
## Basics
1010

1111
* Basic Starter: Best place to start.
12+
* Basic Starter React: If you prefer React to jQuery.
1213
* Simple Player: Simple playback and searching.
1314
* Now Playing: For using the `shared_playstate` permission.
1415
* Following: For using `R.currentUser.trackFollowing()`.

basic-starter-react/README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# Basic Starter - React
22

3-
A simple example app for the new Rdio JavaScript API, built using
4-
[React](http://facebook.github.io/react/).
3+
A simple example app for the new Rdio JavaScript API, built using [React](http://facebook.github.io/react/).
54

6-
http://stuff.dan.cx/rdio/basic-starter-react.html
5+
http://iangilman.com/rdio/basic-starter-react/
76

87
For information on using this example, see https://github.com/rdio/jsapi-examples#rdio-js-api-examples.

basic-starter-react/index.html

+10-8
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<script src="http://fb.me/react-0.11.2.js"></script>
1111
<script src="http://fb.me/JSXTransformer-0.11.2.js"></script>
1212
<!-- Register your app at http://www.rdio.com/developers/create/ and replace client_id below with yours -->
13-
<script src="https://www.rdio.com/api/api.js?client_id=jUUIxfNb_R9Ecx2LGCPQyA"></script>
13+
<script src="https://www.rdio.com/api/api.js?client_id=mQT2BNd0PMxVw8q8skG7Dg"></script>
1414
<script type="text/jsx;harmony=true">
1515
/** @jsx React.DOM */
1616

@@ -20,8 +20,8 @@
2020
loggedIn: R.authenticated(),
2121
name: R.authenticated() ? R.currentUser.get('firstName') : null,
2222
playState: undefined,
23-
topTrack: undefined,
24-
}
23+
topTrack: undefined
24+
};
2525
},
2626

2727
componentDidMount() {
@@ -59,9 +59,9 @@
5959
R.authenticate(nowAuthenticated => {
6060
this.setState({
6161
loggedIn: nowAuthenticated,
62-
name: nowAuthenticated ? R.currentUser.get('firstName') : null,
63-
})
64-
})
62+
name: nowAuthenticated ? R.currentUser.get('firstName') : null
63+
});
64+
});
6565
},
6666

6767
_getTopTrack() {
@@ -95,7 +95,7 @@
9595
loggedIn: React.PropTypes.bool.isRequired,
9696
name: React.PropTypes.string.isRequired,
9797

98-
onLoginClick: React.PropTypes.func.isRequired,
98+
onLoginClick: React.PropTypes.func.isRequired
9999
},
100100

101101
render() {
@@ -173,6 +173,7 @@
173173
</div>
174174
);
175175
},
176+
176177
_getPlayStateText() {
177178
switch (this.props.playState) {
178179
case R.player.PLAYSTATE_PAUSED:
@@ -196,7 +197,8 @@
196197
<SampleApp />,
197198
document.getElementById('container')
198199
);
199-
})
200+
});
201+
200202
</script>
201203
</body>
202204
</html>

0 commit comments

Comments
 (0)