url target attribute

Signed-off-by: Bruno Fuzetti Penso <bruno.penso@gmail.com>
This commit is contained in:
Bruno Fuzetti Penso
2021-12-10 10:34:08 -03:00
committed by Fredrik Adelöw
parent b365a96b4c
commit 9a5212fef9
4 changed files with 8 additions and 5 deletions
+1 -1
View File
@@ -116,7 +116,7 @@ export interface RadarEntry {
*
* Empty is the default and the value possible are the same as W3C definition
*/
urlTarget: string;
urlTarget?: string;
/**
* History of the Entry moving through {@link RadarRing}
*/
+1 -1
View File
@@ -51,7 +51,7 @@ entries.push({
title: 'JavaScript',
quadrant: 'languages',
description:
'Excepteur **sint** occaecat *cupidatat* non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\n```ts\nconst x = "3";\n```\n',
'Excepteur **sint** occaecat *cupidatat* non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\n```ts\nconst x = "3";\n```\n'
});
entries.push({
timeline: [
+5 -2
View File
@@ -14,22 +14,25 @@
* limitations under the License.
*/
import React from 'react';
import { Link } from '@backstage/core-components';
type WithLinkProps = {
url?: string;
urlTarget?: string;
className: string;
children: React.ReactNode;
};
export const WithLink = ({
url,
urlTarget,
className,
children,
}: WithLinkProps): JSX.Element =>
url ? (
<a href={url} className={className}>
<Link target={urlTarget} className={className} to={url}>
{children}
</a>
</Link>
) : (
<>{children}</>
);
+1 -1
View File
@@ -62,7 +62,7 @@ export type Entry = {
// An URL to a longer description as to why this entry is where it is
url?: string;
// The URL target definition as W3C definition
urlTarget?: String;
urlTarget?: string;
// How this entry has recently moved; -1 for "down", +1 for "up", 0 for not moved
moved?: MovedState;
// Most recent description to display in the UI