2021-11-11 13:08:28 +05:00
|
|
|
import React from 'react';
|
|
|
|
|
import {ScrollView, View} from 'react-native';
|
|
|
|
|
import {useTracked} from '../../provider';
|
|
|
|
|
import {SIZE} from '../../utils/SizeUtils';
|
|
|
|
|
import Heading from '../Typography/Heading';
|
|
|
|
|
import Paragraph from '../Typography/Paragraph';
|
|
|
|
|
import {FeatureBlock} from './feature';
|
|
|
|
|
import {ProTag} from './pro-tag';
|
|
|
|
|
|
|
|
|
|
export const Group = ({item, index}) => {
|
|
|
|
|
const [state] = useTracked();
|
|
|
|
|
const colors = state.colors;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<View
|
|
|
|
|
style={{
|
2021-11-19 11:18:30 +05:00
|
|
|
paddingHorizontal: 12,
|
2021-11-11 13:08:28 +05:00
|
|
|
paddingVertical: 8,
|
|
|
|
|
backgroundColor: index % 2 !== 0 ? colors.bg : colors.nav,
|
|
|
|
|
paddingVertical: 40
|
|
|
|
|
}}>
|
2021-12-03 09:34:44 +05:00
|
|
|
{item?.pro ? (
|
2021-11-11 13:08:28 +05:00
|
|
|
<ProTag
|
|
|
|
|
size={SIZE.sm}
|
|
|
|
|
background={index % 2 === 0 ? colors.bg : colors.nav}
|
|
|
|
|
/>
|
2021-12-03 09:34:44 +05:00
|
|
|
) : null}
|
2021-11-11 13:08:28 +05:00
|
|
|
<Heading>{item.title}</Heading>
|
|
|
|
|
<Paragraph size={SIZE.md}>{item.detail}</Paragraph>
|
|
|
|
|
|
|
|
|
|
{item.features && (
|
|
|
|
|
<ScrollView
|
|
|
|
|
style={{
|
|
|
|
|
marginTop: 20
|
|
|
|
|
}}
|
|
|
|
|
horizontal
|
|
|
|
|
showsHorizontalScrollIndicator={false}>
|
|
|
|
|
{item.features?.map(item => (
|
|
|
|
|
<FeatureBlock
|
|
|
|
|
{...item}
|
|
|
|
|
detail={item.detail}
|
|
|
|
|
pro={item.pro}
|
|
|
|
|
proTagBg={index % 2 === 0 ? colors.bg : colors.nav}
|
|
|
|
|
/>
|
|
|
|
|
))}
|
|
|
|
|
</ScrollView>
|
|
|
|
|
)}
|
|
|
|
|
{item.info ? (
|
|
|
|
|
<Paragraph
|
|
|
|
|
style={{
|
|
|
|
|
marginTop: 10
|
|
|
|
|
}}
|
2021-12-16 10:20:34 +05:00
|
|
|
size={SIZE.xs}
|
2021-11-11 13:08:28 +05:00
|
|
|
color={colors.icon}>
|
|
|
|
|
{item.info}
|
|
|
|
|
</Paragraph>
|
|
|
|
|
) : null}
|
|
|
|
|
</View>
|
|
|
|
|
);
|
|
|
|
|
};
|