Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image alternates now embedded in their fonts #477

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
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
11 changes: 0 additions & 11 deletions app/images/alt-R.svg

This file was deleted.

10 changes: 0 additions & 10 deletions app/images/ball-c.svg

This file was deleted.

10 changes: 0 additions & 10 deletions app/images/classic-R.svg

This file was deleted.

14 changes: 0 additions & 14 deletions app/images/double-story-a.svg

This file was deleted.

10 changes: 0 additions & 10 deletions app/images/full-serifs-i.svg

This file was deleted.

9 changes: 0 additions & 9 deletions app/images/serif-less-c.svg

This file was deleted.

12 changes: 0 additions & 12 deletions app/images/single-story-a.svg

This file was deleted.

8 changes: 0 additions & 8 deletions app/images/top-serif-i.svg

This file was deleted.

20 changes: 7 additions & 13 deletions app/scripts/components/alternate-menu.components.jsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
import React from 'react';
import PureRenderMixin from 'react-addons-pure-render-mixin';

import LocalClient from '../stores/local-client.stores.jsx';

export default class AlternateMenu extends React.Component {
constructor(props) {
super(props);
this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
}

export default class AlternateMenu extends React.PureComponent {
render() {

const alternates = _.map(this.props.alternates, (alt, index) => {
const alternates = this.props.alternates.map((alt, index) => {
return <Alternate id={index} alt={alt} key={index} unicode={this.props.unicode}/>;
});

Expand All @@ -26,10 +19,11 @@ export default class AlternateMenu extends React.Component {
}
}

class Alternate extends React.Component {
class Alternate extends React.PureComponent {
constructor(props) {
super(props);
this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);

this.selectAlternate = this.selectAlternate.bind(this);
}

componentWillMount() {
Expand All @@ -42,8 +36,8 @@ class Alternate extends React.Component {

render() {
return (
<div className="alternate" onClick={() => {this.selectAlternate();}}>
<img src={`assets/images/${this.props.alt.altImg}`}/>
<div className="alternate" onClick={this.selectAlternate}>
<img src={this.props.alt.altImg} />
</div>
);
}
Expand Down