From c6411950f3b054481d9173521895a7a0a66135ff Mon Sep 17 00:00:00 2001 From: Kyle Geib Date: Thu, 3 Feb 2022 11:28:14 -0500 Subject: [PATCH] ISSUE-047 - Exported animated versions of a pair of styled-components of mine. Nothing special. Just something I wanted to change now. --- .../Common/Inputs/ProgressSlider/ProgressSlider.tsx | 6 ++---- src/components/Common/Inputs/ProgressSlider/styles.ts | 4 ++++ src/components/Common/Inputs/SlotSelector/SlotSelector.tsx | 6 +++--- src/components/Common/Inputs/SlotSelector/styles.ts | 4 ++++ 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/components/Common/Inputs/ProgressSlider/ProgressSlider.tsx b/src/components/Common/Inputs/ProgressSlider/ProgressSlider.tsx index 8f4a28c..691f26a 100644 --- a/src/components/Common/Inputs/ProgressSlider/ProgressSlider.tsx +++ b/src/components/Common/Inputs/ProgressSlider/ProgressSlider.tsx @@ -1,10 +1,10 @@ -import { animated, useSpring } from "@react-spring/web"; +import { useSpring } from "@react-spring/web"; import { useDrag } from "@use-gesture/react"; import useMeasure from "react-use-measure"; import { clamp } from "lodash"; import { - ProgressSliderBar, + AnimatedProgressSliderBar, ProgressSliderBarHandle, ProgressSliderBarIndicator, ProgressSliderBody, @@ -55,8 +55,6 @@ export function ProgressSlider({ onChange(newValue); }, { enabled: !disabled }); - const AnimatedProgressSliderBar = animated(ProgressSliderBar); - return ( ` `; ProgressSliderBar.displayName = "ProgressSliderBar"; +export const AnimatedProgressSliderBar = animated(ProgressSliderBar); +AnimatedProgressSliderBar.displayName = "AnimatedProgressSliderBar"; + type ProgressSliderBarHandleProps = { color?: string, }; diff --git a/src/components/Common/Inputs/SlotSelector/SlotSelector.tsx b/src/components/Common/Inputs/SlotSelector/SlotSelector.tsx index b9f8c50..0686e83 100644 --- a/src/components/Common/Inputs/SlotSelector/SlotSelector.tsx +++ b/src/components/Common/Inputs/SlotSelector/SlotSelector.tsx @@ -1,8 +1,8 @@ import { useEffect, useMemo, useState } from "react"; -import { animated, useSpringRef, useTransition } from "@react-spring/web"; +import { useSpringRef, useTransition } from "@react-spring/web"; import { findPrefixCount } from "../../../../utils/strings"; -import { SelectorLabel, SlotText, SlotWindow } from "./styles"; +import { SelectorLabel, AnimatedSlotText, SlotWindow } from "./styles"; import { Inline } from "@bedrock-layout/inline"; type SlotSelectorProps = { @@ -78,7 +78,7 @@ export function SlotSelector({ )} {transitions((style, i) => ( - {getItem(i)} + {getItem(i)} ))} diff --git a/src/components/Common/Inputs/SlotSelector/styles.ts b/src/components/Common/Inputs/SlotSelector/styles.ts index 9a2f580..20f60f0 100644 --- a/src/components/Common/Inputs/SlotSelector/styles.ts +++ b/src/components/Common/Inputs/SlotSelector/styles.ts @@ -1,3 +1,4 @@ +import { animated } from "@react-spring/web"; import styled from "styled-components"; type SlotWindowProps = { @@ -35,6 +36,9 @@ export const SlotText = styled.span` `; SlotText.displayName = "SlotText"; +export const AnimatedSlotText = animated(SlotText); +AnimatedSlotText.displayName = "AnimatedSlotText"; + export const SelectorLabel = styled.span` font-family: ${p => p.theme.fonts.f1Regular}; font-size: ${p => p.theme.fontSizes.label};