import _ from 'lodash'; import React, {Component} from 'react'; import {StyleSheet, ScrollView} from 'react-native'; import {Colors, View, Card, CardProps, Button, Text} from 'react-native-ui-lib'; // @ts-ignore import posts from '../../data/posts'; const featureIcon = require('../../assets/icons/star.png'); const shareIcon = require('../../assets/icons/share.png'); const cardImage = require('../../assets/images/card-example.jpg'); const cardImage2 = require('../../assets/images/empty-state.jpg'); type CardsScreenProps = {}; type CardsScreenState = { selected1: boolean; selected2: boolean; }; export default class CardsScreen extends Component { state = { selected1: true, selected2: true }; renderSelectableCards = () => { const {selected1, selected2} = this.state; return ( this.setState({selected1: !selected1})} activeOpacity={1} marginR-20 > this.setState({selected2: !selected2})} activeOpacity={1} selectionOptions={{ color: Colors.grey40, indicatorSize: 25, borderWidth: 3 }} > ); }; renderTextSection = () => { return ( ); }; renderText = () => { return ( You’re Invited! 222 Join Old The Town Barbershop Official Store. Download the Wix app to... wix.to/A465c ); }; renderHorizontalCard = (isImageOnLeft: boolean, borderRadius: number, useSection: boolean) => { return ( {}} borderRadius={borderRadius} bg-$backgroundElevated activeOpacity={1} activeScale={isImageOnLeft ? 0.96 : 1.04} > {isImageOnLeft && ( )} {useSection ? this.renderTextSection() : this.renderText()} {!isImageOnLeft && ( )} ); }; renderImageOnBottom = () => { return ( {}}> ); }; renderCoupon = (cardProps: CardProps) => { return ( {}} activeOpacity={1} activeScale={0.96}> ); }; renderCoupons = () => { return ( {/* @ts-expect-error */} {this.renderCoupon({'marginR-10': true})} {/* @ts-expect-error */} {this.renderCoupon({'marginL-10': true})} ); }; renderComplexImage = (cardProps: CardProps, image: React.ReactNode) => { return ( {}} activeOpacity={1} activeScale={0.96}> {image} ); }; renderComplexImages = () => { return ( { // Icon // @ts-expect-error this.renderComplexImage({'marginR-5': true}, ) } { // Image with overlay content // @ts-expect-error this.renderComplexImage({'marginL-5': true}, ) } ); }; renderNumbers = () => { return ( {_.times(4, i => { return ( {i} ); })} ); }; renderBackgroundCard = (cardProps: CardProps, body: React.ReactNode) => { return ( {body} ); }; renderComplexExample = () => { return _.map(posts, (post, i) => { const statusColor = post.status === 'Published' ? Colors.$textSuccess : Colors.$textMajor; return ( console.log('press on a card')} > {post.title} {post.status} | {post.timestamp} {post.description} {post.likes} Likes