1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-24 01:08:27 +00:00

Landing folder structure refactored

This commit is contained in:
Vladimir Volek 2018-08-16 12:19:13 +02:00
parent e75c96d84d
commit fbbceedd48
19 changed files with 37 additions and 45 deletions

View File

@ -25,7 +25,8 @@
"reducers": "./src/js/reducers", "reducers": "./src/js/reducers",
"support": "./src/js/support", "support": "./src/js/support",
"utils": "./src/js/utils", "utils": "./src/js/utils",
"services": "./src/js/services" "services": "./src/js/services",
"views": "./src/js/views"
} }
}], }],
"babel-plugin-styled-components" "babel-plugin-styled-components"

View File

@ -11,6 +11,7 @@
"reducers/*": ["./src/js/reducers/*"], "reducers/*": ["./src/js/reducers/*"],
"utils/*": ["./src/js/utils/*"], "utils/*": ["./src/js/utils/*"],
"services/*": ["./src/js/services/*"], "services/*": ["./src/js/services/*"],
"views/*": ["./src/js/views/*"],
} }
} }
} }

View File

@ -8,14 +8,10 @@ import { FONT_SIZE } from 'config/variables';
const Wrapper = styled.div` const Wrapper = styled.div`
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 8px 28px 8px 24px; padding: 8px 28px 8px 24px;
font-size: ${FONT_SIZE.SMALLER}; font-size: ${FONT_SIZE.SMALLER};
color: ${colors.TEXT_SECONDARY}; color: ${colors.TEXT_SECONDARY};
background: ${colors.GRAY_LIGHT}; background: ${colors.GRAY_LIGHT};
border-top: 1px solid ${colors.DIVIDER}; border-top: 1px solid ${colors.DIVIDER};
border-bottom: 1px solid ${colors.DIVIDER}; border-bottom: 1px solid ${colors.DIVIDER};
`; `;

View File

@ -21,7 +21,7 @@ const Wrapper = styled.div`
transition: background-color ${TRANSITION_TIME.BASE}, color ${TRANSITION_TIME.BASE}; transition: background-color ${TRANSITION_TIME.BASE}, color ${TRANSITION_TIME.BASE};
`; `;
const AsideRow = ({ children, column }) => ( const AsideRow = ({ children, column = false }) => (
<Wrapper <Wrapper
column={column} column={column}
>{children} >{children}
@ -32,8 +32,4 @@ AsideRow.propTypes = {
column: PropTypes.bool, column: PropTypes.bool,
}; };
AsideRow.defaultProps = {
column: false,
}
export default AsideRow; export default AsideRow;

View File

@ -3,10 +3,10 @@ import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { NavLink } from 'react-router-dom'; import { NavLink } from 'react-router-dom';
import AsideRow from './AsideRow';
import colors from 'config/colors'; import colors from 'config/colors';
import { FONT_SIZE, BORDER_WIDTH } from 'config/variables'; import { FONT_SIZE, BORDER_WIDTH } from 'config/variables';
import AsideRow from './AsideRow';
const Wrapper = styled.div` const Wrapper = styled.div`
height: 64px; height: 64px;
@ -32,7 +32,9 @@ const Wrapper = styled.div`
`} `}
`; `;
const AsideRowAccount = ({ accountIndex, balance, url, selected }) => ( const AsideRowAccount = ({
accountIndex, balance, url, selected,
}) => (
<NavLink to={url}> <NavLink to={url}>
<Wrapper <Wrapper
to={url} to={url}

View File

@ -4,12 +4,12 @@ import styled from 'styled-components';
import React from 'react'; import React from 'react';
import { NavLink } from 'react-router-dom'; import { NavLink } from 'react-router-dom';
import type { TrezorDevice } from 'flowtype';
import AsideDivider from './AsideDivider'; import AsideDivider from './AsideDivider';
import AsideRowCoinWallet from './AsideRowCoinWallet'; import AsideRowCoinWallet from './AsideRowCoinWallet';
import AsideRowCoinExternal from './AsideRowCoinExternal'; import AsideRowCoinExternal from './AsideRowCoinExternal';
import AsideSection from './AsideSection'; import AsideSection from './AsideSection';
import type { TrezorDevice } from 'flowtype';
import type { Props } from './index'; import type { Props } from './index';
@ -33,7 +33,7 @@ const CoinSelection = (props: Props): React$Element<string> => {
let coinImg = item.network; let coinImg = item.network;
if (item.network === 'ethereum') { if (item.network === 'ethereum') {
coinImg = 'eth'; coinImg = 'eth';
} else if (item.network === 'ethereum-classic' ) { } else if (item.network === 'ethereum-classic') {
coinImg = 'etc'; coinImg = 'etc';
} }
@ -53,8 +53,8 @@ const CoinSelection = (props: Props): React$Element<string> => {
<AsideSection> <AsideSection>
{ walletCoins } { walletCoins }
<AsideDivider <AsideDivider
textLeft={'Other coins'} textLeft="Other coins"
textRight={'(You will be redirected)'} textRight="(You will be redirected)"
/> />
<AsideRowCoinExternal <AsideRowCoinExternal
@ -62,42 +62,42 @@ const CoinSelection = (props: Props): React$Element<string> => {
img: 'btc', img: 'btc',
name: 'Bitcoin', name: 'Bitcoin',
}} }}
url={'https://wallet.trezor.io/#/coin/ltc'} url="https://wallet.trezor.io/#/coin/ltc"
/> />
<AsideRowCoinExternal <AsideRowCoinExternal
coin={{ coin={{
img: 'ltc', img: 'ltc',
name: 'Litecoin', name: 'Litecoin',
}} }}
url={'https://wallet.trezor.io/#/coin/ltc'} url="https://wallet.trezor.io/#/coin/ltc"
/> />
<AsideRowCoinExternal <AsideRowCoinExternal
coin={{ coin={{
img: 'bch', img: 'bch',
name: 'Bitcoin Cash', name: 'Bitcoin Cash',
}} }}
url={'https://wallet.trezor.io/#/coin/bch'} url="https://wallet.trezor.io/#/coin/bch"
/> />
<AsideRowCoinExternal <AsideRowCoinExternal
coin={{ coin={{
img: 'btg', img: 'btg',
name: 'Bitcoin Gold', name: 'Bitcoin Gold',
}} }}
url={'https://wallet.trezor.io/#/coin/btg'} url="https://wallet.trezor.io/#/coin/btg"
/> />
<AsideRowCoinExternal <AsideRowCoinExternal
coin={{ coin={{
img: 'Dash', img: 'Dash',
name: 'Dash', name: 'Dash',
}} }}
url={'https://wallet.trezor.io/#/coin/dash'} url="https://wallet.trezor.io/#/coin/dash"
/> />
<AsideRowCoinExternal <AsideRowCoinExternal
coin={{ coin={{
img: 'zec', img: 'zec',
name: 'Zcash', name: 'Zcash',
}} }}
url={'https://wallet.trezor.io/#/coin/zec'} url="https://wallet.trezor.io/#/coin/zec"
/> />
</AsideSection> </AsideSection>
); );

View File

@ -1,6 +1,5 @@
/* @flow */ /* @flow */
import * as React from 'react'; import * as React from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { Route, withRouter } from 'react-router-dom'; import { Route, withRouter } from 'react-router-dom';
@ -16,7 +15,6 @@ import ModalContainer from '../modal';
import Notifications from '../common/Notification'; import Notifications from '../common/Notification';
import Log from '../common/Log'; import Log from '../common/Log';
type WalletContainerProps = { type WalletContainerProps = {
wallet: $ElementType<State, 'wallet'>, wallet: $ElementType<State, 'wallet'>,
children?: React.Node children?: React.Node

View File

@ -6,11 +6,11 @@ export const FONT_SIZE = {
export const TRANSITION_TIME = { export const TRANSITION_TIME = {
BASE: '0.3s', BASE: '0.3s',
} };
export const ICON_SIZE = { export const ICON_SIZE = {
BASE: '20px', BASE: '20px',
} };
export const BORDER_WIDTH = { export const BORDER_WIDTH = {
SELECTED: '3px', SELECTED: '3px',

View File

@ -4,7 +4,7 @@ import { render } from 'react-dom';
import baseStyles from 'support/BaseStyles'; import baseStyles from 'support/BaseStyles';
import { onBeforeUnload } from 'actions/WalletActions'; import { onBeforeUnload } from 'actions/WalletActions';
import 'styles/index.less'; import 'styles/index.less';
import App from './router'; import App from 'views/index';
import store from './store'; import store from './store';
const root: ?HTMLElement = document.getElementById('root'); const root: ?HTMLElement = document.getElementById('root');

View File

View File

@ -1,14 +1,12 @@
/* @flow */ /* @flow */
import React from 'react'; import React from 'react';
import { bindActionCreators } from 'redux'; import { bindActionCreators } from 'redux';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import type { MapStateToProps, MapDispatchToProps } from 'react-redux'; import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
import type { State, Dispatch } from 'flowtype'; import type { State, Dispatch } from 'flowtype';
import LandingPage from './LandingPage'; import LandingPage from './index';
export type StateProps = { export type StateProps = {
localStorage: $ElementType<State, 'localStorage'>, localStorage: $ElementType<State, 'localStorage'>,

View File

@ -2,7 +2,7 @@
import React from 'react'; import React from 'react';
import Loader from '../common/LoaderCircle'; import Loader from 'components/common/LoaderCircle';
export default (props: {}): React$Element<string> => ( export default (props: {}): React$Element<string> => (
<section className="landing"> <section className="landing">

View File

@ -1,17 +1,17 @@
/* @flow */ /* @flow */
import React from 'react'; import React from 'react';
import { H2 } from 'components/common/Heading'; import { H2 } from 'components/common/Heading';
import Preloader from './Preloader'; import Header from 'components/common/Header';
import ConnectDevice from './ConnectDevice'; import Footer from 'components/common/Footer';
import InstallBridge from './InstallBridge'; import Log from 'components/common/Log';
import LocalStorageError from './LocalStorageError'; import Notifications, { Notification } from 'components/common/Notification';
import TrezorConnectError from './TrezorConnectError';
import Header from '../common/Header'; import Preloader from './components/Preloader';
import Footer from '../common/Footer'; import ConnectDevice from './components/ConnectDevice';
import Log from '../common/Log'; import InstallBridge from './components/InstallBridge';
import Notifications, { Notification } from '../common/Notification'; import LocalStorageError from './components/LocalStorageError';
import TrezorConnectError from './components/TrezorConnectError';
import type { Props } from './index'; import type { Props } from './index';

View File

View File

@ -6,7 +6,6 @@ import { ConnectedRouter } from 'react-router-redux';
import ErrorBoundary from 'support/ErrorBoundary'; import ErrorBoundary from 'support/ErrorBoundary';
import LandingPageContainer from 'components/landing';
import WalletContainer from 'components/wallet'; import WalletContainer from 'components/wallet';
import BootloaderContainer from 'components/wallet/pages/Bootloader'; import BootloaderContainer from 'components/wallet/pages/Bootloader';
import InitializeContainer from 'components/wallet/pages/Initialize'; import InitializeContainer from 'components/wallet/pages/Initialize';
@ -20,15 +19,16 @@ import ReceiveContainer from 'components/wallet/account/receive';
import SignVerifyContainer from 'components/wallet/account/sign/SignVerify'; import SignVerifyContainer from 'components/wallet/account/sign/SignVerify';
import DeviceSettingsContainer from 'components/wallet/pages/DeviceSettings'; import DeviceSettingsContainer from 'components/wallet/pages/DeviceSettings';
import WalletSettingsContainer from 'components/wallet/pages/WalletSettings'; import WalletSettingsContainer from 'components/wallet/pages/WalletSettings';
import LandingContainer from 'views/Landing/Container';
import store, { history } from '../store'; import store, { history } from '../store';
const App = () => ( const App = () => (
<Provider store={store}> <Provider store={store}>
<ConnectedRouter history={history}> <ConnectedRouter history={history}>
<Switch> <Switch>
<Route exact path="/" component={LandingPageContainer} /> <Route exact path="/" component={LandingContainer} />
<Route exact path="/bridge" component={LandingPageContainer} /> <Route exact path="/bridge" component={LandingContainer} />
<Route exact path="/import" component={LandingPageContainer} /> <Route exact path="/import" component={LandingContainer} />
<Route> <Route>
<WalletContainer> <WalletContainer>
<ErrorBoundary> <ErrorBoundary>