aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/wallet/standard_icon_row.tsx
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-06-29 15:59:24 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-06-29 15:59:24 +0800
commitaedd51a61bcc9ecef660c1bea1641c0400f3ac45 (patch)
tree20177ccc8b1d933d543ea2cc5ce51e291f492d40 /packages/website/ts/components/wallet/standard_icon_row.tsx
parent0b5a49c17dde87130a659e4101bd6e2f5666b9c7 (diff)
downloaddexon-sol-tools-aedd51a61bcc9ecef660c1bea1641c0400f3ac45.tar.gz
dexon-sol-tools-aedd51a61bcc9ecef660c1bea1641c0400f3ac45.tar.zst
dexon-sol-tools-aedd51a61bcc9ecef660c1bea1641c0400f3ac45.zip
Refactor inline styles out of Wallet
Diffstat (limited to 'packages/website/ts/components/wallet/standard_icon_row.tsx')
-rw-r--r--packages/website/ts/components/wallet/standard_icon_row.tsx44
1 files changed, 44 insertions, 0 deletions
diff --git a/packages/website/ts/components/wallet/standard_icon_row.tsx b/packages/website/ts/components/wallet/standard_icon_row.tsx
new file mode 100644
index 000000000..1a2ec021b
--- /dev/null
+++ b/packages/website/ts/components/wallet/standard_icon_row.tsx
@@ -0,0 +1,44 @@
+import * as React from 'react';
+
+import { colors } from 'ts/style/colors';
+import { styled } from 'ts/style/theme';
+
+export interface StandardIconRowProps {
+ className?: string;
+ icon: React.ReactNode;
+ main: React.ReactNode;
+ accessory?: React.ReactNode;
+ minHeight?: string;
+ borderBottomColor?: string;
+ borderBottomStyle?: string;
+ borderWidth?: string;
+ backgroundColor?: string;
+}
+const PlainStandardIconRow: React.StatelessComponent<StandardIconRowProps> = ({ className, icon, main, accessory }) => {
+ return (
+ <div className={`flex items-center ${className}`}>
+ <div className="flex items-center px2">{icon}</div>
+ <div className="flex-none pr2">{main}</div>
+ <div className="flex-auto" />
+ <div>{accessory}</div>
+ </div>
+ );
+};
+
+export const StandardIconRow = styled(PlainStandardIconRow)`
+ min-height: ${props => props.minHeight};
+ border-bottom-color: ${props => props.borderBottomColor};
+ border-bottom-style: ${props => props.borderBottomStyle};
+ border-width: ${props => props.borderWidth};
+ background-color: ${props => props.backgroundColor};
+`;
+
+StandardIconRow.defaultProps = {
+ minHeight: '85px',
+ borderBottomColor: colors.walletBorder,
+ borderBottomStyle: 'solid',
+ borderWidth: '1px',
+ backgroundColor: colors.walletDefaultItemBackground,
+};
+
+StandardIconRow.displayName = 'StandardIconRow';