Skip to content

Commit

Permalink
fix: display favicon, add shell core styles scss to fix styling of re…
Browse files Browse the repository at this point in the history
…mote component headerRight (onecx#248)

* fix: add template for displaying things in the top center of interactive data view

* fix: fix implementation

* fix: display favicon

* fix: add shell core styles scss to fix styling of remote components headerRight

---------

Co-authored-by: kim.tran <[email protected]>
  • Loading branch information
KimFFVII and kim.tran authored May 8, 2024
1 parent 48475b7 commit 5b0f784
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 23 deletions.
3 changes: 3 additions & 0 deletions libs/shell-core/assets/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.layout-topbar-items > * {
margin: auto;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,3 @@
color: var(--logo-color, #12abdb);
fill: currentColor;
}

.layout-topbar-items > * {
margin: auto;
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
UserService,
} from '@onecx/angular-integration-interface'
import { MessageService, PrimeNGConfig } from 'primeng/api'
import { BehaviorSubject, filter, first, map, mergeMap, of } from 'rxjs'
import { BehaviorSubject, filter, first, from, mergeMap, of } from 'rxjs'

export const SHOW_CONTENT_PROVIDER = new InjectionToken<ShowContentProvider>('SHOW_CONTENT_PROVIDER')

Expand Down Expand Up @@ -66,26 +66,22 @@ export class PortalViewportComponent implements OnInit, OnDestroy {
| undefined) || this.colorScheme
})

this.themeService.currentTheme$.pipe(
first(),
mergeMap((theme) => {
const prefix = theme.faviconUrl && theme.faviconUrl.startsWith('/') ? '/shell-bff' : ''
return theme.faviconUrl
? this.httpClient
.get(prefix + theme.faviconUrl, { responseType: 'blob' })
.pipe(map((blob) => URL.createObjectURL(blob)))
: of('')
})
)

this.themeService.currentTheme$
.pipe(
first(),
mergeMap((theme) => {
return theme.faviconUrl
? this.httpClient
.get(theme.faviconUrl, { responseType: 'blob' })
.pipe(map((blob) => URL.createObjectURL(blob)))
? this.httpClient.get(theme.faviconUrl, { responseType: 'blob' }).pipe(
mergeMap((blob) => {
return from(
new Promise((resolve) => {
const reader = new FileReader()
reader.onload = (e) => resolve(e.target?.result)
reader.readAsDataURL(blob)
})
)
})
)
: of('')
})
)
Expand All @@ -96,9 +92,6 @@ export class PortalViewportComponent implements OnInit, OnDestroy {
link.rel = 'icon'
document.head.appendChild(link)
}
link.onload = () => {
URL.revokeObjectURL(url)
}
link.href = url
})
}
Expand Down

0 comments on commit 5b0f784

Please sign in to comment.