Skip to content

Commit 4d58ce8

Browse files
committed
feat: implement Layer colors in group selectors
1 parent 091af40 commit 4d58ce8

File tree

2 files changed

+12
-48
lines changed

2 files changed

+12
-48
lines changed

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

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@import '../styles/itemTypeColors';
12
@import '_colorScheme';
23
@import '_variables';
34

@@ -121,7 +122,11 @@
121122
margin-top: 0.5em;
122123
margin-bottom: 0.5em;
123124

125+
126+
124127
> .propertiespanel-pop-up__groupselector__button {
128+
@include item-type-colors();
129+
125130
width: 50px;
126131
height: 30px;
127132
border: 0px;
@@ -132,6 +137,8 @@
132137
}
133138

134139
> .propertiespanel-pop-up__groupselector__button-active {
140+
@include item-type-colors();
141+
135142
width: 50px;
136143
height: 30px;
137144
border: 0px;
@@ -141,39 +148,6 @@
141148
opacity: 1;
142149
}
143150

144-
> .propertiespanel-pop-up__groupselector__button-svg {
145-
width: 50px;
146-
height: 30px;
147-
border: 0;
148-
margin: 3px;
149-
color: #ddd;
150-
padding: 0;
151-
display: flex;
152-
align-items: center;
153-
justify-content: center;
154-
opacity: 0.2; // default state
155-
156-
&-active {
157-
@extend .propertiespanel-pop-up__groupselector__button-svg;
158-
opacity: 1;
159-
}
160-
161-
> .svg-icon {
162-
width: 100%;
163-
height: 100%;
164-
margin-top: -1px;
165-
display: flex;
166-
align-items: center;
167-
justify-content: center;
168-
169-
svg {
170-
width: 100%;
171-
height: 100%;
172-
display: block;
173-
}
174-
}
175-
}
176-
177151
}
178152

179153
> .propertiespanel-pop-up__action {

packages/webui/src/client/ui/UserEditOperations/PropertiesPanel.tsx

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@ import { DBSegment } from '@sofie-automation/corelib/dist/dataModel/Segment'
2727
import { DBPart } from '@sofie-automation/corelib/dist/dataModel/Part'
2828
import { RundownId } from '@sofie-automation/corelib/dist/dataModel/Ids'
2929
import { SchemaFormInPlace } from '../../lib/forms/SchemaFormInPlace'
30+
import { RundownUtils } from '../../lib/rundown'
3031

3132
interface PendingChange {
3233
operationId: string
3334
userEditingType: UserEditingType
3435
sourceLayerType?: SourceLayerType
3536
value?: Record<string, any>
3637
switchState?: boolean
38+
cssTypeClass?: string
3739
}
3840

3941
export function PropertiesPanel(): JSX.Element {
@@ -449,12 +451,12 @@ function EditingTypeChangeSourceLayerSource(props: {
449451
{Object.values<UserEditingSourceLayer>(groups).map((group, index) => {
450452
return (
451453
<button
452-
className={
454+
className={classNames(
455+
RundownUtils.getSourceLayerClassName(group.sourceLayerType),
453456
selectedSourceGroup !== group.sourceLayerType
454457
? `propertiespanel-pop-up__groupselector__button`
455458
: `propertiespanel-pop-up__groupselector__button-active`
456-
}
457-
style={{ backgroundColor: 'blue' }}
459+
)}
458460
key={index}
459461
onClick={() => {
460462
setSelectedSourceButton(group.sourceLayerType)
@@ -474,18 +476,6 @@ function EditingTypeChangeSourceLayerSource(props: {
474476
translationNamespaces={props.userEditOperation.translationNamespaces}
475477
/>
476478
<br />
477-
{/* <select
478-
title="Sources in the selected group"
479-
className="propertiespanel-pop-up__select"
480-
value={selectedSource[selectedGroup] || ''}
481-
onChange={handleSourceChange}
482-
>
483-
{sourceList.enum.map((source, index) => (
484-
<option key={index} value={source}>
485-
{sourceList.tsEnumNames[index]}
486-
</option>
487-
))}
488-
</select> */}
489479
<hr />
490480
</div>
491481
)}

0 commit comments

Comments
 (0)