-
Notifications
You must be signed in to change notification settings - Fork 2
/
ModuleSummary.tsx
41 lines (38 loc) · 1.02 KB
/
ModuleSummary.tsx
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
import React from "react";
import { View } from "react-native";
import { useIOTheme } from "../../core";
import { IOIcons, Icon } from "../icons";
import { H6, BodySmall } from "../typography";
import {
PressableModuleBase,
PressableModuleBaseProps
} from "./PressableModuleBase";
type Props = {
label: string;
description?: string;
onPress: PressableModuleBaseProps["onPress"];
icon?: IOIcons;
};
export const ModuleSummary = ({
label,
description,
onPress,
icon = "info"
}: Props) => {
const theme = useIOTheme();
return (
<PressableModuleBase onPress={onPress}>
<View style={{ flexGrow: 1, flexShrink: 1 }}>
<H6 color={theme["textBody-default"]}>{label}</H6>
{description && (
<BodySmall weight="Regular" color={theme["textBody-tertiary"]}>
{description}
</BodySmall>
)}
</View>
<View style={{ marginLeft: 8 }}>
<Icon name={icon} color={theme["interactiveElem-default"]} size={24} />
</View>
</PressableModuleBase>
);
};