All files / apps/host/src/components/ChartRequest ChartRequestActivityItem.tsx

100% Statements 5/5
100% Branches 0/0
100% Functions 2/2
100% Lines 4/4

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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54                      4x 14x   14x                     14x                                                        
import { Text, View } from 'react-native';
 
import { makeStyles } from '@repo/ui/themes/makeStyles';
import { textStyles } from '@repo/ui/themes/typography';
 
import type { ChartRequestColoredActivity } from './types';
 
interface ChartRequestActivityItemProps {
  activity: ChartRequestColoredActivity;
}
 
export const ChartRequestActivityItem = ({ activity }: ChartRequestActivityItemProps) => {
  const styles = useStyles();
 
  return (
    <View style={styles.activityItem}>
      <View style={[styles.activityBar, { backgroundColor: activity.color }]} />
      <View style={styles.activityTextWrap}>
        <Text style={styles.activityValue}>{activity.count}</Text>
        <Text style={styles.activityLabel}>{activity.label}</Text>
      </View>
    </View>
  );
};
 
const useStyles = makeStyles(theme => ({
  activityItem: {
    flex: 1,
    flexDirection: 'row',
    gap: theme.metrics.spacing[1.5],
    alignItems: 'flex-start',
  },
  activityBar: {
    width: theme.metrics.spacing[1.5],
    height: theme.metrics.spacing[12.5],
    borderRadius: theme.metrics.borderRadius[1],
  },
  activityTextWrap: {
    gap: theme.metrics.spacing[0.25],
  },
  activityValue: {
    ...textStyles.content.medium,
    color: theme.colors.text.heading,
    fontSize: theme.metrics.textSize[30],
    lineHeight: theme.metrics.spacing[8.5],
  },
  activityLabel: {
    ...textStyles.content.medium,
    color: theme.colors.text.heading,
    fontSize: theme.metrics.textSize[16],
    lineHeight: theme.metrics.spacing[4.5],
  },
}));