Files
notesnook/apps/mobile/src/components/premium/compactfeatures.js

70 lines
1.6 KiB
JavaScript
Raw Normal View History

2021-11-15 15:24:37 +05:00
import React from 'react';
2022-01-22 12:57:05 +05:00
import { ScrollView } from 'react-native';
import { FeatureBlock } from './feature';
2021-11-15 15:24:37 +05:00
2022-01-22 12:57:05 +05:00
export const CompactFeatures = ({ vertical, features = [], maxHeight = 500, scrollRef }) => {
let data = vertical
? features
: [
{
highlight: 'Everything',
content: 'in basic',
icon: 'emoticon-wink'
},
{
highlight: 'Unlimited',
content: 'notebooks',
icon: 'notebook'
},
{
highlight: 'File & image',
content: 'attachments',
icon: 'attachment'
},
{
highlight: 'Instant',
content: 'syncing',
icon: 'sync'
},
{
highlight: 'Private',
content: 'vault',
icon: 'shield'
},
{
highlight: 'Rich text',
content: 'editing',
icon: 'square-edit-outline'
},
{
highlight: 'PDF & markdown',
content: 'exports',
icon: 'file'
},
{
highlight: 'Encrypted',
content: 'backups',
icon: 'backup-restore'
}
];
2021-11-15 15:24:37 +05:00
return (
<ScrollView
horizontal={!vertical}
2022-01-22 12:57:05 +05:00
nestedScrollEnabled
onMomentumScrollEnd={() => {
scrollRef?.current?.handleChildScrollEnd();
}}
2021-11-15 15:24:37 +05:00
showsHorizontalScrollIndicator={false}
style={{
width: '100%',
2022-01-22 12:57:05 +05:00
maxHeight: maxHeight
}}
>
2021-11-15 15:24:37 +05:00
{data.map(item => (
2022-01-22 12:57:05 +05:00
<FeatureBlock key={item.highlight} vertical={vertical} {...item} />
2021-11-15 15:24:37 +05:00
))}
</ScrollView>
);
};