MyCrypto/common/components/OfflineAwareUnlockHeader.tsx
William O'Beirne 371e6e327c Wallet Decrypt Redesign (#677)
* Reorganize files to better match other components.

* Initial UI for wallet buttons.

* Fix leftover rebase conflict.

* Wallet selection, styling, mobile handling.

* Initial work on animations.

* Adjusted animations.

* Adjust wallet unlock forms to be more uniform. Fix view address saying 'unlock'

* Adjust tooltips.

* Fix embedded decrypt components.

* Cover whole sign msg form with decrypt.

* Give deploy contract a better unlock treatment like sign msg.

* Reset decrypt component on hide / show

* Unused var

* Fix tooltip hover.

* Fix hover lift.

* Make spacing better on mobile.

* Back button mobile handling.

* Redesign mobile button icons. Prevent clicking through when clicking on icons.

* TSCheck fixes.

* Attempt to unlock MetaMask onClick, and provide existing flow with notification when unlock fails.

* Get rid of outline.

* Remove decrypt min height. Make view only textarea.

* Add change wallet buttons to deploy contract and sign msg.

* Standardize
2018-01-01 13:46:28 -06:00

37 lines
971 B
TypeScript

import { UnlockHeader } from 'components/ui';
import React, { Component } from 'react';
import translate from 'translations';
import { isAnyOffline } from 'selectors/config';
import { connect } from 'react-redux';
import { AppState } from 'reducers';
interface Props {
disabledWallets?: string[];
}
export const OfflineAwareUnlockHeader: React.SFC<Props> = ({ disabledWallets }) => (
<UnlockHeader title={<Title />} disabledWallets={disabledWallets} />
);
interface StateProps {
shouldDisplayOffline: boolean;
}
class TitleClass extends Component<StateProps> {
public render() {
const { shouldDisplayOffline } = this.props;
const offlineTitle = shouldDisplayOffline ? (
<span style={{ color: 'red' }}> (Offline)</span>
) : null;
return (
<div>
{translate('Account')}
{offlineTitle}
</div>
);
}
}
const Title = connect((state: AppState) => ({
shouldDisplayOffline: isAnyOffline(state)
}))(TitleClass);