mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-23 23:57:55 -05:00
Fixup api refactor
Updates after a rebase
This commit is contained in:
parent
8da8ab4100
commit
dffea48299
2 changed files with 4 additions and 10 deletions
|
@ -3,7 +3,7 @@ var FormattedMessage = require('react-intl').FormattedMessage;
|
||||||
var React = require('react');
|
var React = require('react');
|
||||||
var render = require('../../lib/render.jsx');
|
var render = require('../../lib/render.jsx');
|
||||||
|
|
||||||
var Api = require('../../mixins/api.jsx');
|
var api = require('../../lib/api');
|
||||||
|
|
||||||
var Page = require('../../components/page/www/page.jsx');
|
var Page = require('../../components/page/www/page.jsx');
|
||||||
var Box = require('../../components/box/box.jsx');
|
var Box = require('../../components/box/box.jsx');
|
||||||
|
@ -16,9 +16,6 @@ require('./explore.scss');
|
||||||
// @todo migrate to React-Router once available
|
// @todo migrate to React-Router once available
|
||||||
var Explore = injectIntl(React.createClass({
|
var Explore = injectIntl(React.createClass({
|
||||||
type: 'Explore',
|
type: 'Explore',
|
||||||
mixins: [
|
|
||||||
Api
|
|
||||||
],
|
|
||||||
getDefaultProps: function () {
|
getDefaultProps: function () {
|
||||||
var categoryOptions = ['all','animations','art','games','music','stories'];
|
var categoryOptions = ['all','animations','art','games','music','stories'];
|
||||||
var typeOptions = ['projects','studios'];
|
var typeOptions = ['projects','studios'];
|
||||||
|
@ -57,7 +54,7 @@ var Explore = injectIntl(React.createClass({
|
||||||
if (this.props.tab != 'all') {
|
if (this.props.tab != 'all') {
|
||||||
qText = '&q=' + this.props.category;
|
qText = '&q=' + this.props.category;
|
||||||
}
|
}
|
||||||
this.api({
|
api({
|
||||||
uri: '/search/' + this.props.itemType +
|
uri: '/search/' + this.props.itemType +
|
||||||
'?limit=' + this.props.loadNumber +
|
'?limit=' + this.props.loadNumber +
|
||||||
'&offset=' + this.state.offset +
|
'&offset=' + this.state.offset +
|
||||||
|
|
|
@ -3,7 +3,7 @@ var FormattedMessage = require('react-intl').FormattedMessage;
|
||||||
var React = require('react');
|
var React = require('react');
|
||||||
var render = require('../../lib/render.jsx');
|
var render = require('../../lib/render.jsx');
|
||||||
|
|
||||||
var Api = require('../../mixins/api.jsx');
|
var api = require('../../lib/api');
|
||||||
|
|
||||||
var Page = require('../../components/page/www/page.jsx');
|
var Page = require('../../components/page/www/page.jsx');
|
||||||
var Box = require('../../components/box/box.jsx');
|
var Box = require('../../components/box/box.jsx');
|
||||||
|
@ -16,9 +16,6 @@ require('./search.scss');
|
||||||
// @todo migrate to React-Router once available
|
// @todo migrate to React-Router once available
|
||||||
var Search = injectIntl(React.createClass({
|
var Search = injectIntl(React.createClass({
|
||||||
type: 'Search',
|
type: 'Search',
|
||||||
mixins: [
|
|
||||||
Api
|
|
||||||
],
|
|
||||||
getDefaultProps: function () {
|
getDefaultProps: function () {
|
||||||
var query = window.location.search;
|
var query = window.location.search;
|
||||||
var pathname = window.location.pathname.toLowerCase();
|
var pathname = window.location.pathname.toLowerCase();
|
||||||
|
@ -60,7 +57,7 @@ var Search = injectIntl(React.createClass({
|
||||||
if (this.props.searchTerm !== '') {
|
if (this.props.searchTerm !== '') {
|
||||||
termText = '&q=' + this.props.searchTerm;
|
termText = '&q=' + this.props.searchTerm;
|
||||||
}
|
}
|
||||||
this.api({
|
api({
|
||||||
uri: '/search/' + this.props.tab +
|
uri: '/search/' + this.props.tab +
|
||||||
'?limit=' + this.props.loadNumber +
|
'?limit=' + this.props.loadNumber +
|
||||||
'&offset=' + this.state.offset +
|
'&offset=' + this.state.offset +
|
||||||
|
|
Loading…
Reference in a new issue