Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/dynamic color borders #31140

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add PlatformColor and DynamicColorIOS examples on rn-tester
  • Loading branch information
habovh committed Aug 1, 2021
commit 70b27c3b396c6139c5d1981f7c669e8c4b188920
30 changes: 29 additions & 1 deletion packages/rn-tester/js/examples/Border/BorderExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
'use strict';

const React = require('react');
const {StyleSheet, View} = require('react-native');
const {
StyleSheet,
View,
PlatformColor,
DynamicColorIOS,
} = require('react-native');

const styles = StyleSheet.create({
box: {
Expand Down Expand Up @@ -172,6 +177,14 @@ const styles = StyleSheet.create({
borderBottomRightRadius: 30,
borderBottomLeftRadius: 40,
},
border15: {
borderWidth: 10,
borderColor: PlatformColor('systemGray4', 'holo_orange_dark'),
},
border16: {
borderWidth: 10,
habovh marked this conversation as resolved.
Show resolved Hide resolved
borderColor: DynamicColorIOS({light: 'magenta', dark: 'cyan'}),
},
});

exports.title = 'Border';
Expand Down Expand Up @@ -299,4 +312,19 @@ exports.examples = [
return <View style={[styles.box, styles.border14]} />;
},
},
{
title: 'System color',
description: 'Using a platform color',
render() {
return <View style={[styles.box, styles.border15]} />;
},
},
{
title: 'Dynamic color',
description: 'Using a custom dynamic color',
platform: 'ios',
render() {
return <View style={[styles.box, styles.border16]} />;
},
},
];