Upgrade to Pro — share decks privately, control downloads, hide ads and more …

「はやい、やすい、うまい?」React Native

「はやい、やすい、うまい?」React Native

kawasaki.rb #047の発表スライドです。

masaru-tech

April 26, 2017
Tweet

More Decks by masaru-tech

Other Decks in Programming

Transcript

  1. React Nativeͱ͸ ▸ Facebook੡ͷReact.jsϕʔεͰωΠςΟϒΞϓϦ͕࡞੒Ͱ͖ ΔϑϨʔϜϫʔΫ
 (React 3ܑఋͷ࣍உ) ▸ Webͷ஌ࣝ/ٕज़(JS, CSS

    LikeͳStyle, npm)Ͱ։ൃͰ͖Δ ▸ ΫϩεϓϥοτϑΥʔϜͰ͸ͳ͍
 (Learn once, write anywhereɿҰ౓ֶ΂͹ɺͲ͜Ͱ΋ॻ͚Δ)
  2. Viewͷྫ return ( <View style={styles.container}> <Image style={styles.thumbnail} source={{uri: "https://pbs.twimg.com/profile_images/ xxxxxxxxx.jpeg"}}/>

    <View style={styles.mainContainer}> <View style={styles.header}> <View style={styles.userInfo}> <Text style={styles.username}> {item.username} </Text> <Text style={styles.accountNo}> {item.accountNo} </Text> </View> <View> <Text style={styles.postedAt}> {item.postedAt} </Text> </View> </View> <View style={styles.messageContainer}> <Text> {item.message} </Text> </View> </View> </View> );
  3. const styles = StyleSheet.create({ container: { padding: 10, borderBottomColor: '#ededed',

    borderBottomWidth: 1, backgroundColor: 'transparent', flexDirection: 'row', }, thumbnail: { width: 34, height: 34, borderRadius: 17 }, mainContainer: { flex: 1, flexDirection: 'column', marginLeft: 10, }, header: { flexDirection: 'row', }, userInfo: { flex: 1, flexDirection: 'row' }, username: { fontSize: normalize(16), color: colors.grey1, fontWeight: '800' }, accountNo: { color: colors.grey3, fontSize: normalize(12), marginLeft: 5, marginTop: 3 }, postedAt: { color: colors.grey3, fontSize: normalize(12), marginTop: 3 }, messageContainer: { flexDirection: 'row', marginTop: 10 }, });