【水滴石穿】AB-B-Clone
地址:
源码
运行效果

无别的效果,代码如下
//index.js
/**
* @format
* @lint-ignore-every XPLATJSCOPYRIGHT1
*/
import {AppRegistry} from 'react-native';
import App from './App';
AppRegistry.registerComponent('ABNB_clone', () => App);
import React, {Component} from 'react';
import { AppRegistry, View } from 'react-native';
import LoggedOut from './src/screens/LoggedOut';
// 登陆组件
class App extends Component {
render() {
return (
<View>
<LoggedOut />
</View>
)
}
}
AppRegistry.registerComponent('App', () => App);
export default App;
封装的RoundedButton组件
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Text, View, TouchableHighlight, StyleSheet} from 'react-native';
import colors from '../../styles/colors';
export default class RoundedButton extends Component {
render() {
const {
text,
textColor,
background,
handleOnPress,
icon
} = this.props;
const backgroundColor = background || 'transparent';
const color = textColor || colors.black;
return (
<TouchableHighlight
style={[{backgroundColor}, styles.wrapper]}
onPress={handleOnPress}
>
<View style={styles.buttonTextWrapper}>
{icon}
<Text style={[{color},styles.buttonText]}>{text}</Text>
</View>
</TouchableHighlight>
)
}
}
RoundedButton.PropTypes = {
text: PropTypes.string.isRequired,
textColor: PropTypes.string,
background: PropTypes.string,
icon: PropTypes.object,
handleOnPress: PropTypes.func.isRequired,
}
const styles = StyleSheet.create({
wrapper: {
display: 'flex',
padding: 15,
borderRadius: 40,
borderWidth: 1,
borderColor: colors.white,
height: 50,
marginBottom: 15,
alignItems: 'center',
},
buttonText: {
fontSize: 16,
width: '100%',
textAlign: 'center'
},
buttonTextWrapper: {
flexDirection: 'row',
justifyContent: 'flex-end',
}
});
//LoggedOut
import React, {Component} from 'react';
import { Image, StyleSheet, Text, View, TouchableHighlight } from 'react-native';
import RoundedButton from '../components/buttons/RoundedButton';
import colors from '../styles/colors';
import Icon from 'react-native-vector-icons/FontAwesome';
const airbnbLogo = require('../images/airbnb-logo.png')
class LoggedOut extends Component {
onFacebookPress(){
alert('Facebook press')
}
onCreateAccountPress(){
alert('Create Account')
}
onMoreOptionsPress(){
alert('More Options')
}
render() {
return (
<View style={styles.wrapper}>
<View style={styles.welcomeWrapper}>
<Image
source={airbnbLogo}
style={styles.logo}
/>
<Text style={styles.welcomeText}>
Welcome to Airbnb
</Text>
<RoundedButton
text="Continue with Facebook"
textColor={colors.green01}
background={colors.white}
icon={<Icon name="facebook" size={20} style={styles.facebookButtonIcon} />}
handleOnPress={this.onFacebookPress}
/>
<RoundedButton
text="Create Account"
textColor={colors.white}
background={colors.green01}
handleOnPress={this.onCreateAccountPress}
/>
<TouchableHighlight
style={styles.moreOptionsButton}
onPress={this.onMoreOptionsPress}
>
<Text style={styles.moreOptionsButtonText}>More Options</Text>
</TouchableHighlight>
<View style={styles.termsAndConditions}>
<Text style={styles.termsText}>
By Tapping Continue. Create An Account or More
</Text>
<Text style={styles.termsText}>options, </Text>
<Text style={styles.termsText}>I agree to Airbnb's</Text>
<TouchableHighlight style={styles.linkButton}>
<Text style={styles.termsText}>Terms of Service</Text>
</TouchableHighlight>
<Text style={styles.termsText}> ,</Text>
<TouchableHighlight style={styles.linkButton}>
<Text style={styles.termsText}>Payments, Terms of Service</Text>
</TouchableHighlight>
<Text style={styles.termsText}> ,and</Text>
<TouchableHighlight style={styles.linkButton}>
<Text style={styles.termsText}>Privacy Policy</Text>
</TouchableHighlight>
<Text style={styles.termsText}> ,</Text>
<TouchableHighlight style={styles.linkButton}>
<Text style={styles.termsText}>Nondiscrimination Policy.</Text>
</TouchableHighlight>
</View>
</View>
</View>
)
}
}
export default LoggedOut;
const styles = StyleSheet.create({
wrapper: {
flex: 1,
display: 'flex',
backgroundColor: colors.green01,
},
welcomeWrapper: {
flex: 1,
display: 'flex',
marginTop: 30,
padding: 20
},
logo: {
width: 50,
height: 50,
marginTop: 50,
marginBottom: 40,
},
welcomeText: {
fontSize: 30,
height: 60,
color: colors.white,
fontWeight: '300',
},
facebookButtonIcon: {
color: colors.green01,
position: 'relative',
left: 30,
zIndex: 8,
width: 20,
},
moreOptionsButton: {
marginTop: 15,
width: 50,
},
moreOptionsButtonText: {
color: colors.white,
width: 200,
fontSize: 20,
height: 30,
},
termsAndConditions: {
flexWrap: 'wrap',
alignItems: 'flex-start',
flexDirection: 'row',
marginTop: 40
},
termsText: {
color: colors.white,
fontSize: 12,
fontWeight: '600',
height: 20
},
linkButton: {
borderBottomWidth: 0.5,
display: 'flex',
borderBottomColor: colors.white,
}
})
第一个完毕~
【水滴石穿】AB-B-Clone的更多相关文章
- 基于 HTML5 WebGL 的挖掘机 3D 可视化应用
前言 在工业互联网以及物联网的影响下,人们对于机械的管理,机械的可视化,机械的操作可视化提出了更高的要求.如何在一个系统中完整的显示机械的运行情况,机械的运行轨迹,或者机械的机械动作显得尤为的重要,因 ...
- 基于 HTML5 + WebGL 的 3D 可视化挖掘机
前言 在工业互联网以及物联网的影响下,人们对于机械的管理,机械的可视化,机械的操作可视化提出了更高的要求.如何在一个系统中完整的显示机械的运行情况,机械的运行轨迹,或者机械的机械动作显得尤为的重要,因 ...
- 基于 HTML5 + WebGL 实现 3D 挖掘机系统
前言 在工业互联网以及物联网的影响下,人们对于机械的管理,机械的可视化,机械的操作可视化提出了更高的要求.如何在一个系统中完整的显示机械的运行情况,机械的运行轨迹,或者机械的机械动作显得尤为的重要,因 ...
- LeetCode: Clone Graph 解题报告
Clone GraphClone an undirected graph. Each node in the graph contains a label and a list of its neig ...
- wrk,ab,locust,Jmeter 压测结果比较
背景: 项目需要对一批接口进行压测,要求是接口的QPS(Quest Per Second每秒请求数)达到6万以上由于楼主一直使用的压力测试工具是jmeter,但是jmeter单台电脑无法达到6万的QP ...
- Git从码云Clone代码到本地
Git从码云或者Github 克隆代码到本地 1.下载安装Git,傻瓜式下一步下一步即可... 2.配置Git: 2.1.选择你要clone到本地的路径:右键--->$ Git Bash Her ...
- ab
ab is a tool for benchmarking your Apache Hypertext Transfer Protocol (HTTP) server. It is designed ...
- SCVMM中Clone虚拟机失败显示Unsupported Cluster Configuration状态
在SCVMM进行虚拟机的Clone,虽然失败了,但是Clone出虚拟机却显示在SCVMM控制台的虚拟机的列表中,并且状态是Unsupported Cluster Configuration.无法修复, ...
- [LeetCode] Clone Graph 无向图的复制
Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. OJ's ...
- 使用ab对nginx进行压力测试
nginx以高并发,省内存著称. 相信大多数安装nginx的同学都想知道自己的nginx性能如何. 我想跟大家分享下我使用ab工具的压力测试方法和结果, ab是针对apache的性能测试工具,可以只安 ...
随机推荐
- Ceisum官方教程2 -- 项目实例(workshop)
原文地址:https://cesiumjs.org/tutorials/Cesium-Workshop/ 概述 我们很高兴欢迎你加入Cesium社区!为了让你能基于Cesium开发自己的3d 地图项目 ...
- [转]WinForm实现win7 Aero磨砂效果介绍
WinForm实现win7 Aero磨砂效果如下: WinForm实现win7 Aero磨砂效果代码如下: using System; using System.Collections.Generic ...
- python-web-下载所有xkcd漫画
下载所有xkcd漫画 # downloads every single xkcd comic import requests,os,bs4 url='http://xkcd.com' # start ...
- c++ 链接mysql:error LNK2019: 无法解析的外部符号
使用VS2012编译项目报错如下: error LNK2019: 无法解析的外部符号 _mysql_real_connect@32,该符号在函数 _main 中被引用 error LNK2019: 无 ...
- Luogu P2486 [SDOI2011]染色(树链剖分+线段树合并)
Luogu P2486 [SDOI2011]染色 题面 题目描述 输入输出格式 输入格式: 输出格式: 对于每个询问操作,输出一行答案. 输入输出样例 输入样例: 6 5 2 2 1 2 1 1 1 ...
- Redis源码解析:21sentinel(二)定期发送消息、检测主观下线
六:定时发送消息 哨兵每隔一段时间,会向其所监控的所有实例发送一些命令,用于获取这些实例的状态.这些命令包括:"PING"."INFO"和"PUBLI ...
- poj 2318 TOYS(计算几何 点与线段的关系)
TOYS Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 12015 Accepted: 5792 Description ...
- Lab2 内存管理(实现细节)
lab2 中的变动 bootloader 的入口发生了改变 bootloader不像lab1那样,直接调用kern_init函数,而是先调用位于lab2/kern/init/entry.S中的kern ...
- 2019.7.29 NOIP模拟测试10 反思总结【T2补全】
这次意外考得不错…但是并没有太多厉害的地方,因为我只是打满了暴力[还没去推T3] 第一题折腾了一个小时,看了看时间先去写第二题了.第二题尝试了半天还是只写了三十分的暴力,然后看到第三题是期望,本能排斥 ...
- vagrant简介
什么是vagrant? 简单理解,就是可以通过Vagrant这个工具管理虚拟机,比如说想创建一个centos环境的虚拟机,不需要安装系统这么麻烦,通过vagrant可以快速创建 官网地址:https: ...