From 548ed4f5959ac13d4a4db9e7f4fe4b165d6d26aa Mon Sep 17 00:00:00 2001 From: jashan <20891087+jashanbhullar@users.noreply.github.com> Date: Thu, 31 Aug 2023 12:07:17 +0530 Subject: [PATCH] - No frame - Added a bunch of todos to be picked up --- .../beta/components/Slider/index.stories.tsx | 5 ++- web/src/beta/components/Slider/index.tsx | 31 +++++-------------- .../fields/SliderField/index.stories.tsx | 5 ++- 3 files changed, 11 insertions(+), 30 deletions(-) diff --git a/web/src/beta/components/Slider/index.stories.tsx b/web/src/beta/components/Slider/index.stories.tsx index 1b0163e734..94ff248b50 100644 --- a/web/src/beta/components/Slider/index.stories.tsx +++ b/web/src/beta/components/Slider/index.stories.tsx @@ -27,8 +27,8 @@ export const Default: Story = (args: Props) => {
- With frame - + Double Max +
Disabled @@ -43,7 +43,6 @@ Default.args = { min: 0, max: 100, step: 1, - frame: false, }; const Wrapper = styled.div` diff --git a/web/src/beta/components/Slider/index.tsx b/web/src/beta/components/Slider/index.tsx index 90233fdfd6..409bf29182 100644 --- a/web/src/beta/components/Slider/index.tsx +++ b/web/src/beta/components/Slider/index.tsx @@ -1,39 +1,22 @@ import RCSlider from "rc-slider"; import React, { ComponentProps } from "react"; -import { styled, css } from "@reearth/services/theme"; +import { styled } from "@reearth/services/theme"; import "rc-slider/assets/index.css"; export type Props = { min: number; max: number; - frame?: boolean; } & Omit, "defaultValue">; -const Slider: React.FC = ({ frame = false, ...props }) => ( - - - -); - -const Wrapper = styled.div<{ frame: boolean }>` - display: flex; - align-items: center; - border: ${({ frame, theme }) => (frame ? `solid 1px ${theme.outline.main}` : "none")}; - border-radius: 3px; - background: ${({ frame, theme }) => (frame ? theme.bg[1] : "transparent")}; - width: 100%; - flex: 1; - box-sizing: border-box; - ${({ frame }) => - frame && - css` - padding: 6px 12px; - margin-right: 5px; - `}; -`; +// TODO: Show value on hover as well as on drag +const Slider: React.FC = ({ ...props }) => ; +// TODO: Update colors as per design +// TODO: Add shadow background in the empty bar +// TODO: Update height as per design +// TODO: Fixed disabled state with opacity changes const StyledSlider = styled(RCSlider)` .rc-slider-handle { background-color: ${({ theme }) => theme.bg[2]}; diff --git a/web/src/beta/components/fields/SliderField/index.stories.tsx b/web/src/beta/components/fields/SliderField/index.stories.tsx index 83dafd2580..8cf67861a5 100644 --- a/web/src/beta/components/fields/SliderField/index.stories.tsx +++ b/web/src/beta/components/fields/SliderField/index.stories.tsx @@ -27,11 +27,10 @@ export const Default: Story = (args: Props) => {