/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow * @format */ 'use strict'; import type {RNTesterModuleExample} from '../../types/RNTesterTypes'; import type {ViewStyleProp} from 'react-native/Libraries/StyleSheet/StyleSheet'; import {StyleSheet, Text, View} from 'react-native'; function BackgroundImageBox({ style, children, testID, }: { style?: ViewStyleProp, children?: React.Node, testID: string, }) { return ( {children} ); } const styles = StyleSheet.create({ box: { width: 200, height: 100, justifyContent: 'center', alignItems: 'center', marginVertical: 10, }, text: { color: 'white', fontWeight: 'bold', textShadowColor: 'black', textShadowRadius: 2, }, row: { flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'space-evenly', }, col: { alignItems: 'center', }, }); exports.title = 'BackgroundImage'; exports.category = 'UI'; exports.description = 'Examples of background gradients applied to views.'; exports.examples = [ { title: 'Basic Linear Gradient', description: 'A simple linear gradient from top to bottom.', name: 'basic', render(): React.Node { return ( Basic ); }, }, { title: 'Linear Gradient with Angle', name: 'angle', render(): React.Node { return ( 45deg 90deg 180deg ); }, }, { title: 'Linear Gradient with Multiple Colors', name: 'multiple-colors', render(): React.Node { return ( 3 colors 4 colors Rainbow ); }, }, { title: 'Radial Gradient', name: 'radial', render(): React.Node { return ( Circle Ellipse ); }, }, { title: 'Gradient with Background Repeat', name: 'repeat', render(): React.Node { return ( repeat space round no-repeat ); }, }, { title: 'Gradient with Background Position', name: 'position', render(): React.Node { return ( center 25% 75% right bottom ); }, }, { title: 'Multiple Gradients', name: 'multiple', render(): React.Node { return ( ); }, }, { title: 'Gradient with Borders', name: 'borders', render(): React.Node { return ( borderRadius borderWidth + borderColor non uniform borderRadius non uniform borderWidth ); }, }, { title: 'Object syntax', name: 'object-syntax', render(): React.Node { return ( ); }, }, ] as Array;