feat: new announcements and dialog

This commit is contained in:
ammarahm-ed
2021-11-23 15:06:35 +05:00
parent ff33619865
commit c6bd4d4f13
10 changed files with 533 additions and 334 deletions

View File

@@ -1,3 +1,19 @@
import React from 'react';
import {View} from 'react-native';
import {allowedPlatforms} from '../../provider/stores';
import {ProFeatures} from '../ResultDialog/pro-features';
import {Body} from './body';
import {Cta} from './cta';
import {Description} from './description';
import {List} from './list';
import {Photo} from './photo';
import {SubHeading} from './subheading';
import {Title} from './title';
export function allowedOnPlatform(platforms) {
return platforms.some(platform => allowedPlatforms.indexOf(platform) > -1);
}
export const margins = {
0: 0,
1: 12,
@@ -12,3 +28,34 @@ export const getStyle = style => {
textAlign: style.textAlign || 'left'
};
};
const Features = () => {
return (
<View
style={{
paddingHorizontal: 12,
alignItems: 'center',
width: '100%'
}}>
<ProFeatures />
</View>
);
};
const renderItems = {
title: Title,
description: Description,
body: Body,
cta: Cta,
image: Photo,
list: List,
subheading: SubHeading,
features: Features,
callToActions: Cta
};
export const renderItem = ({item, index, color}) => {
const Item = renderItems[item.type];
return <Item {...item} index={index} color={color} />;
};