mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 06:59:31 +01:00
feat: new announcements and dialog
This commit is contained in:
@@ -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} />;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user