diff --git a/zh-cn/react-native-material-buttons.md b/zh-cn/react-native-material-buttons.md index 5bd2abce2cc3c142594889b06aac05da30fb70ce..d543b897457b05c92996637562df07cfb3a29547 100644 --- a/zh-cn/react-native-material-buttons.md +++ b/zh-cn/react-native-material-buttons.md @@ -128,7 +128,7 @@ let Strong: React.FC<{ children: React.ReactNode }> = ({ children, ...props }) = ); /* eslint-enable */ -export function MaterialButtons() { +const MaterialButtons = () => { return ( @@ -197,6 +197,8 @@ export function MaterialButtons() { ); } +export default MaterialButtons; + ``` diff --git a/zh-cn/react-native-neomorph-shadows.md b/zh-cn/react-native-neomorph-shadows.md new file mode 100644 index 0000000000000000000000000000000000000000..7025f2bfba6dfd510f1dbebecf77768a8b17cf4c --- /dev/null +++ b/zh-cn/react-native-neomorph-shadows.md @@ -0,0 +1,142 @@ + +> 模板版本:v0.2.1 + +

+

react-native-neomorph-shadows

+

+

+ + Supported platforms + + + License + + +

+ +> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-neomorph-shadows) + +## 安装与使用 + +请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-neomorph-shadows Releases](https://github.com/react-native-oh-library/react-native-neomorph-shadows/releases),并下载适用版本的 tgz 包。 + +进入到工程目录并输入以下命令: + +> [!TIP] # 处替换为 tgz 包的路径 + + + +#### **npm** + +```bash +npm install @react-native-oh-tpl/react-native-neomorph-shadows@file:# +``` + +#### **yarn** + +```bash +yarn add @react-native-oh-tpl/react-native-neomorph-shadows@file:# +``` + + + +下面的代码展示了这个库的基本使用场景: + +```tsx +import React from 'react'; +import { View, StyleSheet, Text } from 'react-native'; +import { Shadow } from 'react-native-neomorph-shadows'; + +export default function () { + return ( + + + + + 登录/注册 + + + + + ); +}; + +const styles = StyleSheet.create({ + container: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + backgroundColor: '#f0f0f0', + }, +}); + + +``` + +## 约束与限制 + +### 兼容性 + +要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 + +请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-neomorph-shadows Releases](https://github.com/react-native-oh-library/react-native-neomorph-shadows/releases) + +## 属性 + +### 此组件有以下属性: +## **API(Shadow)** +>[!tip] "Platform"列表示该属性在原三方库上支持的平台。 + +>[!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 + +| Name | Description | Type | Required | Platform | HarmonyOS Support | +|:-----------------------:| :-----------------------------------------------: | :------------------------------------------------------: | :------: | :---------: | :---------------: | +| **style** | Style object | Object | No | iOS/Android | Yes | +| **fillOpacity** | shadow transparency | String | YES | iOS/Android | Yes | +| **stopColor** | Shadow Gradient End Color | String | No | iOS/Android | Yes | +| **startColor** | Shadow Gradient Start Color | String | No | iOS/Android | Yes | + + +## 遗留问题 + +目前仅设计Shadow组件阴影效果。Neomorph组件暂未涉及。[issue#5](https://github.com/react-native-oh-library/react-native-neomorph-shadows/issues/5) + +## 其他 + +## 开源协议 + +本项目基于 [MIT License](https://github.com/tokkozhin/react-native-neomorph-shadows/blob/master/LICENSE) ,请自由地享受和参与开源。 + \ No newline at end of file diff --git a/zh-cn/react-native-ratings.md b/zh-cn/react-native-ratings.md index f4477410c02738a3655fab9ced1450ee8ad1e4f4..c40cfbf6388bb571de5a4d769a55934c893a8c73 100644 --- a/zh-cn/react-native-ratings.md +++ b/zh-cn/react-native-ratings.md @@ -57,7 +57,7 @@ const styles = StyleSheet.create({ } }); -export function RatingsDemo () { +const RatingsDemo = () => { const [rating, setRating] = useState(3); const ratingCompleted = (rating: number) => { @@ -117,6 +117,8 @@ export function RatingsDemo () { ); }; +export default RatingsDemo; + ``` ## 约束与限制