Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update: add tooltips to badges #107

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-loadable": "^5.5.0",
"react-tooltip": "^5.26.3",
"rehype-katex": "7",
"remark-math": "6",
"search-insights": "^2.13.0",
Expand Down
15 changes: 12 additions & 3 deletions src/components/Badges/EarlyBadge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,20 @@ import React from 'react';
import clsx from 'clsx';
import styles from './styles.module.css';
import stylesGeneric from '../styles.module.css';
import {Tooltip} from 'react-tooltip';

export default function EarlyBadge(): JSX.Element {
return (
<span className={clsx(stylesGeneric.badge, styles.badge)}>
Early availabilty
</span>
<>
<a
data-tooltip-id="my-tooltip"
data-tooltip-content="This feature is in preview."
data-tooltip-offset={-3}>
<span className={clsx(stylesGeneric.badge, styles.badge)}>
Early availabilty
</span>
</a>
<Tooltip id="my-tooltip" className={stylesGeneric.aivenTooltip} />
</>
);
}
13 changes: 12 additions & 1 deletion src/components/Badges/ProBadge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@ import React from 'react';
import clsx from 'clsx';
import styles from './styles.module.css';
import stylesGeneric from '../styles.module.css';
import {Tooltip} from 'react-tooltip';

export default function ProBadge(): JSX.Element {
return <span className={clsx(stylesGeneric.badge, styles.badge)}>pro</span>;
return (
<>
<a
data-tooltip-id="my-tooltip"
data-tooltip-content="This feature is part of Aiven Enterprise."
data-tooltip-offset={-3}>
<span className={clsx(stylesGeneric.badge, styles.badge)}>Pro</span>
</a>
<Tooltip id="my-tooltip" className={stylesGeneric.aivenTooltip} />
</>
);
}
11 changes: 11 additions & 0 deletions src/components/Badges/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,19 @@
padding: 4px 8px;
font-size: 80%;
vertical-align: middle;
white-space: nowrap;

}

article .aivenTooltip {
font-size: 13px;
font-weight: 400;
z-index: 100;
font-family: inter;
padding: 0.8em;
}


h1 .badge,
h2 .badge,
h3 .badge {
Expand Down
Loading