MyCrypto/common/components/Footer/index.tsx

146 lines
4.8 KiB
TypeScript
Raw Normal View History

import logo from 'assets/images/logo-mycrypto.svg';
import {
donationAddressMap,
2017-12-06 23:04:57 +00:00
VERSION,
knowledgeBaseURL,
socialMediaLinks,
productLinks,
affiliateLinks,
partnerLinks
2018-01-20 20:06:28 +00:00
} from 'config';
import React from 'react';
Migrate to Typescript (#224) * Refactor babel/types * Refactor entry point * Refactor actions * Refactor api * Full project refactor -- Broad type fixing sweep * - completely fix merge conflicts - handle various type errors * Add tslint to package.json * Dependency cleanup * Fix module resolution * Work on type definitions for untyped libs * progress commit * Add more definition typing * various type additions * Add unit types * Fix sagaiterator + unit types * various types added * additional type additions * Fix typing on Sagas * remove flowfixmes; swap translate for translateRaw * Get rid of contracts - awaiting Henry's contract PR * Remove contracts from routing * Fix most of actions/reducers * refactor actions directory structure * fix reducer action type imports * Fix most of type errors pre-actions refactor * fix action creator imports in containers * Refactor more * Refactor index of actions * fix action imports; use module level index export * package-lock.json updated * Use action types in props * Type up action creators * Fix most of connect errors * Typefixing progress * More types * Fix run-time errors * Caching improvements for webpack * Remove path resolve from webpack * Update non-breaking packages to latest version * Fix token typing * Remove unused color code * Fix wallet decrypt dispatch * Set redux-form related props/functions to ANY, since we're stripping it out later on * Revert BigNumber.js package changes * Extend window to custom object for Perf * Format Navigation * Typecase keystore errors as any (since we shouldnt touch this) * Push wallet context fix * - find/replace value->payload in swap - properly type swap state properties - extract inline reducer into reducer function * - type local storage retrieved items as generic * - bind all RPCClient methods with fat arrow * - reformat * Change to enums for constants * Change state into any * Fix swap errors * ensure that seconds are passed into state as integers * Fix rest of errors * use parseInt explicitly instead of type coercion * Fix derivation-checker, remove flow command, add tslint command, add tslint-react, tell travis to use tslint instead of flow. * Whoops, remove those tests. * Remove unsupported (yet) config option. * Fix precommit to target ts and tsx files. * Fix some errors, ignore some silly rules. * Revert jest to v19, use ts-jest and make all tests typescript. Fixes all but one. * Get rid of saga tests * Fix tslint errors
2017-09-25 02:06:28 +00:00
import PreFooter from './PreFooter';
import DisclaimerModal from 'components/DisclaimerModal';
import { NewTabLink } from 'components/ui';
2018-02-10 18:56:05 +00:00
import './index.scss';
import { translateRaw } from 'translations';
const SocialMediaLink = ({ link, text }: { link: string; text: string }) => {
return (
2018-02-10 18:56:05 +00:00
<NewTabLink className="SocialMediaLink" key={link} href={link} aria-label={text}>
<i className={`sm-icon sm-logo-${text}`} />
</NewTabLink>
);
};
interface Props {
latestBlock: string;
}
2018-02-10 18:56:05 +00:00
interface State {
isDisclaimerOpen: boolean;
}
export default class Footer extends React.PureComponent<Props, State> {
public state: State = {
isDisclaimerOpen: false
};
Migrate to Typescript (#224) * Refactor babel/types * Refactor entry point * Refactor actions * Refactor api * Full project refactor -- Broad type fixing sweep * - completely fix merge conflicts - handle various type errors * Add tslint to package.json * Dependency cleanup * Fix module resolution * Work on type definitions for untyped libs * progress commit * Add more definition typing * various type additions * Add unit types * Fix sagaiterator + unit types * various types added * additional type additions * Fix typing on Sagas * remove flowfixmes; swap translate for translateRaw * Get rid of contracts - awaiting Henry's contract PR * Remove contracts from routing * Fix most of actions/reducers * refactor actions directory structure * fix reducer action type imports * Fix most of type errors pre-actions refactor * fix action creator imports in containers * Refactor more * Refactor index of actions * fix action imports; use module level index export * package-lock.json updated * Use action types in props * Type up action creators * Fix most of connect errors * Typefixing progress * More types * Fix run-time errors * Caching improvements for webpack * Remove path resolve from webpack * Update non-breaking packages to latest version * Fix token typing * Remove unused color code * Fix wallet decrypt dispatch * Set redux-form related props/functions to ANY, since we're stripping it out later on * Revert BigNumber.js package changes * Extend window to custom object for Perf * Format Navigation * Typecase keystore errors as any (since we shouldnt touch this) * Push wallet context fix * - find/replace value->payload in swap - properly type swap state properties - extract inline reducer into reducer function * - type local storage retrieved items as generic * - bind all RPCClient methods with fat arrow * - reformat * Change to enums for constants * Change state into any * Fix swap errors * ensure that seconds are passed into state as integers * Fix rest of errors * use parseInt explicitly instead of type coercion * Fix derivation-checker, remove flow command, add tslint command, add tslint-react, tell travis to use tslint instead of flow. * Whoops, remove those tests. * Remove unsupported (yet) config option. * Fix precommit to target ts and tsx files. * Fix some errors, ignore some silly rules. * Revert jest to v19, use ts-jest and make all tests typescript. Fixes all but one. * Get rid of saga tests * Fix tslint errors
2017-09-25 02:06:28 +00:00
public render() {
return (
<div>
2018-02-10 18:56:05 +00:00
<PreFooter openModal={this.toggleModal} />
<footer className="Footer" role="contentinfo" aria-label="footer">
2018-02-10 18:56:05 +00:00
<div className="Footer-links Footer-section">
<div className="Footer-links-social">
{socialMediaLinks.map((socialMediaItem, idx) => (
2018-02-10 18:56:05 +00:00
<SocialMediaLink
link={socialMediaItem.link}
key={idx}
text={socialMediaItem.text}
/>
2018-02-10 18:56:05 +00:00
))}
</div>
<div className="Footer-links-links">
{productLinks.map(link => (
<NewTabLink key={link.link} href={link.link}>
{link.text}
2018-02-10 18:56:05 +00:00
</NewTabLink>
))}
<NewTabLink href="mailto:press@mycrypto.com">
{translateRaw('FOOTER_PRESS')}
</NewTabLink>
2018-02-10 18:56:05 +00:00
</div>
</div>
2018-02-10 18:56:05 +00:00
<div className="Footer-about Footer-section">
<NewTabLink className="Footer-about-logo" href="/">
<img
className="Footer-about-logo-img"
src={logo}
height="55px"
width="auto"
alt="MyCrypto logo"
/>
</NewTabLink>
<div className="Footer-about-links">
<NewTabLink href="https://mycrypto.com">MyCrypto.com</NewTabLink>
<NewTabLink href={knowledgeBaseURL}>{translateRaw('FOOTER_SUPPORT')}</NewTabLink>
<NewTabLink href="https://about.mycrypto.com">
{translateRaw('FOOTER_TEAM')}
</NewTabLink>
2018-05-13 19:09:19 +00:00
<NewTabLink href="https://about.mycrypto.com/privacy/">
2018-05-11 04:35:10 +00:00
{translateRaw('FOOTER_PRIVACY_POLICY')}
</NewTabLink>
2018-02-10 18:56:05 +00:00
</div>
<p className="Footer-about-text">{translateRaw('FOOTER_ABOUT')}</p>
2018-02-10 18:56:05 +00:00
<div className="Footer-about-legal">
<div className="Footer-about-legal-text">
© {new Date().getFullYear()} MyCrypto, Inc.
</div>
<div className="Footer-about-legal-text">
<a onClick={this.toggleModal}>{translateRaw('DISCLAIMER')}</a>
2018-02-10 18:56:05 +00:00
</div>
<div className="Footer-about-legal-text">v{VERSION}</div>
</div>
</div>
2018-02-10 18:56:05 +00:00
<div className="Footer-support Footer-section">
<h5 className="Footer-support-title">{translateRaw('FOOTER_AFFILIATE_TITLE')}</h5>
2018-02-10 18:56:05 +00:00
<div className="Footer-support-affiliates">
{affiliateLinks.map((link, i) => (
<NewTabLink key={i} href={link.link}>
2018-02-10 18:56:05 +00:00
{link.text}
</NewTabLink>
))}
</div>
2018-02-10 18:56:05 +00:00
<div className="Footer-support-donate">
<div className="Footer-support-donate-currency">
{translateRaw('DONATE_CURRENCY', { $currency: 'ETH' })}
</div>
2018-02-10 18:56:05 +00:00
<div className="Footer-support-donate-address">{donationAddressMap.ETH}</div>
</div>
2018-02-10 18:56:05 +00:00
<div className="Footer-support-donate">
<div className="Footer-support-donate-currency">
{translateRaw('DONATE_CURRENCY', { $currency: 'BTC' })}
</div>
2018-02-10 18:56:05 +00:00
<div className="Footer-support-donate-address">{donationAddressMap.BTC}</div>
</div>
<div className="Footer-support-friends">
{partnerLinks.map((link, i) => (
<NewTabLink key={i} href={link.link}>
2018-02-10 18:56:05 +00:00
{link.text}
</NewTabLink>
))}
</div>
</div>
</footer>
2018-02-10 18:56:05 +00:00
<DisclaimerModal isOpen={this.state.isDisclaimerOpen} handleClose={this.toggleModal} />
</div>
);
}
2018-02-10 18:56:05 +00:00
private toggleModal = () => {
this.setState(state => {
this.setState({ isDisclaimerOpen: !state.isDisclaimerOpen });
});
};
2017-04-12 05:04:27 +00:00
}