MCPcopy Create free account
hub / github.com/callstack/react-native-paper / getFabStyle

Function getFabStyle

src/components/FAB/utils.ts:379–407  ·  view source on GitHub ↗
({
  size,
  theme,
  customSize,
}: {
  customSize?: number;
  size: 'small' | 'medium' | 'large';
  theme: InternalTheme;
})

Source from the content-addressed store, hash-verified

377});
378
379export const getFabStyle = ({
380 size,
381 theme,
382 customSize,
383}: {
384 customSize?: number;
385 size: 'small' | 'medium' | 'large';
386 theme: InternalTheme;
387}) => {
388 const { isV3, roundness } = theme;
389
390 if (customSize) return getCustomFabSize(customSize, roundness);
391
392 if (isV3) {
393 switch (size) {
394 case 'small':
395 return { ...v3SmallSize, borderRadius: 3 * roundness };
396 case 'medium':
397 return { ...v3MediumSize, borderRadius: 4 * roundness };
398 case 'large':
399 return { ...v3LargeSize, borderRadius: 7 * roundness };
400 }
401 }
402
403 if (size === 'small') {
404 return smallSize;
405 }
406 return standardSize;
407};
408
409const extended = {
410 height: 48,

Callers 1

FAB.tsxFile · 0.90

Calls 1

getCustomFabSizeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…