Skip to content

Commit e66a052

Browse files
committed
wip:
1 parent 05568d4 commit e66a052

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

packages/webui/src/client/lib/ui/icons/notifications.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { JSX } from 'react'
2-
import { ROOT_URL_PATH_PREFIX } from '../../../url'
2+
import { relativeToSiteRootUrl } from '../../../url'
33

44
export function CriticalIcon(): JSX.Element {
55
return (
@@ -168,7 +168,7 @@ export function WarningIconSmall(): JSX.Element {
168168
// }
169169

170170
export function WarningIconSmallWorkingOnIt(): JSX.Element {
171-
return <img src={ROOT_URL_PATH_PREFIX + '/images/warning-transferring.webp'} width="20" height="20" alt="Warning" />
171+
return <img src={relativeToSiteRootUrl('/images/warning-transferring.webp')} width="20" height="20" alt="Warning" />
172172
}
173173

174174
export function InformationIconSmall(): JSX.Element {

packages/webui/src/client/styles/_header.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
color: #fff;
1919
}
2020
.sofie-logo {
21-
background: var(--sofie-url-path) center center no-repeat;
21+
background: var(--sofie-logo-url) center center no-repeat;
2222
background-size: contain;
2323
width: 2em;
2424
height: 2em;

packages/webui/src/client/ui/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export const App: React.FC = function App() {
153153
className="container-fluid header-clear"
154154
style={{
155155
// @ts-expect-error custom variable
156-
'--sofie-url-path': `url(${ROOT_URL_PATH_PREFIX}/images/sofie-logo.svg)`,
156+
'--sofie-logo-url': `url(${relativeToSiteRootUrl('/images/sofie-logo.svg')})`,
157157
}}
158158
>
159159
{/* Header switch - render the usual header for all pages but the rundown view */}

packages/webui/src/client/ui/FloatingInspectors/NoraFloatingInspector.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React, { useEffect, useImperativeHandle } from 'react'
33
import _ from 'underscore'
44
import { getNoraContentSteps } from '../SegmentContainer/PieceMultistepChevron'
55
import Escape from './../../lib/Escape'
6-
import { ROOT_URL_PATH_PREFIX } from '../../url'
6+
import { relativeToSiteRootUrl } from '../../url'
77

88
interface IPropsHeader {
99
noraContent: NoraContent | undefined
@@ -207,7 +207,7 @@ export class NoraPreviewRenderer extends React.Component<{}, IStateHeader> {
207207
ref={this._setRootElement}
208208
>
209209
<div className="preview">
210-
<img src={ROOT_URL_PATH_PREFIX + '/images/previewBG.jpg'} alt="" />
210+
<img src={relativeToSiteRootUrl('/images/previewBG.jpg')} alt="" />
211211
{rendererUrl && (
212212
<iframe
213213
key={rendererUrl} // Use the url as the key, so that the old renderer unloads immediately when changing url

packages/webui/src/client/ui/StudioScreenSaver/StudioScreenSaver.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { StudioId } from '@sofie-automation/corelib/dist/dataModel/Ids'
1414
import { RundownPlaylists } from '../../collections'
1515
import { CorelibPubSub } from '@sofie-automation/corelib/dist/pubsub'
1616
import { withTranslation } from 'react-i18next'
17-
import { ROOT_URL_PATH_PREFIX } from '../../url'
17+
import { relativeToSiteRootUrl } from '../../url'
1818

1919
interface IProps {
2020
// the studio to be displayed in the screen saver
@@ -338,7 +338,7 @@ const StudioScreenSaverContent = withTranslation()(
338338
>
339339
<object
340340
className="studio-screen-saver__bkg"
341-
data={ROOT_URL_PATH_PREFIX + '/images/screen-saver-bkg.svg'}
341+
data={relativeToSiteRootUrl('/images/screen-saver-bkg.svg')}
342342
type="image/svg+xml"
343343
></object>
344344
<div

packages/webui/src/client/ui/i18n.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { interpollateTranslation } from '@sofie-automation/corelib/dist/Translat
1414
import { TranslationsBundleId } from '@sofie-automation/corelib/dist/dataModel/Ids'
1515
import { TranslationsBundles } from '../collections'
1616
import { catchError } from '../lib/lib'
17-
import { ROOT_URL_PATH_PREFIX } from '../url'
17+
import { relativeToSiteRootUrl } from '../url'
1818

1919
const i18nOptions = {
2020
fallbackLng: {
@@ -46,7 +46,7 @@ const i18nOptions = {
4646
},
4747

4848
backend: {
49-
loadPath: ROOT_URL_PATH_PREFIX + '/locales/{{lng}}/{{ns}}.json',
49+
loadPath: relativeToSiteRootUrl('/locales/{{lng}}/{{ns}}.json'),
5050
},
5151

5252
detection: {

packages/webui/src/main.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import './client/lib/uncaughtErrorHandler'
1717
import './client/lib/dev'
1818
import './client/lib/systemTime'
1919

20-
import { ROOT_URL_PATH_PREFIX } from './client/url'
20+
import { relativeToSiteRootUrl } from './client/url'
2121
import App from './client/ui/App'
2222
import { logger } from './client/lib/logging'
2323
import './client/lib/logStatus'
@@ -27,7 +27,7 @@ if ('serviceWorker' in navigator) {
2727
window.addEventListener('load', () => {
2828
// in some versions of Chrome, registering the Service Worker over HTTP throws an arror
2929
if (window.location.protocol === 'https:' || window.location.hostname === 'localhost') {
30-
navigator.serviceWorker.register(ROOT_URL_PATH_PREFIX + '/sw.js').catch((err) => {
30+
navigator.serviceWorker.register(relativeToSiteRootUrl('/sw.js')).catch((err) => {
3131
logger.error('Error registering serviceWorker', err)
3232
})
3333
}

0 commit comments

Comments
 (0)