From c154f243afad0da87a6d3122777ccbea5bf41d08 Mon Sep 17 00:00:00 2001 From: Max Korsunov Date: Mon, 19 Aug 2024 13:25:48 +0200 Subject: [PATCH] refactor: reuse the styles --- packages/ui/src/Tooltip/index.tsx | 15 ++------------- packages/ui/src/utils/popover.ts | 2 +- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/packages/ui/src/Tooltip/index.tsx b/packages/ui/src/Tooltip/index.tsx index ba7364baf4..0ccd6fcb41 100644 --- a/packages/ui/src/Tooltip/index.tsx +++ b/packages/ui/src/Tooltip/index.tsx @@ -1,21 +1,10 @@ import * as RadixTooltip from '@radix-ui/react-tooltip'; import { ReactNode } from 'react'; -import styled, { keyframes } from 'styled-components'; +import styled from 'styled-components'; import { Text } from '../Text'; import { buttonBase } from '../utils/button'; import { small } from '../utils/typography'; - -const scaleIn = keyframes` - from { - opacity: 0; - transform: scale(0); - } - - to { - opacity: 1; - transform: scale(1); - } -`; +import { scaleIn } from '../utils/popover.ts'; const Content = styled(RadixTooltip.Content).attrs(props => ({ sideOffset: props.theme.spacing(1, 'number'), diff --git a/packages/ui/src/utils/popover.ts b/packages/ui/src/utils/popover.ts index 7ec4cdf859..174deaa044 100644 --- a/packages/ui/src/utils/popover.ts +++ b/packages/ui/src/utils/popover.ts @@ -1,6 +1,6 @@ import styled, { keyframes } from 'styled-components'; -const scaleIn = keyframes` +export const scaleIn = keyframes` from { opacity: 0; transform: scale(0);