blob: b83fd82c2d6e201d90d731a2f700c5cd9e4567e0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
import { colors } from '@0xproject/react-shared';
import * as _ from 'lodash';
import * as React from 'react';
import { Link } from 'react-router-dom';
import { Container } from 'ts/components/ui/container';
import { Text } from 'ts/components/ui/text';
import { TutorialInfo } from 'ts/types';
export interface TutorialButtonProps {
tutorialInfo: TutorialInfo;
}
export interface TutorialButtonState {
isHovering: boolean;
}
export class TutorialButton extends React.Component<TutorialButtonProps, TutorialButtonState> {
constructor(props: TutorialButtonProps) {
super(props);
this.state = {
isHovering: false,
};
}
public render(): React.ReactNode {
return (
<Link
to={this.props.tutorialInfo.location}
style={{ textDecoration: 'none' }}
onMouseEnter={this._onHover.bind(this)}
onMouseLeave={this._onHoverOff.bind(this)}
>
<div
className="flex relative"
style={{
borderRadius: 4,
border: `1px solid ${this.state.isHovering ? colors.lightLinkBlue : '#dfdfdf'}`,
padding: 20,
marginBottom: 15,
backgroundColor: this.state.isHovering ? '#e7f1fd' : colors.white,
}}
>
<div>
<img src={this.props.tutorialInfo.iconUrl} height={40} />
</div>
<div className="pl2">
<Text Tag="div" fontSize="18" fontColor={colors.lightLinkBlue} fontWeight="bold">
{this.props.tutorialInfo.title}
</Text>
<Text Tag="div" fontColor="#555555" fontSize="16">
{this.props.tutorialInfo.description}
</Text>
</div>
<div className="absolute" style={{ top: 31, right: 31 }}>
<i
className="zmdi zmdi-chevron-right bold"
style={{ fontSize: 26, color: colors.lightLinkBlue }}
/>
</div>
</div>
</Link>
);
}
private _onHover(_event: React.FormEvent<HTMLInputElement>): void {
this.setState({
isHovering: true,
});
}
private _onHoverOff(): void {
this.setState({
isHovering: false,
});
}
}
|