aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-06-20 08:32:01 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-06-20 08:32:01 +0800
commite5fe6b915e760b38a22a8d314fb62364470160eb (patch)
tree36494a33e55dd02cdfaf9fedea54de5b76a712ef /packages/website
parent51948d7760a81cb10bbcfdc50c19eb1c7cddf37b (diff)
downloaddexon-sol-tools-e5fe6b915e760b38a22a8d314fb62364470160eb.tar.gz
dexon-sol-tools-e5fe6b915e760b38a22a8d314fb62364470160eb.tar.zst
dexon-sol-tools-e5fe6b915e760b38a22a8d314fb62364470160eb.zip
Change Island to use styled-components
Diffstat (limited to 'packages/website')
-rw-r--r--packages/website/ts/components/ui/island.tsx23
1 files changed, 8 insertions, 15 deletions
diff --git a/packages/website/ts/components/ui/island.tsx b/packages/website/ts/components/ui/island.tsx
index de90b664f..b88d5fc1b 100644
--- a/packages/website/ts/components/ui/island.tsx
+++ b/packages/website/ts/components/ui/island.tsx
@@ -1,28 +1,21 @@
import * as React from 'react';
import { colors } from 'ts/style/colors';
+import { styled } from 'ts/style/theme';
export interface IslandProps {
style?: React.CSSProperties;
- children?: React.ReactNode;
className?: string;
Component?: string | React.ComponentClass<any> | React.StatelessComponent<any>;
}
-const defaultStyle: React.CSSProperties = {
- backgroundColor: colors.white,
- borderBottomRightRadius: 10,
- borderBottomLeftRadius: 10,
- borderTopRightRadius: 10,
- borderTopLeftRadius: 10,
- boxShadow: `0px 4px 6px ${colors.walletBoxShadow}`,
- overflow: 'hidden',
-};
+const PlainIsland: React.StatelessComponent<IslandProps> = ({ Component, ...rest }) => <Component {...rest} />;
-export const Island: React.StatelessComponent<IslandProps> = (props: IslandProps) => (
- <props.Component style={{ ...defaultStyle, ...props.style }} className={props.className}>
- {props.children}
- </props.Component>
-);
+export const Island = styled(PlainIsland)`
+ background-color: ${colors.white};
+ border-radius: 10px;
+ box-shadow: 0px 4px 6px ${colors.walletBoxShadow};
+ overflow: hidden;
+`;
Island.defaultProps = {
Component: 'div',