Skip to content

Commit

Permalink
refactor: update Tooltip component props to only use v2 compatibl…
Browse files Browse the repository at this point in the history
…e props
  • Loading branch information
aprendendofelipe committed Aug 30, 2024
1 parent 6d61380 commit dfe4141
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 79 deletions.
96 changes: 47 additions & 49 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"@bytemd/plugin-math": "1.21.0",
"@bytemd/plugin-mermaid": "1.21.0",
"@bytemd/react": "1.21.0",
"@primer/octicons-react": "19.10.0",
"@primer/react": "36.22.0",
"@primer/octicons-react": "19.11.0",
"@primer/react": "36.27.0",
"@react-email/components": "0.0.19",
"@react-email/render": "0.0.15",
"@resvg/resvg-js": "2.6.2",
Expand Down Expand Up @@ -62,7 +62,7 @@
"eslint-config-next": "14.2.4",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-jsx-a11y": "6.9.0",
"eslint-plugin-primer-react": "5.3.0",
"eslint-plugin-primer-react": "5.4.0",
"eslint-plugin-vitest": "0.4.1",
"eslint-plugin-vitest-globals": "1.5.0",
"husky": "9.0.11",
Expand Down
17 changes: 4 additions & 13 deletions pages/[username]/[slug]/index.public.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,7 @@ function InReplyToLinks({ content, parentContent, rootContent }) {
</Link>
)}
{parentContent.status !== 'published' && (
<Tooltip
aria-label={`Este conteúdo está atualmente com status "${parentContent.status}"`}
direction="s"
noDelay={true}>
<Tooltip text={`Este conteúdo está atualmente com status "${parentContent.status}"`} direction="s">
<strong>{parentContent.title}</strong>
</Tooltip>
)}
Expand Down Expand Up @@ -166,10 +163,7 @@ function InReplyToLinks({ content, parentContent, rootContent }) {
</Link>
)}
{parentContent.status !== 'published' && (
<Tooltip
aria-label={`Este conteúdo está atualmente com status "${parentContent.status}"`}
direction="s"
noDelay={true}>
<Tooltip text={`Este conteúdo está atualmente com status "${parentContent.status}"`} direction="s">
<strong>{parentContent.body}</strong>{' '}
</Tooltip>
)}
Expand All @@ -180,10 +174,7 @@ function InReplyToLinks({ content, parentContent, rootContent }) {
</Link>
)}
{rootContent.status !== 'published' && (
<Tooltip
aria-label={`Este conteúdo está atualmente com status "${rootContent.status}"`}
direction="s"
noDelay={true}>
<Tooltip text={`Este conteúdo está atualmente com status "${rootContent.status}"`} direction="s">
<strong>{rootContent.title}</strong>{' '}
</Tooltip>
)}
Expand Down Expand Up @@ -224,7 +215,7 @@ function RenderChildrenTree({ childrenList, pageRootOwnerId, renderIntent, rende
<TabCoinButtons content={child} />
<Tooltip
direction="ne"
aria-label={`Ocultar resposta${plural}`}
text={`Ocultar resposta${plural}`}
role="button"
onClick={() => handleCollapse(id)}
sx={{
Expand Down
5 changes: 1 addition & 4 deletions pages/interface/components/AdBanner/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ export default function AdBanner({ ad: newAd, isLoading, ...props }) {

<Text sx={{ whiteSpace: 'nowrap', overflow: 'hidden', fontSize: 0, color: 'neutral.emphasis' }}>
Contribuindo com{' '}
<Tooltip
aria-label={`Autor: ${ad.owner_username}`}
direction="nw"
sx={{ position: 'absolute', display: 'grid' }}>
<Tooltip text={`Autor: ${ad.owner_username}`} direction="nw" sx={{ position: 'absolute', display: 'grid' }}>
<Link
sx={{ overflow: 'hidden', textOverflow: 'ellipsis', color: 'neutral.emphasis', mr: 2 }}
href={`/${ad.owner_username}`}>
Expand Down
4 changes: 2 additions & 2 deletions pages/interface/components/Content/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,12 @@ function ViewMode({ setComponentMode, contentObject, isPageRootOwner, viewFrame
</BranchName>
<LabelGroup>
{isPageRootOwner && (
<Tooltip aria-label="Autor do conteúdo principal da página" direction="n" sx={{ position: 'absolute' }}>
<Tooltip text="Autor do conteúdo principal da página" direction="n" sx={{ position: 'absolute' }}>
<Label>Autor</Label>
</Tooltip>
)}
{contentObject.type === 'ad' && (
<Tooltip aria-label="Patrocinado com TabCash" direction="n" sx={{ position: 'absolute' }}>
<Tooltip text="Patrocinado com TabCash" direction="n" sx={{ position: 'absolute' }}>
<Label variant="success">Patrocinado</Label>
</Tooltip>
)}
Expand Down
2 changes: 1 addition & 1 deletion pages/interface/components/ContentList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export default function ContentList({ ad, contentList: list, pagination, paginat
<ChildrenDeepCountText count={contentObject.children_deep_count} />
</Text>
{' · '}
<Tooltip aria-label={`Autor: ${contentObject.owner_username}`}>
<Tooltip text={`Autor: ${contentObject.owner_username}`}>
<Text as="address" sx={{ fontStyle: 'normal', overflow: 'hidden', textOverflow: 'ellipsis' }}>
<Link sx={{ color: 'neutral.emphasis' }} href={`/${contentObject.owner_username}`}>
{contentObject.owner_username}
Expand Down
2 changes: 1 addition & 1 deletion pages/interface/components/Header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export default function HeaderComponent() {
<>
{!isScreenSmall && (
<PrimerHeader.Item sx={{ m: 2 }}>
<Tooltip aria-label="Publicar novo conteúdo" direction="s" noDelay={true} wrap={true}>
<Tooltip text="Publicar novo conteúdo" direction="s">
<HeaderLink href="/publicar">
<PlusIcon />
</HeaderLink>
Expand Down
2 changes: 1 addition & 1 deletion pages/interface/components/PastTime/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function PastTime({ date, formatText, ...props }) {
}

return (
<Tooltip aria-label={tooltipLabel} suppressHydrationWarning {...props}>
<Tooltip text={tooltipLabel} suppressHydrationWarning {...props}>
<time dateTime={date} style={{ whiteSpace: 'nowrap' }} suppressHydrationWarning>
{getText(date)}
</time>
Expand Down
2 changes: 1 addition & 1 deletion pages/interface/components/TabCashCount/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function TabCashCount({ amount, direction, mode = 'tooltip', sx }
}

return (
<Tooltip aria-label="TabCash" direction={direction ?? 's'} noDelay={true} wrap={true}>
<Tooltip text="TabCash" direction={direction ?? 's'}>
{content}
</Tooltip>
);
Expand Down
2 changes: 1 addition & 1 deletion pages/interface/components/TabCoinBalanceTooltip/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function TabCoinBalanceTooltip({ children, credit, debit, ...prop
}

return (
<Tooltip {...props} aria-label={getLabel()}>
<Tooltip {...props} text={getLabel()}>
{children}
</Tooltip>
);
Expand Down
4 changes: 2 additions & 2 deletions pages/interface/components/TabCoinButtons/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default function TabCoinButtons({ content }) {
flexDirection: 'column',
alignItems: 'center',
}}>
<Tooltip aria-label="Achei relevante" direction="ne">
<Tooltip text="Achei relevante" direction="ne">
<IconButton
variant="invisible"
aria-label="Creditar TabCoin"
Expand All @@ -122,7 +122,7 @@ export default function TabCoinButtons({ content }) {
<div id={`reward-${contentObject.id}`} style={{ marginLeft: '-10px' }} aria-hidden></div>
{contentObject.tabcoins}
</TabCoinBalanceTooltip>
<Tooltip aria-label="Não achei relevante" direction="ne">
<Tooltip text="Não achei relevante" direction="ne">
<IconButton
variant="invisible"
aria-label="Debitar TabCoin"
Expand Down
2 changes: 1 addition & 1 deletion pages/interface/components/TabCoinCount/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function TabCoinCount({ amount, direction, mode = 'tooltip', sx }
}

return (
<Tooltip aria-label="TabCoins" direction={direction ?? 's'} noDelay={true} wrap={true}>
<Tooltip text="TabCoins" direction={direction ?? 's'}>
{content}
</Tooltip>
);
Expand Down

0 comments on commit dfe4141

Please sign in to comment.