Skip to content

Commit

Permalink
fix: tooltip placement (#1779)
Browse files Browse the repository at this point in the history
  • Loading branch information
keellyp authored Oct 1, 2024
1 parent 5b68057 commit a9781cd
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 58 deletions.
8 changes: 2 additions & 6 deletions src/components/OverviewCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ export const OverviewCard: FC<OverviewCardProps> = ({
<CardHeader>
<Typography variant="captionHl">{title}</Typography>
{tooltipContent && (
<StyledTooltip placement="top-start" title={tooltipContent}>
<Tooltip className="flex h-5 items-end" placement="top-start" title={tooltipContent}>
<Icon name="info-circle" />
</StyledTooltip>
</Tooltip>
)}
</CardHeader>

Expand Down Expand Up @@ -69,7 +69,3 @@ const SkeletonWrapper = styled.div`
margin-bottom: ${theme.spacing(8)};
}
`

const StyledTooltip = styled(Tooltip)`
height: 16px;
`
7 changes: 5 additions & 2 deletions src/components/creditNote/CreditNoteFormCalculation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,11 @@ export const CreditNoteFormCalculation = ({
<Line>
<InlineLabel>
<Typography variant="bodyHl">{translate('text_644b9f17623605a945cafdbb')}</Typography>
<Tooltip placement="top-start" title={translate('text_644b9f17623605a945cafdb9')}>
<Tooltip
className="flex h-5 items-end"
placement="top-start"
title={translate('text_644b9f17623605a945cafdb9')}
>
<Icon name="info-circle" />
</Tooltip>
</InlineLabel>
Expand Down Expand Up @@ -630,7 +634,6 @@ const InlineLabel = styled.div`
> *:last-child {
margin-left: ${theme.spacing(2)};
height: 16px;
}
`

Expand Down
9 changes: 2 additions & 7 deletions src/components/designSystem/graphs/ChartHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import styled, { css } from 'styled-components'

import { Icon, Skeleton, Tooltip, Typography } from '~/components/designSystem'
Expand Down Expand Up @@ -36,9 +35,9 @@ const ChartHeader = ({
{name}
</Typography>
{!!tooltipText && (
<LeftInfoCellTooltip placement="top-start" title={tooltipText}>
<Tooltip className="flex h-5 items-end" placement="top-start" title={tooltipText}>
<Icon name="info-circle" />
</LeftInfoCellTooltip>
</Tooltip>
)}
</LeftInfoCellWithTooltip>
<Typography variant="subhead" color="grey700">
Expand Down Expand Up @@ -93,7 +92,3 @@ const LeftInfoCellWithTooltip = styled.div`
align-items: center;
gap: ${theme.spacing(2)};
`

const LeftInfoCellTooltip = styled(Tooltip)`
height: 16px;
`
9 changes: 3 additions & 6 deletions src/components/developers/DebuggerEventDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,13 @@ export const DebuggerEventDetails = ({ event }: DebuggerEventDetailsProps) => {
</PropertyLabel>
<PropertyValue color="textSecondary">
{transactionId}
<TransactionIdTooltip
<Tooltip
className="flex h-5 items-end"
placement="bottom-start"
title={translate('text_6298bd525e359200d5ea0257')}
>
<StyledIcon color="dark" name="info-circle" />
</TransactionIdTooltip>
</Tooltip>
</PropertyValue>

<PropertyLabel variant="caption">
Expand Down Expand Up @@ -169,10 +170,6 @@ const StyledCodeSnippet = styled(CodeSnippet)`
}
`

const TransactionIdTooltip = styled(Tooltip)`
height: 16px;
`

const PropertiesContainer = styled.div`
padding: ${theme.spacing(8)};
box-shadow: ${theme.shadows[7]};
Expand Down
6 changes: 1 addition & 5 deletions src/components/form/ButtonSelector/ButtonSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const ButtonSelector = ({
{label}
</Typography>
{!!infoText && (
<Tooltip placement="bottom-start" title={infoText}>
<Tooltip className="flex h-5 items-end" placement="bottom-start" title={infoText}>
<Icon name="info-circle" />
</Tooltip>
)}
Expand Down Expand Up @@ -106,10 +106,6 @@ const Label = styled.div<{ $withInfo?: boolean }>`
> *:first-child {
margin-right: ${theme.spacing(1)};
}
> *:last-child {
height: 16px;
}
`}
`

Expand Down
6 changes: 1 addition & 5 deletions src/components/form/JsonEditor/JsonEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const JsonEditor = ({
{label}
</Typography>
{!!infoText && (
<Tooltip placement="bottom-start" title={infoText}>
<Tooltip className="flex h-5 items-end" placement="bottom-start" title={infoText}>
<Icon name="info-circle" />
</Tooltip>
)}
Expand Down Expand Up @@ -209,10 +209,6 @@ const LabelContainer = styled.div<{ $withInfo?: boolean }>`
> *:first-child {
margin-right: ${theme.spacing(1)};
}
> *:last-child {
height: 16px;
}
`}
`

Expand Down
6 changes: 1 addition & 5 deletions src/components/form/Radio/RadioGroupField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const RadioGroupField: FC<RadioGroupFieldProps> = ({
{label}
</Typography>
{!!infoText && (
<Tooltip placement="top-start" title={infoText}>
<Tooltip className="flex h-5 items-end" placement="top-start" title={infoText}>
<Icon name="info-circle" />
</Tooltip>
)}
Expand Down Expand Up @@ -95,10 +95,6 @@ const Label = styled.div<{ $withInfo?: boolean }>`
> *:first-child {
margin-right: ${theme.spacing(1)};
}
> *:last-child {
height: 16px;
}
`}
`

Expand Down
19 changes: 7 additions & 12 deletions src/components/plans/GraduatedPercentageChargeTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,18 @@ export const GraduatedPercentageChargeTable = memo(
},
{
title: (
<CellTitleWithTooltip>
<div className="flex items-center">
<TypographyCell variant="captionHl">
{translate('text_64de472463e2da6b31737df2')}
</TypographyCell>
<Tooltip placement="top-end" title={translate('text_64de472563e2da6b31737e77')}>
<Tooltip
className="flex h-5 items-end"
placement="top-end"
title={translate('text_64de472563e2da6b31737e77')}
>
<Icon name="info-circle" />
</Tooltip>
</CellTitleWithTooltip>
</div>
),
size: 124,
content: (row, i) =>
Expand Down Expand Up @@ -351,12 +355,3 @@ const AddButton = styled(Button)`
margin-left: auto;
margin-bottom: ${theme.spacing(2)};
`

const CellTitleWithTooltip = styled.div`
display: flex;
align-items: center;
> *:nth-child(2) {
height: 16px;
}
`
13 changes: 3 additions & 10 deletions src/components/wallets/WalletAccordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,14 +341,15 @@ export const WalletAccordion = forwardRef<TopupWalletDialogRef, WalletAccordionP
currency,
})}
&nbsp;
<InlineTooltip
<Tooltip
className="flex h-5 items-end"
placement="top-end"
title={translate('text_62da6db136909f52c2704c40', {
date: formatTimeOrgaTZ(lastConsumedCreditAt || DateTime.now()),
})}
>
<Icon name="info-circle" />
</InlineTooltip>
</Tooltip>
</WalletConsumptionSummary>
</>
)}
Expand Down Expand Up @@ -394,10 +395,6 @@ const SummaryLeft = styled.div`
}
`

// const SummaryRight = styled.div`
// min-width: 120px;
// `

const SummaryInfos = styled.div<{ $isLoading?: boolean }>`
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -454,10 +451,6 @@ const WalletConsumptionSummary = styled(Typography)`
justify-content: flex-end;
`

const InlineTooltip = styled(Tooltip)`
height: 16px;
`

const FreemiumWarningBlock = styled.div`
display: flex;
align-items: center;
Expand Down

0 comments on commit a9781cd

Please sign in to comment.