Skip to content
This repository was archived by the owner on Feb 17, 2022. It is now read-only.

Conversation

@Demuzx
Copy link

@Demuzx Demuzx commented Dec 3, 2019

const cards = [
  {id: 1, text: 'UzCard', number: '1234123412341234'},
  {id: 2, text: 'Visa', number: '1234123412341234'},
  {id: 3, text: 'MasterCard', number: '1234123412341234'},
  {id: 4, text: 'MasterCard2', number: '1234123412341234'},
  {id: 5, text: 'MasterCard3', number: '1234123412341234'},
  {id: 6, text: 'MasterCard4', number: '1234123412341234'},
];

const PlasticCard = ({color, size, text}) => (
  <View style={{backgroundColor: color || 'red', width: size, height: size || 100, transform: [{ rotate: '-90deg' }]}}>
    <Text>{text}</Text>
  </View>
);

export default class App extends Component {
  render() {
    return (
      <SafeAreaView style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}>
      <Coverflow
        vertical={true}
        style={{width: 100, height: 100, transform: [{ rotate: '90deg' }]}}
        onChange={(index) => console.log('Current item', index)}
      >
        {
          cards.map((card, i) =>
            <PlasticCard
              key={i.toString()}
              text={card.text}
              size={100}
            />
          )
        }
      </Coverflow>
      </SafeAreaView>
    );
  }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant