fix modal behaviour

Signed-off-by: Bruno Fuzetti Penso <bruno.penso@gmail.com>
This commit is contained in:
Bruno Fuzetti Penso
2021-12-10 11:00:09 -03:00
committed by Fredrik Adelöw
parent 9a5212fef9
commit b341771b91
5 changed files with 15 additions and 13 deletions
@@ -35,12 +35,12 @@ const RadarDescription = (props: Props): JSX.Element => {
const handleClick = () => {
onClose();
if (url) {
if (urlTarget) {
window.open(url, urlTarget);
} else {
window.location.href = url;
}
if (urlTarget) {
console.log('with target' + urlTarget)
window.open(url, urlTarget);
} else {
console.log('no target' + urlTarget)
window.location.href = url;
}
};
@@ -52,13 +52,12 @@ const RadarDescription = (props: Props): JSX.Element => {
<DialogContent dividers>
<MarkdownContent content={description} />
</DialogContent>
{url && (
{(url && url !== '#') && (
<DialogActions>
<Button
onClick={handleClick}
color="primary"
startIcon={<LinkIcon />}
href={url}
>
LEARN MORE
</Button>
@@ -110,6 +110,7 @@ const RadarEntry = (props: Props): JSX.Element => {
title={title ? title : 'no title'}
description={description ? description : 'no description'}
url={url}
urlTarget={urlTarget}
/>
)}
{description ? (
@@ -73,6 +73,7 @@ const RadarPlot = (props: Props): JSX.Element => {
color={entry.color || ''}
value={(entry?.index || 0) + 1}
url={entry.url}
urlTarget={entry.urlTarget}
description={entry.description}
moved={entry.moved}
title={entry.title}
+5 -4
View File
@@ -107,14 +107,14 @@ entries.push({
{
moved: 0,
ringId: 'use',
date: new Date('2020-08-06'),
date: new Date('2020-08-06')
},
],
url: '#',
key: 'code-reviews',
id: 'code-reviews',
title: 'Code Reviews',
quadrant: 'process',
quadrant: 'process'
});
entries.push({
timeline: [
@@ -162,10 +162,11 @@ entries.push({
{
ringId: 'use',
date: new Date('2020-08-06'),
description: 'test description'
description: 'description'
},
],
url: '#',
url: 'https://github.com',
urlTarget: '_blank',
key: 'github-actions',
id: 'github-actions',
title: 'GitHub Actions',
+1 -1
View File
@@ -29,7 +29,7 @@ export const WithLink = ({
className,
children,
}: WithLinkProps): JSX.Element =>
url ? (
(url && url!== '#') ? (
<Link target={urlTarget} className={className} to={url}>
{children}
</Link>