2018-10-09 13:36:55 +00:00
|
|
|
/* @flow */
|
|
|
|
|
2018-08-10 14:44:36 +00:00
|
|
|
import styled from 'styled-components';
|
|
|
|
import PropTypes from 'prop-types';
|
2018-02-20 09:30:36 +00:00
|
|
|
import React from 'react';
|
2018-08-24 06:45:00 +00:00
|
|
|
import Link from 'components/Link';
|
2018-08-10 15:18:22 +00:00
|
|
|
import { getYear } from 'date-fns';
|
2018-03-08 16:10:53 +00:00
|
|
|
import { bindActionCreators } from 'redux';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
2018-08-14 12:56:47 +00:00
|
|
|
import colors from 'config/colors';
|
|
|
|
import * as LogActions from 'actions/LogActions';
|
2018-08-10 14:44:36 +00:00
|
|
|
|
|
|
|
const Wrapper = styled.div`
|
|
|
|
width: 100%;
|
|
|
|
font-size: 12px;
|
2018-08-27 14:33:24 +00:00
|
|
|
background: ${colors.LANDING};
|
2018-08-10 14:44:36 +00:00
|
|
|
color: ${colors.TEXT_SECONDARY};
|
|
|
|
padding: 22px 48px;
|
|
|
|
display: flex;
|
2018-09-24 14:40:38 +00:00
|
|
|
border-top: 1px solid ${colors.BACKGROUND};
|
2018-08-10 14:44:36 +00:00
|
|
|
`;
|
|
|
|
|
2018-08-31 11:58:19 +00:00
|
|
|
const StyledLink = styled(Link)`
|
2018-08-14 11:43:45 +00:00
|
|
|
margin: 0 6px;
|
2018-08-10 14:44:36 +00:00
|
|
|
margin-right: 20px;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const Copy = styled.div`
|
|
|
|
margin-right: 20px;
|
|
|
|
`;
|
|
|
|
|
2018-10-09 13:36:55 +00:00
|
|
|
const Footer = ({ opened, toggle }) => (
|
2018-08-10 14:44:36 +00:00
|
|
|
<Wrapper>
|
2018-10-09 13:36:55 +00:00
|
|
|
<Copy title={window.COMMITHASH}>© {getYear(new Date())}</Copy>
|
2018-08-31 20:51:17 +00:00
|
|
|
<StyledLink href="http://satoshilabs.com" target="_blank" rel="noreferrer noopener" isGreen>SatoshiLabs</StyledLink>
|
2018-09-04 15:10:52 +00:00
|
|
|
<StyledLink href="/assets/tos.pdf" target="_blank" rel="noreferrer noopener" isGreen>Terms</StyledLink>
|
2018-10-09 13:36:55 +00:00
|
|
|
<StyledLink onClick={toggle} isGreen>{ opened ? 'Hide Log' : 'Show Log' }</StyledLink>
|
2018-08-10 14:44:36 +00:00
|
|
|
</Wrapper>
|
2018-07-30 10:52:13 +00:00
|
|
|
);
|
|
|
|
|
2018-08-10 14:44:36 +00:00
|
|
|
Footer.propTypes = {
|
2018-10-09 13:36:55 +00:00
|
|
|
opened: PropTypes.bool.isRequired,
|
2018-08-10 14:44:36 +00:00
|
|
|
toggle: PropTypes.func.isRequired,
|
|
|
|
};
|
|
|
|
|
2018-10-09 13:36:55 +00:00
|
|
|
const mapStateToProps = state => ({
|
|
|
|
opened: state.log.opened,
|
|
|
|
});
|
|
|
|
|
2018-08-10 14:44:36 +00:00
|
|
|
const mapDispatchToProps = dispatch => ({
|
|
|
|
toggle: bindActionCreators(LogActions.toggle, dispatch),
|
|
|
|
});
|
2018-02-20 09:30:36 +00:00
|
|
|
|
2018-10-09 13:36:55 +00:00
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(Footer);
|