mirror of
https://github.com/cpvalente/ontime.git
synced 2026-09-02 04:49:05 +00:00
refactor(ui): title alignment is logo aware
This commit is contained in:
committed by
Carlos Valente
parent
76b1341432
commit
2050735014
@@ -39,9 +39,21 @@
|
|||||||
font-size: $header-font-size;
|
font-size: $header-font-size;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.project-header__brand {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 1rem;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.project-header__brand--without-logo {
|
||||||
|
align-self: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
max-width: min(200px, 20vw);
|
max-width: min(200px, 20vw);
|
||||||
}
|
}
|
||||||
@@ -195,10 +207,15 @@
|
|||||||
|
|
||||||
.project-header {
|
.project-header {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
position: relative;
|
position: relative;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.project-header__brand--without-logo {
|
||||||
|
align-self: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
.logo img {
|
.logo img {
|
||||||
height: min(50px, 10vh);
|
height: min(50px, 10vh);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,8 +107,10 @@ function Backstage({ events, customFields, projectData, isMirrored, settings }:
|
|||||||
<div className={`backstage ${isMirrored ? 'mirror' : ''}`} data-testid='backstage-view'>
|
<div className={`backstage ${isMirrored ? 'mirror' : ''}`} data-testid='backstage-view'>
|
||||||
<ViewParamsEditor target={OntimeView.Backstage} viewOptions={backstageOptions} />
|
<ViewParamsEditor target={OntimeView.Backstage} viewOptions={backstageOptions} />
|
||||||
<div className='project-header'>
|
<div className='project-header'>
|
||||||
{projectData?.logo && <ViewLogo name={projectData.logo} className='logo' />}
|
<div className={cx(['project-header__brand', !projectData?.logo && 'project-header__brand--without-logo'])}>
|
||||||
<div className='title'>{projectData.title}</div>
|
{projectData?.logo && <ViewLogo name={projectData.logo} className='logo' />}
|
||||||
|
<div className='title'>{projectData.title}</div>
|
||||||
|
</div>
|
||||||
<BackstageClock timeformat={timeformat} />
|
<BackstageClock timeformat={timeformat} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -23,9 +23,21 @@ $item-height: 3.5rem;
|
|||||||
font-size: $header-font-size;
|
font-size: $header-font-size;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.project-header__brand {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 1rem;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.project-header__brand--without-logo {
|
||||||
|
align-self: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
max-width: min(200px, 20vw);
|
max-width: min(200px, 20vw);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import ViewParamsEditor from '../../common/components/view-params-editor/ViewPar
|
|||||||
import { useAutoTickingClock } from '../../common/hooks/useAutoTickingClock';
|
import { useAutoTickingClock } from '../../common/hooks/useAutoTickingClock';
|
||||||
import { useWindowTitle } from '../../common/hooks/useWindowTitle';
|
import { useWindowTitle } from '../../common/hooks/useWindowTitle';
|
||||||
import { ExtendedEntry } from '../../common/utils/rundownMetadata';
|
import { ExtendedEntry } from '../../common/utils/rundownMetadata';
|
||||||
|
import { cx } from '../../common/utils/styleUtils';
|
||||||
import { formatTime, getDefaultFormat } from '../../common/utils/time';
|
import { formatTime, getDefaultFormat } from '../../common/utils/time';
|
||||||
import { useTranslation } from '../../translation/TranslationProvider';
|
import { useTranslation } from '../../translation/TranslationProvider';
|
||||||
import Loader from '../common/loader/Loader';
|
import Loader from '../common/loader/Loader';
|
||||||
@@ -80,8 +81,10 @@ function Countdown({ customFields, rundownData, projectData, isMirrored, setting
|
|||||||
<div className={`countdown ${isMirrored ? 'mirror' : ''}`} data-testid='countdown-view'>
|
<div className={`countdown ${isMirrored ? 'mirror' : ''}`} data-testid='countdown-view'>
|
||||||
<ViewParamsEditor target={OntimeView.Countdown} viewOptions={countdownOptions} />
|
<ViewParamsEditor target={OntimeView.Countdown} viewOptions={countdownOptions} />
|
||||||
<div className='project-header'>
|
<div className='project-header'>
|
||||||
{projectData?.logo && <ViewLogo name={projectData.logo} className='logo' />}
|
<div className={cx(['project-header__brand', !projectData?.logo && 'project-header__brand--without-logo'])}>
|
||||||
<div className='title'>{projectData.title}</div>
|
{projectData?.logo && <ViewLogo name={projectData.logo} className='logo' />}
|
||||||
|
<div className='title'>{projectData.title}</div>
|
||||||
|
</div>
|
||||||
<CountdownClock />
|
<CountdownClock />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -35,9 +35,21 @@
|
|||||||
font-size: $header-font-size;
|
font-size: $header-font-size;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.project-header__brand {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 1rem;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.project-header__brand--without-logo {
|
||||||
|
align-self: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
max-width: min(200px, 20vw);
|
max-width: min(200px, 20vw);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,8 +43,10 @@ function Studio({ customFields, projectData, isMirrored, settings, viewSettings
|
|||||||
<ViewParamsEditor target={OntimeView.StudioClock} viewOptions={studioOptions} />
|
<ViewParamsEditor target={OntimeView.StudioClock} viewOptions={studioOptions} />
|
||||||
|
|
||||||
<div className='project-header'>
|
<div className='project-header'>
|
||||||
{projectData?.logo && <ViewLogo name={projectData.logo} className='logo' />}
|
<div className={cx(['project-header__brand', !projectData?.logo && 'project-header__brand--without-logo'])}>
|
||||||
<div className='title'>{projectData.title}</div>
|
{projectData?.logo && <ViewLogo name={projectData.logo} className='logo' />}
|
||||||
|
<div className='title'>{projectData.title}</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={cx(['studio-contents', hideCards && 'studio-contents--onecol'])}>
|
<div className={cx(['studio-contents', hideCards && 'studio-contents--onecol'])}>
|
||||||
|
|||||||
@@ -20,9 +20,21 @@
|
|||||||
font-size: $header-font-size;
|
font-size: $header-font-size;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.project-header__brand {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 1rem;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.project-header__brand--without-logo {
|
||||||
|
align-self: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
max-width: min(200px, 20vw);
|
max-width: min(200px, 20vw);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import ViewParamsEditor from '../../common/components/view-params-editor/ViewPar
|
|||||||
import { useAutoTickingClock } from '../../common/hooks/useAutoTickingClock';
|
import { useAutoTickingClock } from '../../common/hooks/useAutoTickingClock';
|
||||||
import { useSelectedEventId } from '../../common/hooks/useSocket';
|
import { useSelectedEventId } from '../../common/hooks/useSocket';
|
||||||
import { useWindowTitle } from '../../common/hooks/useWindowTitle';
|
import { useWindowTitle } from '../../common/hooks/useWindowTitle';
|
||||||
|
import { cx } from '../../common/utils/styleUtils';
|
||||||
import { formatTime, getDefaultFormat } from '../../common/utils/time';
|
import { formatTime, getDefaultFormat } from '../../common/utils/time';
|
||||||
import { useTranslation } from '../../translation/TranslationProvider';
|
import { useTranslation } from '../../translation/TranslationProvider';
|
||||||
import Loader from '../common/loader/Loader';
|
import Loader from '../common/loader/Loader';
|
||||||
@@ -59,8 +60,10 @@ function TimelinePage({ events, customFields, projectData, settings }: TimelineD
|
|||||||
<div className='timeline' data-testid='timeline-view'>
|
<div className='timeline' data-testid='timeline-view'>
|
||||||
<ViewParamsEditor target={OntimeView.Timeline} viewOptions={progressOptions} />
|
<ViewParamsEditor target={OntimeView.Timeline} viewOptions={progressOptions} />
|
||||||
<div className='project-header'>
|
<div className='project-header'>
|
||||||
{projectData?.logo && <ViewLogo name={projectData.logo} className='logo' />}
|
<div className={cx(['project-header__brand', !projectData?.logo && 'project-header__brand--without-logo'])}>
|
||||||
<div className='title'>{projectData.title}</div>
|
{projectData?.logo && <ViewLogo name={projectData.logo} className='logo' />}
|
||||||
|
<div className='title'>{projectData.title}</div>
|
||||||
|
</div>
|
||||||
<TimelineClock timeformat={timeformat} />
|
<TimelineClock timeformat={timeformat} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user