MCPcopy
hub / github.com/callstack/react-native-paper / getCardCoverStyle

Function getCardCoverStyle

src/components/Card/utils.tsx:21–67  ·  view source on GitHub ↗
({
  theme,
  index,
  total,
  borderRadiusStyles,
}: {
  theme: InternalTheme;
  borderRadiusStyles: BorderRadiusStyles;
  index?: number;
  total?: number;
})

Source from the content-addressed store, hash-verified

19};
20
21export const getCardCoverStyle = ({
22 theme,
23 index,
24 total,
25 borderRadiusStyles,
26}: {
27 theme: InternalTheme;
28 borderRadiusStyles: BorderRadiusStyles;
29 index?: number;
30 total?: number;
31}) => {
32 const { isV3, roundness } = theme;
33
34 if (Object.keys(borderRadiusStyles).length > 0) {
35 return {
36 borderRadius: 3 * roundness,
37 ...borderRadiusStyles,
38 };
39 }
40
41 if (isV3) {
42 return {
43 borderRadius: 3 * roundness,
44 };
45 }
46
47 if (index === 0) {
48 if (total === 1) {
49 return {
50 borderRadius: roundness,
51 };
52 }
53
54 return {
55 borderTopLeftRadius: roundness,
56 borderTopRightRadius: roundness,
57 };
58 }
59
60 if (typeof total === 'number' && index === total - 1) {
61 return {
62 borderBottomLeftRadius: roundness,
63 };
64 }
65
66 return undefined;
67};
68
69const getBorderColor = ({ theme }: { theme: InternalTheme }) => {
70 if (theme.isV3) {

Callers 2

CardCoverFunction · 0.90
Card.test.tsxFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…