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

fix: resolve service callout links with useBaseUrl hook #145

Merged
Show file tree
Hide file tree
Changes from 2 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
39 changes: 20 additions & 19 deletions src/components/HomepageFeatures/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import clsx from 'clsx';
import Heading from '@theme/Heading';
import styles from './styles.module.css';
import useBaseUrl from '@docusaurus/useBaseUrl';

type FeatureItem = {
title: string;
Expand Down Expand Up @@ -29,7 +30,7 @@ const FeatureList: FeatureItem[] = [
<>
Discover tailored out-of-the-box solutions and
practical implementations for a range of scenarios. Explore real-world examples demonstrating the versatility and optimal
application and infrastructure design using Open Telekom Cloud.
application and infrastructure design using Open Telekom Cloud.
</>
),
link: '/docs/blueprints'
Expand All @@ -39,15 +40,15 @@ const FeatureList: FeatureItem[] = [
Svg: require('@site/static/img/caf.svg').default,
description: (
<>
The Cloud Adoption Framework provides a structured approach for organizations to transition their business to
Open Telekom Cloud. It covers various stages such as strategy, planning, readiness, migration, governance, and management.
The Cloud Adoption Framework provides a structured approach for organizations to transition their business to
Open Telekom Cloud. It covers various stages such as strategy, planning, readiness, migration, governance, and management.
</>
),
link: '/caf'
},
];

function Feature({title, Svg, description, link}: FeatureItem) {
function Feature({ title, Svg, description, link }: FeatureItem) {
return (
// <div className={clsx('col col--4')}>
// <div className="text--center">
Expand All @@ -62,26 +63,26 @@ function Feature({title, Svg, description, link}: FeatureItem) {
// </div>
// </div>
<div className={clsx('col col--4')}>
<scale-card to={link} class="scale-telekom-feature-card">
<div style={{margin: '-24px'}}>
<div className="text--center">
<Svg className={styles.featureSvg} role="img" />
</div>
<div className="text--center padding-horiz--md" style={{margin: '0 0 16px 0'}}>
{/* <h4 style={{margin: '0px 0 16px 0', font: 'var(--telekom-text-style-heading-4)'}}>{title} </h4> */}
<Heading as="h3" style={{margin: '8px'}}>{title}</Heading>
<span>
{description}
</span>
{/* <scale-button style={{margin: '16px'}} icon-position="after">
<scale-card to={useBaseUrl(link)} class="scale-telekom-feature-card">
<div style={{ margin: '-24px' }}>
<div className="text--center">
<Svg className={styles.featureSvg} role="img" />
</div>
<div className="text--center padding-horiz--md" style={{ margin: '0 0 16px 0' }}>
{/* <h4 style={{margin: '0px 0 16px 0', font: 'var(--telekom-text-style-heading-4)'}}>{title} </h4> */}
<Heading as="h3" style={{ margin: '8px' }}>{title}</Heading>
<span>
{description}
</span>
{/* <scale-button style={{margin: '16px'}} icon-position="after">
Get Started <scale-icon-navigation-right></scale-icon-navigation-right>
</scale-button> */}
</div>
</div>
</scale-card>
</div>
</scale-card>
</div>

);
);
}

export default function HomepageFeatures(): JSX.Element {
Expand Down
113 changes: 57 additions & 56 deletions src/components/ServiceCallouts/callout.tsx
Original file line number Diff line number Diff line change
@@ -1,60 +1,61 @@
import {
ClockIcon,
CogIcon,
CubeTransparentIcon,
RectangleGroupIcon,
RectangleStackIcon,
ShareIcon,
SparklesIcon,
UsersIcon,
} from "@heroicons/react/24/outline";
import clsx from "clsx";
import React from "react";
import styles from "./styles.modules.css";

export interface Callout {
title: string;
text?: string;
link: string;
icon: (props: React.ComponentProps<"svg">) => JSX.Element;
}

function Callout(props: Callout): JSX.Element {
return (
<a href={props.link} className={styles.callout__link}>
<div className={clsx("card", styles.callout, styles.callout__shadow)} style={{marginBottom: '30px'}}>
<div className="card__header">
<h3 style={{ fontWeight: 'bold', fontSize: 'medium', alignItems: 'center', display: 'flex', marginBottom: '0'}}>
<props.icon className={styles.callout__icon} stroke="currentColor" aria-hidden="true" role="img"/>
{props.title}
</h3>
</div>
<div className="card__body" style={{paddingTop: '0'}}>
ClockIcon,
CogIcon,
CubeTransparentIcon,
RectangleGroupIcon,
RectangleStackIcon,
ShareIcon,
SparklesIcon,
UsersIcon,
} from "@heroicons/react/24/outline";
import clsx from "clsx";
import React from "react";
import styles from "./styles.modules.css";
import useBaseUrl from '@docusaurus/useBaseUrl';

export interface Callout {
title: string;
text?: string;
link: string;
icon: (props: React.ComponentProps<"svg">) => JSX.Element;
}

function Callout(props: Callout): JSX.Element {
return (
<a href={useBaseUrl(props.link)} className={styles.callout__link}>
<div className={clsx("card", styles.callout, styles.callout__shadow)} style={{ marginBottom: '30px' }}>
<div className="card__header">
<h3 style={{ fontWeight: 'bold', fontSize: 'medium', alignItems: 'center', display: 'flex', marginBottom: '0' }}>
<props.icon className={styles.callout__icon} stroke="currentColor" aria-hidden="true" role="img" />
{props.title}
</h3>
</div>
<div className="card__body" style={{ paddingTop: '0' }}>
<span className="link--inset" aria-hidden="true"></span>
<p>
{props.text}
</p>
</div>
<div className={styles.callout__bottom} />
<p>
{props.text}
</p>
</div>
</a>
);
}
<div className={styles.callout__bottom} />
</div>
</a>
);
}

export interface ServiceCalloutsProps {
callouts: Callout[];
}
export default function ServiceCallouts({ callouts }: ServiceCalloutsProps): JSX.Element {
return (
<section className="container">
<div className="row">
{callouts.map((c) => (
<div key={c.title} className="col col--4">
<Callout title={c.title} text={c.text} link={c.link} icon={c.icon} />
</div>
))}
</div>
</section>
);
}
export interface ServiceCalloutsProps {
callouts: Callout[];
}

export default function ServiceCallouts({ callouts }: ServiceCalloutsProps): JSX.Element {
return (
<section className="container">
<div className="row">
{callouts.map((c) => (
<div key={c.title} className="col col--4">
<Callout title={c.title} text={c.text} link={useBaseUrl(c.link)} icon={c.icon} />
</div>
))}
</div>
</section>
);
}
Loading