Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
421 additions
and
64 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import React, { PropTypes } from 'react'; | ||
|
||
import translate from 'core/i18n/translate'; | ||
import CategoryLink from './CategoryLink'; | ||
|
||
import './Categories.scss'; | ||
|
||
|
||
export const CATEGORIES = { | ||
firefox: { | ||
dictionary: { | ||
'general': 'General', | ||
}, | ||
extensions: [ | ||
{ name: 'Alerts & Updates', slug: 'alerts-updates', }, | ||
{ name: 'Appearance', slug: 'appearance', }, | ||
{ name: 'Bookmarks', slug: 'bookmarks', }, | ||
{ name: 'Download Management', slug: 'download-management', }, | ||
{ name: 'Feeds, News & Blogging', slug: 'feeds-news-blogging', }, | ||
{ name: 'Games & Entertainment', slug: 'games-entertainment', }, | ||
], | ||
search: { | ||
'bookmarks': 'Bookmarks', | ||
}, | ||
themes: { | ||
'animals': 'Animals', | ||
} | ||
} | ||
}; | ||
|
||
export class CategoriesBase extends React.Component { | ||
static propTypes = { | ||
i18n: PropTypes.object.isRequired, | ||
} | ||
|
||
render() { | ||
const { application, i18n, lang } = this.props; | ||
|
||
const categoriesHTML = ( | ||
<ul className="Categories-list" ref={(ref) => { this.categories = ref; }}> | ||
{CATEGORIES.firefox.extensions.map((category) => { | ||
return ( | ||
<li className="Categories-listItem"> | ||
<CategoryLink application={application} lang={lang} | ||
{...category} /> | ||
</li> | ||
); | ||
})} | ||
</ul> | ||
); | ||
|
||
return ( | ||
<div className="Categories"> | ||
{categoriesHTML} | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default translate({ withRef: true })(CategoriesBase); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.Categories-list { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
.Categories-listItem { | ||
background: url('../img/icons/arrow.svg') 100% 50% no-repeat; | ||
border-bottom: 2px solid #000; | ||
display: block; | ||
list-style: none; | ||
margin: 0 auto; | ||
padding: 0; | ||
width: 95%; | ||
|
||
a { | ||
color: #000; | ||
display: block; | ||
padding: 1.1em 0 0.9em; | ||
text-decoration: none; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import classNames from 'classnames'; | ||
import React, { PropTypes } from 'react'; | ||
|
||
// import translate from 'core/i18n/translate'; | ||
// import CategoryLink from './CategoryLink'; | ||
import { CATEGORIES } from './Categories'; | ||
|
||
import './CategoryInfo.scss'; | ||
|
||
|
||
export default class CategoryInfo extends React.Component { | ||
static propTypes = { | ||
slug: PropTypes.string.isRequired, | ||
} | ||
|
||
render() { | ||
const { application, i18n, lang, slug, type } = this.props; | ||
|
||
const match = CATEGORIES[application || 'firefox'][type || 'extensions'].filter((category) => { | ||
return category.slug == slug; | ||
}); | ||
|
||
if (!match) { | ||
return null; | ||
} | ||
|
||
const category = match[0]; | ||
|
||
return ( | ||
<div className={classNames('CategoryInfo', category.slug)}> | ||
<h2 className="CategoryInfo-header">{category.name}</h2> | ||
|
||
<p className="CategoryInfo-description"> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tristique nibh eget mi vestibulum, vel pulvinar elit. | ||
</p> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
// export default translate({ withRef: true })(CategoryInfoBase); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@import "~core/css/inc/vars"; | ||
|
||
$padding-icon: 20px; | ||
|
||
.CategoryInfo { | ||
background: $padding-icon 50% no-repeat; | ||
margin: 0 auto; | ||
min-height: 72px; | ||
padding: 0 0 0 ($padding-icon * 6); | ||
|
||
&.alerts-updates { | ||
background-image: url('../img/categories/alerts-updates.svg'); | ||
} | ||
} | ||
|
||
.CategoryInfo-header { | ||
font-size: $font-size-default; | ||
margin: $padding-icon 0 0; | ||
padding: 0; | ||
} | ||
|
||
.CategoryInfo-description { | ||
line-height: 1.2; | ||
font-size: $font-size-s; | ||
margin: 0; | ||
max-width: 275px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React, { PropTypes } from 'react'; | ||
|
||
import { Link } from 'react-router' | ||
|
||
|
||
export class Category extends React.Component { | ||
static propTypes = { | ||
name: PropTypes.string.isRequired, | ||
slug: PropTypes.string.isRequired, | ||
} | ||
|
||
render() { | ||
const { application, lang, name, slug } = this.props; | ||
const type = 'extension'; | ||
|
||
return ( | ||
<Link className="Category-link" | ||
to={`/${lang}/${application}/search/?app=${application}&category=${slug}&type=${type}`}> | ||
{name} | ||
</Link> | ||
); | ||
} | ||
} | ||
|
||
export default Category; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,12 @@ | ||
// Action types. | ||
export const SET_REVIEW = 'SET_REVIEW'; | ||
export const SET_USER_RATING = 'SET_USER_RATING'; | ||
|
||
// Search params that are only added to actions/reducers if set; many of | ||
// these are optional. | ||
export const OPTIONAL_SEARCH_PARAMS = [ | ||
'app', | ||
'addonType', | ||
'category', | ||
'query', | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react'; | ||
import { compose } from 'redux'; | ||
import { asyncConnect } from 'redux-connect'; | ||
import { connect } from 'react-redux'; | ||
|
||
import Categories from 'amo/components/Categories'; | ||
import translate from 'core/i18n/translate'; | ||
|
||
|
||
export default class CategoriesPage extends React.Component { | ||
|
||
render() { | ||
const { application, lang } = this.props.params; | ||
|
||
return ( | ||
<div className="Categories-Page"> | ||
<Categories application={application} lang={lang} /> | ||
</div> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,27 @@ | ||
import React from 'react'; | ||
import React, { PropTypes } from 'react'; | ||
import { Link } from 'react-router'; | ||
|
||
import translate from 'core/i18n/translate'; | ||
|
||
|
||
export class HomeBase extends React.Component { | ||
static props = { | ||
i18n: PropTypes.object.isRequired, | ||
} | ||
|
||
export default class Home extends React.Component { | ||
render() { | ||
const { i18n } = this.props; | ||
const { application, lang } = this.props.params; | ||
|
||
return ( | ||
<div> | ||
<h1>AMO Home Page Hello World</h1> | ||
<Link to={`/${lang}/${application}/categories/`} | ||
ref={(ref) => { this.categoryLink = ref; }}> | ||
{i18n.gettext('Categories')} | ||
</Link> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default translate({ withRef: true })(HomeBase); |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.