Skip to content

Commit f75e20f

Browse files
feat: integrate fab button into shape system
1 parent 3273819 commit f75e20f

4 files changed

Lines changed: 19 additions & 1 deletion

File tree

src/core/model/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ export type ShapeType =
8484
| 'rectangleLow'
8585
| 'circleLow'
8686
| 'textScribbled'
87-
| 'paragraphScribbled';
87+
| 'paragraphScribbled'
88+
| 'fabButton';
8889

8990
export const ShapeDisplayName: Record<ShapeType, string> = {
9091
multiple: 'multiple',
@@ -158,6 +159,7 @@ export const ShapeDisplayName: Record<ShapeType, string> = {
158159
circleLow: 'Circle',
159160
textScribbled: 'Text Scribbled',
160161
paragraphScribbled: 'Paragraph Scribbled',
162+
fabButton: 'Fab Button',
161163
};
162164

163165
export type EditType = 'input' | 'textarea' | 'imageupload';

src/pods/canvas/model/shape-other-props.utils.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,17 @@ export const generateDefaultOtherProps = (
7575
stroke: '#808080',
7676
textColor: BASIC_SHAPE.DEFAULT_FILL_TEXT,
7777
};
78+
case 'fabButton':
79+
return {
80+
icon: {
81+
name: 'chat',
82+
filename: 'chat.svg',
83+
searchTerms: ['chat', 'message', 'conversation', 'chatting'],
84+
categories: ['IT'],
85+
},
86+
stroke: '#ffffff',
87+
backgroundColor: '#A9A9A9',
88+
};
7889
case 'buttonBar':
7990
return {
8091
stroke: BASIC_SHAPE.DEFAULT_STROKE_COLOR,

src/pods/canvas/model/shape-size.mapper.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ import {
6464
getVideoPlayerShapeSizeRestrictions,
6565
getVideoconferenceShapeSizeRestrictions,
6666
getGaugeShapeSizeRestrictions,
67+
getFabButtonShapeSizeRestrictions,
6768
// other imports
6869
} from '@/common/components/mock-components/front-rich-components';
6970
import {
@@ -171,6 +172,7 @@ const shapeSizeMap: Record<ShapeType, () => ShapeSizeRestrictions> = {
171172
circleLow: getCircleLowShapeSizeRestrictions,
172173
textScribbled: getTextScribbledShapeRestrictions,
173174
paragraphScribbled: getParagraphScribbledShapeRestrictions,
175+
fabButton: getFabButtonShapeSizeRestrictions,
174176
};
175177

176178
export default shapeSizeMap;

src/pods/canvas/shape-renderer/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import {
4848
renderCalendar,
4949
renderAppBar,
5050
renderLoadingIndicator,
51+
renderFabButton,
5152
} from './simple-rich-components';
5253
import {
5354
renderDiamond,
@@ -209,6 +210,8 @@ export const renderShapeComponent = (
209210
return renderLoadingIndicator(shape, shapeRenderedProps);
210211
case 'videoconference':
211212
return renderVideoconference(shape, shapeRenderedProps);
213+
case 'fabButton':
214+
return renderFabButton(shape, shapeRenderedProps);
212215
case 'gauge':
213216
return renderGauge(shape, shapeRenderedProps);
214217
case 'imagePlaceholder':

0 commit comments

Comments
 (0)