File tree 4 files changed +12
-3
lines changed
4 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ All notable changes to this project will be documented in this file.
9
9
- Fix save screen and go to list
10
10
- Disable eslint for proptypes
11
11
- Disable eslint for react in scope
12
+ - [ #284 ] ( https://github.com/os2display/display-admin-client/pull/284 )
13
+ - Fixed spacer calculations for previews.
14
+ - Added border to preview container
12
15
- [ #283 ] ( https://github.com/os2display/display-admin-client/pull/283 )
13
16
- Fixed preview issues.
14
17
- [ #275 ] ( https://github.com/os2display/display-admin-client/pull/275 )
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ function Preview({
57
57
width : `${ width } px` ,
58
58
height : `${ height } px` ,
59
59
overflow : "hidden" ,
60
+ border : "1px solid #aaa" ,
60
61
} }
61
62
>
62
63
< iframe
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ function RemoteComponentWrapper({
36
36
const [ remoteComponentSlide , setRemoteComponentSlide ] = useState ( null ) ;
37
37
const [ loading , err , Component ] = useRemoteComponent ( url ) ;
38
38
const [ runId , setRunId ] = useState ( "" ) ;
39
- const [ fontSizeEm , setFontSizeEm ] = useState ( 1 ) ;
39
+ const [ fontSizeRem , setFontSizeRem ] = useState ( 1 ) ;
40
40
41
41
/** Create remoteComponentSlide from slide and mediaData */
42
42
useEffect ( ( ) => {
@@ -90,7 +90,7 @@ function RemoteComponentWrapper({
90
90
if ( adjustFontSize ) {
91
91
if ( entries . length > 0 ) {
92
92
const first = entries [ 0 ] ;
93
- setFontSizeEm (
93
+ setFontSizeRem (
94
94
first . contentRect . width / ( orientation === "vertical" ? 1080 : 1920 )
95
95
) ;
96
96
}
@@ -109,7 +109,11 @@ function RemoteComponentWrapper({
109
109
const remoteComponentStyle = { } ;
110
110
111
111
if ( adjustFontSize ) {
112
- remoteComponentStyle [ "--font-size-base" ] = `${ fontSizeEm } rem` ;
112
+ // These sizes relate to:
113
+ // https://github.com/os2display/display-templates/blob/develop/src/global-styles.css#L100
114
+ // https://github.com/os2display/display-templates/blob/develop/src/global-styles.css#L126
115
+ remoteComponentStyle [ "--font-size-base" ] = `${ fontSizeRem } rem` ;
116
+ remoteComponentStyle [ "--spacer" ] = `${ fontSizeRem * 12 } px` ;
113
117
}
114
118
115
119
return (
Original file line number Diff line number Diff line change 1
1
.remote-component-wrapper {
2
2
width : 100% ;
3
3
height : 100% ;
4
+ border : 1px solid #aaa ;
4
5
5
6
.remote-component-content {
6
7
max-width : 100% ;
You can’t perform that action at this time.
0 commit comments