UNPKG

@livelike/react-native

Version:

LiveLike React Native package

57 lines 1.5 kB
import React from 'react'; import { StyleSheet, View, Image } from 'react-native'; import { useStyles, useWidgetSponsors } from '../../hooks'; import { LLText } from '../LLText'; export function LLWidgetSponsor(_ref) { let { widgetId, styles: stylesProp } = _ref; const widgetSponsorStyles = useStyles({ componentStylesFn: getWidgetSponsorStyles, stylesProp }); const widgetSponsors = useWidgetSponsors({ widgetId }); const widgetSponsor = widgetSponsors === null || widgetSponsors === void 0 ? void 0 : widgetSponsors[0]; if (!widgetSponsor) { return undefined; } return /*#__PURE__*/React.createElement(View, { style: widgetSponsorStyles.container }, /*#__PURE__*/React.createElement(LLText, { style: widgetSponsorStyles.sponsorText }, "Sponsored by"), /*#__PURE__*/React.createElement(Image, { accessibilityLabel: widgetSponsor.name, source: { uri: widgetSponsor.logo_url }, style: widgetSponsorStyles.sponsorImage, resizeMode: "contain" })); } const getWidgetSponsorStyles = _ref2 => { let { theme } = _ref2; return StyleSheet.create({ container: { display: 'flex', flexDirection: 'row', justifyContent: 'center', alignItems: 'center', marginBottom: 12 }, sponsorText: { fontSize: 10, color: theme.text }, sponsorImage: { width: 60, height: 40, marginHorizontal: 12 } }); }; //# sourceMappingURL=LLWidgetSponsor.js.map