Skip to content

Commit

Permalink
Replace link with embedded image alternates
Browse files Browse the repository at this point in the history
  • Loading branch information
YoruNoHikage committed Nov 3, 2016
1 parent 079bdf3 commit b095ed9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 34 deletions.
11 changes: 0 additions & 11 deletions app/images/alt-R.svg

This file was deleted.

10 changes: 0 additions & 10 deletions app/images/classic-R.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

0 comments on commit b095ed9

Please sign in to comment.