Skip to content

feat(slider): add clickable link in subTitle and key for CNCF image switch #222

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

Merged
merged 1 commit into from
Aug 18, 2025
Merged
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 src/components/CNCFInfo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default function CNCFInfo() {
src={colorMode === 'dark' ? "/img/cncf-dark.svg" : "/img/cncf-light.svg"}
alt="CNCF Logo"
className={styles.logoImage}
key={colorMode}
/>
</div>
</div>
Expand Down
9 changes: 8 additions & 1 deletion src/components/slider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@ const sliderItems = [
The forwarding delay of the service mesh is reduced by 5x
</Translate>
),
subTitle: <Translate>click here for more Details</Translate>,
subTitle: (
<a
href="https://kmesh.net/docs/welcome"
style={{ color: 'inherit', textDecoration: 'underline' }}
>
<Translate>Click here for more Details</Translate>
</a>
Comment on lines +26 to +31

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This is an external link. For security and user experience, it should open in a new tab. Please add target="_blank" and rel="noopener noreferrer".

Additionally, for better maintainability, it's recommended to move inline styles to a stylesheet. I've replaced the style prop with a className. Please add the corresponding styles to src/components/slider/index.scss.

For example:

.subtitle-link {
  color: inherit;
  text-decoration: underline;
}
      <a
        href="https://kmesh.net/docs/welcome"
        className="subtitle-link"
        target="_blank"
        rel="noopener noreferrer"
      >
        <Translate>Click here for more Details</Translate>
      </a>

),
backgroundImage: "img/headers/bubbles-wide.jpg",
opacity: 0.5,
align: "center",
Expand Down