scratch-www/src/components/ttt-tile/ttt-tile.jsx

69 lines
2.2 KiB
React
Raw Normal View History

const classNames = require('classnames');
const FormattedMessage = require('react-intl').FormattedMessage;
const PropTypes = require('prop-types');
const React = require('react');
2016-11-07 15:07:07 -05:00
require('../forms/button.scss');
2016-11-07 15:07:07 -05:00
require('./ttt-tile.scss');
const TTTTile = props => (
<div className={classNames('ttt-tile', props.className)}>
<a href={props.tutorialLoc}>
<div className="ttt-tile-tutorial">
<div className="ttt-tile-image">
<img
alt=""
className="ttt-tile-image-img"
src={props.thumbUrl}
/>
<div className="ttt-tile-image-try">
<div className="button mod-ttt-try-button">
<FormattedMessage id="tile.tryIt" />
2018-01-30 09:54:45 -05:00
</div>
</div>
</div>
<div className="ttt-tile-info">
2018-01-19 14:06:26 -05:00
<div className="ttt-tile-tag">
<FormattedMessage
defaultMessage="Tutorial"
id="ttt.tutorial"
/>
2018-01-30 09:54:45 -05:00
</div>
<h4 className="ttt-tile-title">{props.title}</h4>
<p className="ttt-tile-description">
{props.description}
</p>
</div>
2018-01-19 14:06:26 -05:00
</div>
</a>
{props.onGuideClick && (
<div
className="ttt-tile-guides"
onClick={props.onGuideClick}
>
<FormattedMessage
defaultMessage="See Cards and Guides"
id="tile.guides"
/>
<img
className="ttt-tile-open-modal"
src="/svgs/modal/open-blue.svg"
/>
</div>
)}
</div>
);
TTTTile.propTypes = {
className: PropTypes.string,
description: PropTypes.string,
onGuideClick: PropTypes.func,
thumbUrl: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
tutorialLoc: PropTypes.string.isRequired
};
2016-11-07 15:07:07 -05:00
module.exports = TTTTile;