add option to show link icon (#13506)

This commit is contained in:
Alan Ren
2020-11-20 14:06:07 -08:00
committed by GitHub
parent 172a044ba7
commit 815c61315c
5 changed files with 30 additions and 24 deletions

View File

@@ -1,3 +0,0 @@
<svg width="11" height="11" viewBox="0 0 11 11" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10 6H11V11H0V0H5V1H1V10H10V6ZM11 0V5H10V1.71094L5.35156 6.35156L4.64844 5.64844L9.28906 1H6V0H11Z" fill="#0078D4"/>
</svg>

Before

Width:  |  Height:  |  Size: 230 B

View File

@@ -405,24 +405,15 @@ export class DashboardWidget {
width: maxWidth + 10,
justifyContent: 'flex-start'
}).component();
const linkComponent = view.modelBuilder.hyperlink().withProperties({
label: linkMetaData.title,
url: linkMetaData.link,
const linkComponent = view.modelBuilder.hyperlink().withProps({
label: linkMetaData.title!,
url: linkMetaData.link!,
showLinkIcon: true,
CSSStyles: {
'font-size': '14px',
'margin': '0px'
}
}).component();
const image = view.modelBuilder.image().withProperties({
width: '10px',
height: '10px',
iconPath: {
dark: this.asAbsolutePath('images/linkIcon.svg'),
light: this.asAbsolutePath('images/linkIcon.svg'),
},
iconHeight: '10px',
iconWidth: '10px'
}).component();
linkContainer.addItem(linkComponent, {
CSSStyles: {
'font-size': '14px',
@@ -430,12 +421,6 @@ export class DashboardWidget {
'padding': '0 5px 0 0',
}
});
linkContainer.addItem(image, {
CSSStyles: {
'padding': '5px 5px 0 0',
'height': '10px',
}
});
labelsContainer.addItems([linkContainer, descriptionComponent], {
CSSStyles: {
'padding': '5px 0 0 0',