Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
"dependencies": {
"better-npm-run": "0.0.8",
"camelcase": "2.1.1",
"classnames": "2.2.5",
"common-tags": "0.0.3",
"config": "1.20.1",
"express": "4.13.4",
Expand Down
8 changes: 6 additions & 2 deletions src/disco/components/Addon.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import classNames from 'classnames';

import InstallButton from './InstallButton';

Expand Down Expand Up @@ -37,9 +38,12 @@ export default class Addon extends React.Component {
}

render() {
const { heading, subHeading } = this.props;
const { heading, subHeading, type } = this.props;
const addonClasses = classNames('addon', {
theme: type === 'Theme',
});
return (
<div className="addon">
<div className={addonClasses}>
{this.getThemeImage()}
<div className="content">
{this.getLogo()}
Expand Down
16 changes: 15 additions & 1 deletion src/disco/containers/DiscoPane.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { PropTypes } from 'react';
import { connect } from 'react-redux';
import { asyncConnect } from 'redux-async-connect';
import { camelCaseProps } from 'core/utils';
import { gettext as _, camelCaseProps } from 'core/utils';

import Addon from 'disco/components/Addon';
import fakeData from 'disco/fakeData';
Expand All @@ -20,6 +20,20 @@ class DiscoPane extends React.Component {
const { results } = this.props;
return (
<div id="app-view" ref="container">
<header>
<div className="content">
<h1>{_('Personalize Your Firefox')}</h1>
<p>{_(`There are thousands of add-ons that let you make Firefox all your
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These new lines seem slightly concerning of translating. changing the indent could result in the string changing but maybe that isn't worth worrying about until we pick an extraction library.

Copy link
Contributor Author

@muffinresearch muffinresearch May 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking of stripping the leading indentation but then I'm not sure if extraction will see that. I think it best to cross that bridge when we do the extraction.

own—everything from fun visual themes to powerful tools and features.
Here are a few great ones to check out.`)}</p>
</div>
<a href="#" className="play-video">
<p>
<span>{_('Click to play')}</span>
<span className="visually-hidden">{_('to find out more about add-ons')}</span>
</p>
</a>
</header>
{results.map((item, i) => <Addon {...camelCaseProps(item)} key={i} />)}
</div>
);
Expand Down
31 changes: 21 additions & 10 deletions src/disco/css/Addon.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,36 @@ $secondary-text-color: #6a6a6a;
overflow: hidden;

.theme-image {
display: block;
width: 100%;
}

.install-button {
margin: 0 20px 0 30px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need an RTL override as well but I can't think of a way of doing this in flex. I'm not crazy about the padding on this block, nothing is consistent.

+-------------------------------------------------------+
|                       | 30px  |                       |
| 15px | <img /> | 35px | <p /> | 50px | <btn /> | 20px |
|                       | 30px  |                       |
+-------------------------------------------------------+

}

.content {
align-items: center;
display: flex;
flex-direction: row;
line-height: 1.5;
padding: 20px;

.logo {
height: 64px;
width: 64px;
align-items: center;
align-self: stretch;
background: #fcfcfc;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This background isn't covering the full height of the block. I think the parent needs to align-items: stretch and then the logo and button wrappers will display: flex; align-items: center.

.content {
  align-items: stretch;

  // Maybe even `.content > *` instead.
  .install-button,
  .logo {
    display: flex;
    align-items: center;
  }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good catch - the terrible contrast makes this background almost invisible to me. Using align-self: stretch on .logo and resetting the centering for just the img was a succinct solution.

display: flex;
padding: 0 15px;

img {
display: block;
height: 64px;
width: 64px;
}
}

.copy {
padding: 0 20px;
padding: 30px 20px;
flex-grow: 1;

.heading {
Expand All @@ -46,16 +59,14 @@ $secondary-text-color: #6a6a6a;
margin: 0.5em 0;
}

// Remove the left-padding if the copy block
// is the first-child of its parent (e.g. a theme)
&:first-child {
padding-left: 0;
}

// Remove the bottom margin of the last element.
& :last-child {
margin-bottom: 0;
}
}
}

&.theme .content .copy {
padding: 20px;
}
}
55 changes: 53 additions & 2 deletions src/disco/css/App.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import "~normalize.css";
@import "~core/css/inc/lib";

$page-background: #d4d4d4;
$page-background: #f5f5f5;

html,
body {
Expand All @@ -10,6 +10,7 @@ body {
"Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans",
"Droid Sans", "Helvetica Neue", sans-serif;
font-size: 14px;
}

* {
Expand All @@ -21,7 +22,57 @@ img {
}

.disco-pane {
padding: 50px;
box-sizing: content-box;
padding: 50px 20px;
margin: 0 auto;
max-width: 680px;
}

header {
display: flex;
border-bottom: 2px solid #ddd;
flex-direction: row;
margin-bottom: 40px;
padding-bottom: 40px;

.content {
flex-grow: 1;
}

h1 {
display: block;
letter-spacing: 0.11ex;
line-height: 1.5;
font-size: 22px;
font-weight: 400;
margin: 0 0 20px;
}

p:last-child {
display: block;
margin-bottom: 0;
}

.play-video {
background: #ccc;
border-radius: 5px;
display: block;
flex-grow: 0;
margin-left: 50px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to need an alternate rule for RTL. If you express this in flex it will work though. The spec defines a bunch of specific values for these sizes so I think it would be nice to set those in variables and then let flex lay it out correctly.

$blockWidth: 680px;

header {
  $videoWidth: 215px;
  $videoHeight: 120px;
  $spaceBetween: 50px;

  display: flex;
  justify-content: space-between;
  width: $blockWidth;

  .content {
    width: $blockWidth - $videoWidth - $spaceBetween;
  }

  .play-video {
    display: block;
    height: $videoHeight;
    width: $videoWidth;
  }
}

min-height: 120px;
min-width: 215px;

&:hover {
color: #fff;
background: #666;
}

p {
align-items: center;
display: flex;
height: 100%;
justify-content: center;
margin-top: 0;
}
}
}