File tree Expand file tree Collapse file tree 3 files changed +57
-28
lines changed
packages/app/src/app/pages/Sandbox/Editor/Content/Preview/DevTools Expand file tree Collapse file tree 3 files changed +57
-28
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
22import Console from 'app/components/Preview/DevTools/Console' ;
33
4+ import VerticalAlign from 'app/src/app/components/Preview/Navigator/VerticalAlign' ;
5+ import HorizontalAlign from 'app/src/app/components/Preview/Navigator/HorizontalAlign' ;
6+
47import Navigator from './Navigator' ;
58
6- export default ( { alignRight, alignBottom } ) => (
7- < div style = { { height : '100%' } } >
8- < Navigator
9- alignRight = { alignRight }
10- alignBottom = { alignBottom }
11- title = "Console"
12- />
13- < Console . Content />
14- </ div >
15- ) ;
9+ export default ( { alignRight, alignBottom } ) => {
10+ const actions = [
11+ ...Console . actions ,
12+ {
13+ title : 'Align To Bottom' ,
14+ onClick : alignBottom ,
15+ Icon : HorizontalAlign ,
16+ } ,
17+ {
18+ title : 'Align To Right' ,
19+ onClick : alignRight ,
20+ Icon : VerticalAlign ,
21+ } ,
22+ ] ;
23+ return (
24+ < div style = { { height : '100%' } } >
25+ < Navigator title = "Console" actions = { actions } />
26+ < Console . Content />
27+ </ div >
28+ ) ;
29+ } ;
Original file line number Diff line number Diff line change 11import React from 'react' ;
22import styled from 'styled-components' ;
33
4- import VerticalAlign from 'app/src/app/components/Preview/Navigator/VerticalAlign' ;
5- import HorizontalAlign from 'app/src/app/components/Preview/Navigator/HorizontalAlign' ;
4+ import Tooltip from 'common/components/Tooltip' ;
65
76const Container = styled . div `
87 display: flex;
@@ -24,7 +23,7 @@ const Title = styled.div`
2423 flex: 1;
2524` ;
2625
27- const Icons = styled . div `
26+ const Actions = styled . div `
2827 z-index: 20;
2928 svg {
3029 transition: 0.3s ease color;
@@ -37,12 +36,15 @@ const Icons = styled.div`
3736 }
3837` ;
3938
40- export default ( { title, alignBottom , alignRight } ) => (
39+ export default ( { title, actions } ) => (
4140 < Container className = "flying-container-handler" >
4241 < Title > { title } </ Title >
43- < Icons >
44- < HorizontalAlign onClick = { alignBottom } />
45- < VerticalAlign onClick = { alignRight } />
46- </ Icons >
42+ < Actions >
43+ { actions . map ( ( { title : actionTitle , onClick, Icon } ) => (
44+ < Tooltip title = { actionTitle } key = { actionTitle } >
45+ < Icon onClick = { onClick } key = { actionTitle } />
46+ </ Tooltip >
47+ ) ) }
48+ </ Actions >
4749 </ Container >
4850) ;
Original file line number Diff line number Diff line change 11import React from 'react' ;
22import Tests from 'app/components/Preview/DevTools/Tests' ;
33
4+ import VerticalAlign from 'app/src/app/components/Preview/Navigator/VerticalAlign' ;
5+ import HorizontalAlign from 'app/src/app/components/Preview/Navigator/HorizontalAlign' ;
6+
47import Navigator from './Navigator' ;
58
6- export default ( { alignRight, alignBottom } ) => (
7- < div >
8- < Navigator
9- alignRight = { alignRight }
10- alignBottom = { alignBottom }
11- title = "Tests"
12- />
13- < Tests . Content standalone />
14- </ div >
15- ) ;
9+ export default ( { alignRight, alignBottom } ) => {
10+ const actions = [
11+ {
12+ title : 'Align To Bottom' ,
13+ onClick : alignBottom ,
14+ Icon : HorizontalAlign ,
15+ } ,
16+ {
17+ title : 'Align To Right' ,
18+ onClick : alignRight ,
19+ Icon : VerticalAlign ,
20+ } ,
21+ ] ;
22+ return (
23+ < div >
24+ < Navigator title = "Tests" actions = { actions } />
25+ < Tests . Content standalone />
26+ </ div >
27+ ) ;
28+ } ;
You can’t perform that action at this time.
0 commit comments