From b7094e2a2dc0aa9433f2f2f7388a3e8313681888 Mon Sep 17 00:00:00 2001 From: silentcloud Date: Thu, 25 May 2017 11:27:53 +0800 Subject: [PATCH] update some styles for rn --- components/activity-indicator/style/index.tsx | 19 ++++++++++--------- components/style/themes/default.tsx | 1 + components/toast/style/index.tsx | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/components/activity-indicator/style/index.tsx b/components/activity-indicator/style/index.tsx index ac1104fb30..91089568aa 100644 --- a/components/activity-indicator/style/index.tsx +++ b/components/activity-indicator/style/index.tsx @@ -1,4 +1,5 @@ import { StyleSheet } from 'react-native'; +import variables from '../../style/themes/default'; export default StyleSheet.create({ container: { @@ -8,7 +9,7 @@ export default StyleSheet.create({ bottom: 0, right: 0, backgroundColor: 'transparent', - zIndex: 99, + zIndex: variables.toast_zindex, }, innerContainer: { flex: 1, @@ -21,18 +22,18 @@ export default StyleSheet.create({ justifyContent: 'center', width: 89, height: 89, - borderRadius: 6, - backgroundColor: 'rgba(58, 58, 58, 0.9)', + borderRadius: variables.radius_md, + backgroundColor: variables.toast_fill, }, tip: { - color: '#999', - fontSize: 14, - marginLeft: 8, + color: variables.color_text_base, + fontSize: variables.font_size_base, + marginLeft: variables.h_spacing_md, }, toast: { - color: '#fff', - fontSize: 14, - marginTop: 4, + color: variables.color_text_base_inverse, + fontSize: variables.font_size_base, + marginTop: variables.v_spacing_sm, }, spinner: { flexDirection: 'row', diff --git a/components/style/themes/default.tsx b/components/style/themes/default.tsx index 7238858ea8..7a4780f362 100644 --- a/components/style/themes/default.tsx +++ b/components/style/themes/default.tsx @@ -28,6 +28,7 @@ export default { fill_mask: 'rgba(0, 0, 0, .4)', // 遮罩背景 fill_overlay_inverse: 'rgba(0, 0, 0, .8)', // 浮层背景 _ 反色,用于 toast color_icon_base: '#ccc', // 许多小图标的背景,比如一些小圆点,加减号 + toast_fill: 'rgba(0, 0, 0, .8)', // 透明度 opacity_disabled: '0.3', // switch checkbox radio 等组件禁用的透明度 diff --git a/components/toast/style/index.tsx b/components/toast/style/index.tsx index bb155d2c08..6b9cabb2c5 100644 --- a/components/toast/style/index.tsx +++ b/components/toast/style/index.tsx @@ -18,7 +18,7 @@ export default StyleSheet.create({ }, innerWrap: { alignItems: 'center', - backgroundColor: variables.fill_overlay_inverse, + backgroundColor: variables.toast_fill, minWidth: 100, }, iconToast: {