1
0
mirror of https://github.com/trambarhq/relaks-wordpress-example.git synced 2025-09-24 22:41:31 +02:00

Fixed text selection.

Made Breadcrumb a PureComponent.
This commit is contained in:
Chung Leong
2019-01-28 22:46:54 +01:00
parent 2e613d61b1
commit 16bbf8070a
2 changed files with 15 additions and 11 deletions

View File

@@ -62,7 +62,7 @@ class FrontEnd extends PureComponent {
if (typeof(window) === 'object') {
let Hammer = require('hammerjs');
let hammer = new Hammer(document.body);
let hammer = new Hammer(document.body, { cssProps: { userSelect: 'auto' } });
hammer.on('swipeleft', this.handleSwipeLeft);
hammer.on('swiperight', this.handleSwipeRight);
}

View File

@@ -1,15 +1,19 @@
import React from 'react';
import React, { PureComponent } from 'react';
function Breadcrumb(props) {
let { trail } = props;
let children = []
let key = 0;
for (let item of trail) {
children.push(<a key={key++} href={item.url}>{item.label}</a>);
children.push(' > ');
class Breadcrumb extends PureComponent {
static displayName = 'Breadcrumb';
render() {
let { trail } = this.props;
let children = []
let key = 0;
for (let item of trail) {
children.push(<a key={key++} href={item.url}>{item.label}</a>);
children.push(' > ');
}
children.pop();
return <h4 className="breadcrumb">{children}</h4>;
}
children.pop();
return <h4 className="breadcrumb">{children}</h4>;
}
if (process.env.NODE_ENV !== 'production') {