File tree Expand file tree Collapse file tree 3 files changed +19
-17
lines changed
src/components/global/Playground Expand file tree Collapse file tree 3 files changed +19
-17
lines changed Original file line number Diff line number Diff line change @@ -473,14 +473,14 @@ export default function Playground({
473
473
< div className = "playground__console" ref = { consoleRef } >
474
474
{ ( ionicMode === Mode . iOS ? iosConsoleItems : mdConsoleItems ) . map ( ( consoleItem , i ) => (
475
475
< div key = { i } className = { `playground__console-item playground__console-item--${ consoleItem . type } ` } >
476
- { consoleItem . type !== 'log' && < div className = "playground__console-icon" >
477
- { consoleItem . type === 'warning' ? '⚠' : '❌' }
478
- </ div > }
476
+ { consoleItem . type !== 'log' && (
477
+ < div className = "playground__console-icon" > { consoleItem . type === 'warning' ? '⚠' : '❌' } </ div >
478
+ ) }
479
479
< code > { consoleItem . message } </ code >
480
480
</ div >
481
481
) ) }
482
482
</ div >
483
- )
483
+ ) ;
484
484
}
485
485
486
486
const sortedUsageTargets = useMemo ( ( ) => Object . keys ( UsageTarget ) . sort ( ) , [ ] ) ;
Original file line number Diff line number Diff line change @@ -11,6 +11,6 @@ export enum Mode {
11
11
}
12
12
13
13
export interface ConsoleItem {
14
- type : 'log' | 'warning' | 'error' ,
15
- message : string
16
- }
14
+ type : 'log' | 'warning' | 'error' ;
15
+ message : string ;
16
+ }
Original file line number Diff line number Diff line change @@ -32,25 +32,27 @@ window.addEventListener('DOMContentLoaded', () => {
32
32
_error = console . error ;
33
33
34
34
const dispatchConsoleEvent = ( type , arguments ) => {
35
- window . dispatchEvent ( new CustomEvent ( 'console' , {
36
- detail : {
37
- type,
38
- message : Object . values ( arguments ) . join ( ' ' )
39
- }
40
- } ) ) ;
41
- }
35
+ window . dispatchEvent (
36
+ new CustomEvent ( 'console' , {
37
+ detail : {
38
+ type,
39
+ message : Object . values ( arguments ) . join ( ' ' ) ,
40
+ } ,
41
+ } )
42
+ ) ;
43
+ } ;
42
44
43
- console . log = function ( ) {
45
+ console . log = function ( ) {
44
46
dispatchConsoleEvent ( 'log' , arguments ) ;
45
47
return _log . apply ( console , arguments ) ;
46
48
} ;
47
49
48
- console . warn = function ( ) {
50
+ console . warn = function ( ) {
49
51
dispatchConsoleEvent ( 'warning' , arguments ) ;
50
52
return _warn . apply ( console , arguments ) ;
51
53
} ;
52
54
53
- console . error = function ( ) {
55
+ console . error = function ( ) {
54
56
dispatchConsoleEvent ( 'error' , arguments ) ;
55
57
return _error . apply ( console , arguments ) ;
56
58
} ;
You can’t perform that action at this time.
0 commit comments