aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Carlsen <fred@sjelfull.no>2018-12-06 20:19:24 +0800
committerFred Carlsen <fred@sjelfull.no>2018-12-06 20:19:24 +0800
commit950c56d7b863e0cd8d85149797cf481213e8564d (patch)
treeb56d0afe8c8a33fad2dc06ed9781472e6e85df79
parent4b166828b89fe25be8aa8a004330b388df7e21df (diff)
downloaddexon-sol-tools-950c56d7b863e0cd8d85149797cf481213e8564d.tar
dexon-sol-tools-950c56d7b863e0cd8d85149797cf481213e8564d.tar.gz
dexon-sol-tools-950c56d7b863e0cd8d85149797cf481213e8564d.tar.bz2
dexon-sol-tools-950c56d7b863e0cd8d85149797cf481213e8564d.tar.lz
dexon-sol-tools-950c56d7b863e0cd8d85149797cf481213e8564d.tar.xz
dexon-sol-tools-950c56d7b863e0cd8d85149797cf481213e8564d.tar.zst
dexon-sol-tools-950c56d7b863e0cd8d85149797cf481213e8564d.zip
Migrate away from injectGlobal
-rw-r--r--packages/website/ts/pages/instant/fee_percentage_slider.tsx53
1 files changed, 27 insertions, 26 deletions
diff --git a/packages/website/ts/pages/instant/fee_percentage_slider.tsx b/packages/website/ts/pages/instant/fee_percentage_slider.tsx
index 4c92883cb..3fc6b381d 100644
--- a/packages/website/ts/pages/instant/fee_percentage_slider.tsx
+++ b/packages/website/ts/pages/instant/fee_percentage_slider.tsx
@@ -1,37 +1,13 @@
import Slider from 'rc-slider';
import 'rc-slider/assets/index.css';
import * as React from 'react';
+import styled from 'styled-components';
import { Text } from 'ts/components/ui/text';
import { colors } from 'ts/style/colors';
-import { injectGlobal } from 'ts/style/theme';
const SliderWithTooltip = (Slider as any).createSliderWithTooltip(Slider);
// tslint:disable-next-line:no-unused-expression
-injectGlobal`
- .rc-slider-tooltip-inner {
- box-shadow: none !important;
- background-color: ${colors.white} !important;
- border-radius: 4px !important;
- padding: 3px 12px !important;
- height: auto !important;
- position: relative;
- top: 7px;
- &: after {
- border: solid transparent;
- content: " ";
- height: 0;
- width: 0;
- position: absolute;
- pointer-events: none;
- border-width: 6px;
- bottom: 100%;
- left: 100%;
- border-bottom-color: ${colors.white};
- margin-left: -60%;
- }
- }
-`;
export interface FeePercentageSliderProps {
value: number;
@@ -41,7 +17,7 @@ export interface FeePercentageSliderProps {
export class FeePercentageSlider extends React.Component<FeePercentageSliderProps> {
public render(): React.ReactNode {
return (
- <SliderWithTooltip
+ <StyledSlider
min={0}
max={0.05}
step={0.0025}
@@ -70,3 +46,28 @@ export class FeePercentageSlider extends React.Component<FeePercentageSliderProp
return <Text fontColor={colors.black} fontSize="14px" fontWeight={700}>{`${(value * 100).toFixed(2)}%`}</Text>;
};
}
+
+const StyledSlider = styled(SliderWithTooltip)`
+ .rc-slider-tooltip-inner {
+ box-shadow: none !important;
+ background-color: ${colors.white} !important;
+ border-radius: 4px !important;
+ padding: 3px 12px !important;
+ height: auto !important;
+ position: relative;
+ top: 7px;
+ &:after {
+ border: solid transparent;
+ content: " ";
+ height: 0;
+ width: 0;
+ position: absolute;
+ pointer-events: none;
+ border-width: 6px;
+ bottom: 100%;
+ left: 100%;
+ border-bottom-color: ${colors.white};
+ margin-left: -60%;
+ }
+ }
+`;