Skip to content

Commit

Permalink
Closes secret-tech#32 Add theme switcher and light theme
Browse files Browse the repository at this point in the history
  • Loading branch information
01dr committed Mar 24, 2018
1 parent 07d8aab commit 77d0362
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/components/wallets/WalletTile/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const WalletTile = (props) => {
</div>
<div className={s.info}>
{/* <h3>{name}</h3> */}
<div className="pt-text-muted">{address}</div>
<div className={s.address}>{address}</div>
</div>
</div>

Expand Down
4 changes: 4 additions & 0 deletions src/components/wallets/WalletTile/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,7 @@
margin: 20px 20px 0;
}
}

.address {
color: #f5f8fa;
}
6 changes: 4 additions & 2 deletions src/containers/app/Nav/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import s from './styles.css';

const Nav = (props) => {
const {
theme,
wallets,
selectedWallet,
selectWallet,
Expand Down Expand Up @@ -45,7 +46,7 @@ const Nav = (props) => {
};

return (
<Navbar className="pt-dark">
<Navbar className={theme}>
<NavbarGroup>
<NavbarHeading>
<Link to="/wallets" className={s.logo}>
Expand Down Expand Up @@ -74,7 +75,8 @@ const Nav = (props) => {
const ConnectedComponent = connect(
(state) => ({
wallets: state.app.user.wallets,
selectedWallet: state.wallet.selectedWallet
selectedWallet: state.wallet.selectedWallet,
...state.app.theme
}),
{
selectWallet,
Expand Down
15 changes: 10 additions & 5 deletions src/containers/app/Nav/styles.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
:global(.pt-dark) .logo > span {
color: #f5f8fa;
margin-left: 10px;
}

:global(.pt-light) .logo > span {
color: #182026;
margin-left: 10px;
}

.logo {
display: flex;
align-items: center;
Expand All @@ -7,11 +17,6 @@
width: 30px;
}

& > span {
color: #fff;
margin-left: 10px;
}

&:hover {
text-decoration: none;
}
Expand Down
6 changes: 4 additions & 2 deletions src/containers/settings/ChangePasswordPopup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import VerifyChangePasswordForm from '../../../components/settings/VerifyChangeP

const ChangePasswordPopup = (props) => {
const {
theme,
step,
fetching,
verification: {
Expand Down Expand Up @@ -42,7 +43,7 @@ const ChangePasswordPopup = (props) => {
<Dialog
style={{ width: '300px', paddingBottom: '0px' }}
title="Change password"
className="pt-dark"
className={theme}
{...props}>

<div className="pt-dialog-body">
Expand All @@ -53,5 +54,6 @@ const ChangePasswordPopup = (props) => {
};

export default connect((state) => ({
...state.settings.changePassword
...state.settings.changePassword,
...state.app.theme
}))(ChangePasswordPopup);
6 changes: 4 additions & 2 deletions src/containers/settings/RegisterCustomTokenPopup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import RegisterTokenForm from '../../../components/settings/RegisterTokenForm';

const RegisterCustomTokenPopup = (props) => {
const {
theme,
step,
fetching,
walletAddress,
Expand Down Expand Up @@ -49,7 +50,7 @@ const RegisterCustomTokenPopup = (props) => {
<Dialog
style={{ width: '300px', paddingBottom: '0px' }}
title="Register custom token"
className="pt-dark"
className={theme}
{...props}>

<div className="pt-dialog-body">
Expand All @@ -62,5 +63,6 @@ const RegisterCustomTokenPopup = (props) => {
export default connect((state) => ({
...state.settings.registerCustomToken,
walletAddress: state.wallet.selectedWallet,
wallets: state.app.user.wallets
wallets: state.app.user.wallets,
...state.app.theme
}))(RegisterCustomTokenPopup);
6 changes: 4 additions & 2 deletions src/containers/wallet/DepositFunds/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import s from './styles.css';

const DepositFunds = (props) => {
const {
theme,
closeDepositFundsPopup,
popupIsOpen
} = props;
Expand All @@ -17,7 +18,7 @@ const DepositFunds = (props) => {
<Dialog
style={{ width: '700px', paddingBottom: '0px' }}
title="Deposit funds"
className="pt-dark"
className={theme}
onClose={closeDepositFundsPopup}
isOpen={popupIsOpen}>

Expand All @@ -33,7 +34,8 @@ const DepositFunds = (props) => {
const ComponentWithRouter = withRouter(DepositFunds);
const ConnectedComponent = connect(
(state) => ({
...state.wallet.depositFunds
...state.wallet.depositFunds,
...state.app.theme
}),
{
closeDepositFundsPopup
Expand Down
4 changes: 3 additions & 1 deletion src/containers/wallet/TransferFunds/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import VerifyTransferFundsForm from '../../../components/wallet/VerifyTransferFu

const TransferFunds = (props) => {
const {
theme,
closeTransferFundsPopup,
popupIsOpen,
step,
Expand Down Expand Up @@ -71,7 +72,7 @@ const TransferFunds = (props) => {
<Dialog
style={{ width: '320px', paddingBottom: '0px' }}
title="Transfer funds"
className="pt-dark"
className={theme}
onClose={closeTransferFundsPopup}
isOpen={popupIsOpen}>

Expand All @@ -86,6 +87,7 @@ const ComponentWithRouter = withRouter(TransferFunds);
const ConnectedComponent = connect(
(state) => ({
...state.wallet.transferFunds,
...state.app.theme,
wallets: state.app.user.wallets,
selectedWallet: state.wallet.selectedWallet
}),
Expand Down
4 changes: 2 additions & 2 deletions src/containers/wallets/CreateWalletPopup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const CreateWalletPopup = (props) => (
<Dialog
style={{ width: '400px', paddingBottom: '0px' }}
title="Create wallet"
className="pt-dark"
{...props}>

<div className="pt-dialog-body">
Expand All @@ -22,5 +21,6 @@ const CreateWalletPopup = (props) => (
);

export default connect((state) => ({
fetching: state.wallets.createWallet.fetching
fetching: state.wallets.createWallet.fetching,
...state.app.theme
}))(CreateWalletPopup);
1 change: 0 additions & 1 deletion src/containers/wallets/EditWalletPopup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Dialog, Button, Intent } from '@blueprintjs/core';
const EditWalletPopup = (props) => (
<Dialog
title="Edit wallet"
className="pt-dark"
{...props}>

<div className="pt-dialog-body">
Expand Down
1 change: 0 additions & 1 deletion src/containers/wallets/ExportWalletPopup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const ExportWalletPopup = (props) => (
<Dialog
style={{ width: '800px' }}
title="Export wallet"
className="pt-dark"
{...props}>

<div className="pt-dialog-body">
Expand Down
1 change: 0 additions & 1 deletion src/containers/wallets/ImportWalletPopup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Dialog, Button, Intent } from '@blueprintjs/core';
const ImportWalletPopup = (props) => (
<Dialog
title="Import wallet"
className="pt-dark"
{...props}>

<div className="pt-dialog-body">
Expand Down
11 changes: 10 additions & 1 deletion src/containers/wallets/WalletsPopups/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import EditWalletPopup from '../EditWalletPopup';

const WalletsPopups = (props) => {
const {
theme,

closeCreateWalletPopup,
createWallet,

Expand All @@ -29,27 +31,34 @@ const WalletsPopups = (props) => {
return [
<CreateWalletPopup
key="create-wallet-popup"
className={theme}
isOpen={createWallet.popupIsOpen}
onClose={() => closeCreateWalletPopup()}/>,
<ImportWalletPopup
key="import-wallet-popup"
className={theme}
isOpen={importWallet.popupIsOpen}
onClose={() => closeImportWalletPopup()}/>,
<ExportWalletPopup
key="export-wallet-popup"
className={theme}
isOpen={exportWallet.popupIsOpen}
onClose={() => closeExportWalletPopup()}
walletAddress={exportWallet.walletAddress}/>,
<EditWalletPopup
key="edit-wallet-popup"
className={theme}
isOpen={editWallet.popupIsOpen}
onClose={() => closeEditWalletPopup()}
walletAddress={editWallet.walletAddress}/>,
];
};

const ConnectedComponent = connect(
(state) => ({ ...state.wallets }),
(state) => ({
...state.wallets,
...state.app.theme
}),
{
closeCreateWalletPopup,
closeImportWalletPopup,
Expand Down

0 comments on commit 77d0362

Please sign in to comment.