Ver código fonte

improves mobile layout

main
Steve Ruiz 4 anos atrás
pai
commit
492d3e9769

+ 2
- 2
components/shared.tsx Ver arquivo

40
         height: 44,
40
         height: 44,
41
         width: 44,
41
         width: 44,
42
         '& > svg': {
42
         '& > svg': {
43
-          height: '16px',
44
-          width: '16px',
43
+          height: '20px',
44
+          width: '20px',
45
         },
45
         },
46
       },
46
       },
47
       large: {
47
       large: {

+ 15
- 13
components/tools-panel/tools-panel.tsx Ver arquivo

58
         <Container>
58
         <Container>
59
           <IconButton
59
           <IconButton
60
             name="select"
60
             name="select"
61
-            size={{ '@sm': 'small', '@md': 'large' }}
61
+            size={{ '@initial': 'small', '@sm': 'small', '@md': 'large' }}
62
             onClick={selectSelectTool}
62
             onClick={selectSelectTool}
63
             isActive={activeTool === 'select'}
63
             isActive={activeTool === 'select'}
64
           >
64
           >
68
         <Container>
68
         <Container>
69
           <IconButton
69
           <IconButton
70
             name={ShapeType.Draw}
70
             name={ShapeType.Draw}
71
-            size={{ '@sm': 'small', '@md': 'large' }}
71
+            size={{ '@initial': 'medium', '@sm': 'small', '@md': 'large' }}
72
             onClick={selectDrawTool}
72
             onClick={selectDrawTool}
73
             isActive={activeTool === ShapeType.Draw}
73
             isActive={activeTool === ShapeType.Draw}
74
           >
74
           >
76
           </IconButton>
76
           </IconButton>
77
           <IconButton
77
           <IconButton
78
             name={ShapeType.Rectangle}
78
             name={ShapeType.Rectangle}
79
-            size={{ '@sm': 'small', '@md': 'large' }}
79
+            size={{ '@initial': 'medium', '@sm': 'small', '@md': 'large' }}
80
             onClick={selectRectangleTool}
80
             onClick={selectRectangleTool}
81
             isActive={activeTool === ShapeType.Rectangle}
81
             isActive={activeTool === ShapeType.Rectangle}
82
           >
82
           >
84
           </IconButton>
84
           </IconButton>
85
           <IconButton
85
           <IconButton
86
             name={ShapeType.Circle}
86
             name={ShapeType.Circle}
87
-            size={{ '@sm': 'small', '@md': 'large' }}
87
+            size={{ '@initial': 'medium', '@sm': 'small', '@md': 'large' }}
88
             onClick={selectEllipseTool}
88
             onClick={selectEllipseTool}
89
             isActive={activeTool === ShapeType.Ellipse}
89
             isActive={activeTool === ShapeType.Ellipse}
90
           >
90
           >
92
           </IconButton>
92
           </IconButton>
93
           <IconButton
93
           <IconButton
94
             name={ShapeType.Arrow}
94
             name={ShapeType.Arrow}
95
-            size={{ '@sm': 'small', '@md': 'large' }}
95
+            size={{ '@initial': 'medium', '@sm': 'small', '@md': 'large' }}
96
             onClick={selectArrowTool}
96
             onClick={selectArrowTool}
97
             isActive={activeTool === ShapeType.Arrow}
97
             isActive={activeTool === ShapeType.Arrow}
98
           >
98
           >
100
           </IconButton>
100
           </IconButton>
101
           {/* <IconButton
101
           {/* <IconButton
102
             name={ShapeType.Circle}
102
             name={ShapeType.Circle}
103
-            size={{ '@sm': 'small', '@md': 'large' }}
103
+            size={{ '@initial': 'medium', '@sm': 'small', '@md': 'large' }}
104
             onClick={selectCircleTool}
104
             onClick={selectCircleTool}
105
             isActive={activeTool === ShapeType.Circle}
105
             isActive={activeTool === ShapeType.Circle}
106
           >
106
           >
108
           </IconButton> */}
108
           </IconButton> */}
109
           {/* <IconButton
109
           {/* <IconButton
110
             name={ShapeType.Line}
110
             name={ShapeType.Line}
111
-            size={{ '@sm': 'small', '@md': 'large' }}
111
+            size={{ '@initial': 'medium', '@sm': 'small', '@md': 'large' }}
112
             onClick={selectLineTool}
112
             onClick={selectLineTool}
113
             isActive={activeTool === ShapeType.Line}
113
             isActive={activeTool === ShapeType.Line}
114
           >
114
           >
116
           </IconButton>
116
           </IconButton>
117
           <IconButton
117
           <IconButton
118
             name={ShapeType.Ray}
118
             name={ShapeType.Ray}
119
-            size={{ '@sm': 'small', '@md': 'large' }}
119
+            size={{ '@initial': 'medium', '@sm': 'small', '@md': 'large' }}
120
             onClick={selectRayTool}
120
             onClick={selectRayTool}
121
             isActive={activeTool === ShapeType.Ray}
121
             isActive={activeTool === ShapeType.Ray}
122
           >
122
           >
124
           </IconButton>
124
           </IconButton>
125
           <IconButton
125
           <IconButton
126
             name={ShapeType.Dot}
126
             name={ShapeType.Dot}
127
-            size={{ '@sm': 'small', '@md': 'large' }}
127
+            size={{ '@initial': 'medium', '@sm': 'small', '@md': 'large' }}
128
             onClick={selectDotTool}
128
             onClick={selectDotTool}
129
             isActive={activeTool === ShapeType.Dot}
129
             isActive={activeTool === ShapeType.Dot}
130
           >
130
           >
133
         </Container>
133
         </Container>
134
         <Container>
134
         <Container>
135
           <IconButton
135
           <IconButton
136
-            size={{ '@sm': 'small', '@md': 'large' }}
136
+            size={{ '@initial': 'small', '@sm': 'small', '@md': 'large' }}
137
             onClick={selectToolLock}
137
             onClick={selectToolLock}
138
           >
138
           >
139
             {isToolLocked ? <LockClosedIcon /> : <LockOpen1Icon />}
139
             {isToolLocked ? <LockClosedIcon /> : <LockOpen1Icon />}
140
           </IconButton>
140
           </IconButton>
141
           {isPenLocked && (
141
           {isPenLocked && (
142
             <IconButton
142
             <IconButton
143
-              size={{ '@sm': 'small', '@md': 'large' }}
143
+              size={{ '@initial': 'small', '@sm': 'small', '@md': 'large' }}
144
               onClick={selectToolLock}
144
               onClick={selectToolLock}
145
             >
145
             >
146
               <Pencil2Icon />
146
               <Pencil2Icon />
161
   padding: '0 8px 12px 8px',
161
   padding: '0 8px 12px 8px',
162
   width: '100%',
162
   width: '100%',
163
   display: 'flex',
163
   display: 'flex',
164
-  alignItems: 'center',
164
+  alignItems: 'flex-end',
165
   justifyContent: 'center',
165
   justifyContent: 'center',
166
   flexWrap: 'wrap',
166
   flexWrap: 'wrap',
167
   gap: 16,
167
   gap: 16,
170
 
170
 
171
 const Flex = styled('div', {
171
 const Flex = styled('div', {
172
   display: 'flex',
172
   display: 'flex',
173
-  justifyContent: 'space-between',
174
   width: '100%',
173
   width: '100%',
175
   padding: '0 4px',
174
   padding: '0 4px',
175
+  justifyContent: 'space-between',
176
+  alignItems: 'flex-end',
176
 
177
 
177
   variants: {
178
   variants: {
178
     size: {
179
     size: {
179
       small: {
180
       small: {
180
         width: 'auto',
181
         width: 'auto',
181
         padding: '0',
182
         padding: '0',
183
+        justifyContent: 'center',
182
         '& > *:nth-child(n+2)': {
184
         '& > *:nth-child(n+2)': {
183
           marginLeft: 16,
185
           marginLeft: 16,
184
         },
186
         },

+ 3
- 0
components/tools-panel/undo-redo.tsx Ver arquivo

38
   boxShadow: '0px 2px 4px rgba(0,0,0,.12)',
38
   boxShadow: '0px 2px 4px rgba(0,0,0,.12)',
39
   display: 'flex',
39
   display: 'flex',
40
   padding: 4,
40
   padding: 4,
41
+  flexDirection: 'column',
41
 
42
 
42
   '& svg': {
43
   '& svg': {
43
     height: 13,
44
     height: 13,
48
     size: {
49
     size: {
49
       small: {
50
       small: {
50
         bottom: 12,
51
         bottom: 12,
52
+        flexDirection: 'row',
53
+        alignItems: 'center',
51
       },
54
       },
52
     },
55
     },
53
   },
56
   },

+ 12
- 6
components/tools-panel/zoom.tsx Ver arquivo

31
   )
31
   )
32
 }
32
 }
33
 
33
 
34
+const ZoomButton = styled(IconButton, {
35
+  fontSize: '$0',
36
+  padding: 8,
37
+})
38
+
34
 const Container = styled('div', {
39
 const Container = styled('div', {
35
   position: 'absolute',
40
   position: 'absolute',
36
   left: 12,
41
   left: 12,
46
   boxShadow: '0px 2px 4px rgba(0,0,0,.12)',
51
   boxShadow: '0px 2px 4px rgba(0,0,0,.12)',
47
   display: 'flex',
52
   display: 'flex',
48
   padding: 4,
53
   padding: 4,
54
+  flexDirection: 'column',
55
+  alignItems: 'center',
49
 
56
 
50
   '& svg': {
57
   '& svg': {
51
     strokeWidth: 0,
58
     strokeWidth: 0,
55
     size: {
62
     size: {
56
       small: {
63
       small: {
57
         bottom: 12,
64
         bottom: 12,
65
+        flexDirection: 'row',
66
+        alignItems: 'center',
67
+        [`& ${ZoomButton}`]: {
68
+          width: 44,
69
+        },
58
       },
70
       },
59
     },
71
     },
60
   },
72
   },
61
 })
73
 })
62
-
63
-const ZoomButton = styled(IconButton, {
64
-  fontSize: '$0',
65
-  padding: 8,
66
-  width: 44,
67
-})

+ 0
- 4
lib/shape-utils/index.tsx Ver arquivo

5
   Corner,
5
   Corner,
6
   Edge,
6
   Edge,
7
   ShapeStyles,
7
   ShapeStyles,
8
-  ShapeHandle,
9
   ShapeBinding,
8
   ShapeBinding,
10
-  BaseShape,
11
-  ShapeSpecificProps,
12
   Mutable,
9
   Mutable,
13
 } from 'types'
10
 } from 'types'
14
 import { v4 as uuid } from 'uuid'
11
 import { v4 as uuid } from 'uuid'
26
   getBoundsFromPoints,
23
   getBoundsFromPoints,
27
   getRotatedCorners,
24
   getRotatedCorners,
28
 } from 'utils/utils'
25
 } from 'utils/utils'
29
-import shape from 'components/canvas/shape'
30
 import {
26
 import {
31
   boundsCollidePolygon,
27
   boundsCollidePolygon,
32
   boundsContainPolygon,
28
   boundsContainPolygon,

Carregando…
Cancelar
Salvar