Skip to content

Commit

Permalink
Fix tags children
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcss committed Oct 31, 2024
1 parent 85fcd17 commit 0360209
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 4 additions & 6 deletions src/components/ShieldsBadge/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import React from 'react'
import {useEffect, useState} from 'react'
import Link from '/src/components/Link'
import clsx from 'clsx'
import { Tooltip } from 'react-tooltip'
import { useColorMode } from '@docusaurus/theme-common'

import Link from '/src/components/Link';

function generateUniqueId(prefix = 'id') {
return `${prefix}-${Math.random().toString(36).substr(2, 9)}`;
Expand Down Expand Up @@ -45,7 +43,7 @@ function Tag ({ children, href, ...props }) {
{children}
</Link>
) : (
<div {...props}>{children}</div>
<span {...props}>{children}</span>
)
}

Expand All @@ -69,9 +67,9 @@ export default function ShieldsBadge ({ title, color, href, label, labelColor, l
data-tooltip-id={tooltip && tooltipId}
data-tooltip-content={tooltip}
>
<img src={src} alt={label ?? name} {...props} />
<img src={src} alt={title || ''} {...props} />
{tooltip && (
<Tooltip id={tooltipId} opacity={0.95} variant={toolTipColor} className="px-8 py-4 fs-12"/>
<Tooltip id={tooltipId} opacity={0.95} wrapper={"span"} variant={toolTipColor} className="px-8 py-4 fs-12"/>
)}
</Tag>
</>
Expand Down
3 changes: 2 additions & 1 deletion src/pages/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -680,10 +680,11 @@ Detailed option description you can find [here](https://shields.io/badges/static
- **Render**
<Shield label="any text" title="you like" color="blue" />
<Shield title="Badge with tooltip" tooltip="Hello from Rootstock"/>
<Shield title="Badge with tooltip" tooltip="Hello from Rootstock" />
<Shield title="Rootstock Dev Portal" color="pink" />
<Shield label="build" title="passing" color="green" />
#### Version badge
- **Code**
Expand Down

0 comments on commit 0360209

Please sign in to comment.