({
theme,
index,
total,
borderRadiusStyles,
}: {
theme: InternalTheme;
borderRadiusStyles: BorderRadiusStyles;
index?: number;
total?: number;
})
| 19 | }; |
| 20 | |
| 21 | export 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 | |
| 69 | const getBorderColor = ({ theme }: { theme: InternalTheme }) => { |
| 70 | if (theme.isV3) { |
no outgoing calls
no test coverage detected
searching dependent graphs…