1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-10-31 21:18:54 +00:00
trezor-wallet/src/components/Footer/index.js

56 lines
1.5 KiB
JavaScript
Raw Normal View History

2018-10-09 13:36:55 +00:00
/* @flow */
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';
const Wrapper = styled.div`
width: 100%;
font-size: 12px;
2018-08-27 14:33:24 +00:00
background: ${colors.LANDING};
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-31 11:58:19 +00:00
const StyledLink = styled(Link)`
2018-08-14 11:43:45 +00:00
margin: 0 6px;
margin-right: 20px;
`;
const Copy = styled.div`
margin-right: 20px;
`;
2018-10-09 13:36:55 +00:00
const Footer = ({ opened, toggle }) => (
<Wrapper>
2018-10-09 13:36:55 +00:00
<Copy title={window.COMMITHASH}>&copy; {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>
<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>
</Wrapper>
2018-07-30 10:52:13 +00:00
);
Footer.propTypes = {
2018-10-09 13:36:55 +00:00
opened: PropTypes.bool.isRequired,
toggle: PropTypes.func.isRequired,
};
2018-10-09 13:36:55 +00:00
const mapStateToProps = state => ({
opened: state.log.opened,
});
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);