Skip to content

Commit

Permalink
fix(ui): use react link to route to relative deep-link path (#13529)
Browse files Browse the repository at this point in the history
Signed-off-by: ashutosh16 <11219262+ashutosh16@users.noreply.github.com>
  • Loading branch information
ashutosh16 committed Jun 16, 2023
1 parent dea3848 commit 8f63ba3
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions ui/src/app/shared/components/deep-links.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react';
import React from 'react';
import {Link} from 'react-router-dom';
import {LinkInfo} from '../models';

export const DeepLinks = (props: {links: LinkInfo[]}) => {
Expand All @@ -7,10 +8,17 @@ export const DeepLinks = (props: {links: LinkInfo[]}) => {
<div style={{margin: '10px 0'}}>
{(links || []).map((link: LinkInfo) => (
<div key={link.title} style={{display: 'flex', alignItems: 'center', height: '35px'}}>
<a href={link.url} target='_blank' style={{display: 'flex', alignItems: 'center', marginRight: '7px'}} rel='noopener'>
<i className={`fa ${link.iconClass ? link.iconClass : 'fa-external-link-alt'}`} style={{marginRight: '5px'}} />
<div>{link.title}</div>
</a>
{link.url.startsWith('http') ? (
<a href={link.url} target='_blank' rel='noopener' style={{display: 'flex', alignItems: 'center', marginRight: '7px'}}>
<i className={`fa ${link.iconClass ? link.iconClass : 'fa-external-link-alt'} custom-style-link`} style={{marginRight: '5px'}} />
<div>{link.title}</div>
</a>
) : (
<Link to={link.url} style={{display: 'flex', alignItems: 'center', marginRight: '7px'}}>
<i className={`fa ${link.iconClass ? link.iconClass : 'fa-external-link-alt'}`} style={{marginRight: '5px'}} />
<div>{link.title}</div>
</Link>
)}
{link.description && <>({link.description})</>}
</div>
))}
Expand Down

0 comments on commit 8f63ba3

Please sign in to comment.