refactor: use the useAnimate hook (#5103)
Co-authored-by: Peer Richelsen <[email protected]>
This commit is contained in:
1 parent
7756b9c3a1
commit
2931f4f84a
13 files changed
+38
-83
No files matched your search
@@ -1,5 +1,4 @@
|
||||
import autoAnimate from "@formkit/auto-animate";
|
||||
import React, { useEffect, useRef } from "react";
|
||||
import { useAutoAnimate } from "@formkit/auto-animate/react";
|
||||
import { Props } from "react-select";
|
||||
|
||||
import { classNames } from "@calcom/lib";
|
||||
@@ -24,11 +23,8 @@ export const CheckedTeamSelect = ({
|
||||
onChange: (value: readonly CheckedSelectOption[]) => void;
|
||||
}) => {
|
||||
const { t } = useLocale();
|
||||
const animationRef = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
animationRef.current && autoAnimate(animationRef.current);
|
||||
}, [animationRef]);
|
||||
const [animationRef] = useAutoAnimate<HTMLUListElement>();
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import autoAnimate from "@formkit/auto-animate";
|
||||
import React, { useEffect, useRef } from "react";
|
||||
import { components, GroupBase, Props, ValueContainerProps } from "react-select";
|
||||
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
@@ -37,11 +35,6 @@ const LimitedChipsContainer = <Option, IsMulti extends boolean, Group extends Gr
|
||||
|
||||
export const MultiDropdownSelect = ({ options = [], value = [], ...props }: Props) => {
|
||||
// const { t } = useLocale();
|
||||
const animationRef = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
animationRef.current && autoAnimate(animationRef.current);
|
||||
}, [animationRef]);
|
||||
|
||||
return (
|
||||
<Select
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import autoAnimate from "@formkit/auto-animate";
|
||||
import { useEffect, useState, useRef } from "react";
|
||||
import { useAutoAnimate } from "@formkit/auto-animate/react";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { localStorage } from "@calcom/lib/webstorage";
|
||||
@@ -34,11 +34,7 @@ const tips = [
|
||||
];
|
||||
|
||||
export default function Tips() {
|
||||
const animationRef = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
animationRef.current && autoAnimate(animationRef.current, { duration: 250, easing: "ease-out" });
|
||||
}, [animationRef]);
|
||||
const [animationRef] = useAutoAnimate<HTMLDivElement>();
|
||||
|
||||
const { t } = useLocale();
|
||||
|
||||
|
||||
Reference in new issue
Block a user