-
Notifications
You must be signed in to change notification settings - Fork 0
/
AppCard.tsx
36 lines (31 loc) 路 968 Bytes
/
AppCard.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
import { Body2, NavigationActions, PluginIcon, TouchableItem, View } from '@bluebase/components';
import { Plugin, getComponent } from '@bluebase/core';
import React from 'react';
const DefaultIcon = getComponent('LauncherDefaultIcon');
export interface AppCardProps {
plugin: Plugin;
size: number;
}
export const AppCard = ({ plugin, size }: AppCardProps) => (
<NavigationActions>
{({ navigate }) => {
const onPress = () => navigate(plugin.indexRoute!);
return (
<TouchableItem onPress={onPress}>
<View style={{ alignItems: 'center', marginVertical: 8 }}>
<View style={{ height: size, width: size }}>
{!!plugin.icon ? (
<PluginIcon id={plugin.key} size={size} />
) : (
<DefaultIcon size={size} />
)}
</View>
<Body2 style={{ paddingTop: 8 }} ellipsizeMode="tail" numberOfLines={1}>
{plugin.name}
</Body2>
</View>
</TouchableItem>
);
}}
</NavigationActions>
);