All files / src/components/settings SettingsIconCircle.tsx

100% Statements 3/3
100% Branches 1/1
100% Functions 1/1
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34                              11x 11x             3x                    
import React from "react";
import { StyleSheet, View } from "react-native";
import { Ionicons } from "@expo/vector-icons";
import type { ComponentProps } from "react";
import { useTheme } from "../../hooks/useTheme";
 
export type SettingsIconCircleProps = {
  name: ComponentProps<typeof Ionicons>["name"];
  size?: number;
};
 
export function SettingsIconCircle({
  name,
  size = 20,
}: Readonly<SettingsIconCircleProps>) {
  const { colors } = useTheme();
  return (
    <View style={[styles.circle, { backgroundColor: colors.primary }]}>
      <Ionicons name={name} size={size} color="#fff" />
    </View>
  );
}
 
const styles = StyleSheet.create({
  circle: {
    width: 40,
    height: 40,
    borderRadius: 20,
    alignItems: "center",
    justifyContent: "center",
    marginRight: 10,
  },
});