From dc4052cc6accc99f58584f05aaeb8057bdef5a5a Mon Sep 17 00:00:00 2001 From: hayanisaid Date: Sun, 12 Jun 2022 17:56:59 -0700 Subject: [PATCH 01/22] rebase --- packages/docs/components-listview.md | 51 ++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 packages/docs/components-listview.md diff --git a/packages/docs/components-listview.md b/packages/docs/components-listview.md new file mode 100644 index 0000000..f5de9b1 --- /dev/null +++ b/packages/docs/components-listview.md @@ -0,0 +1,51 @@ +--- +id: components-listview +title: ListView +sidebar_label: ListView +--- + +## ListView + +List View is a special type of view that can display items one by one based in a list. + +```JS +const DATA = [ + { + title: 'Main dishes', + data: ['Pizza', 'Burger', 'Risotto'], + }, + { + title: 'Sides', + data: ['French Fries', 'Onion Rings', 'Fried Shrimps'], + }, + { + title: 'Drinks', + data: ['Water', 'Coke', 'Beer'], + }, + { + title: 'Desserts', + data: ['Cheese Cake', 'Ice Cream'], + }, +]; + +function Item({ title }) { + return ( + + {title} + + ); +} + +export default function App() { + return ( + item + index} + renderItem={({ item }) => } + renderSectionHeader={({ section: { title } }) => ( + {title} + )} + /> + ); +} +``` From 68939d1c2dbe3c69311bcde213eb016ff9695dbf Mon Sep 17 00:00:00 2001 From: hayanisaid Date: Mon, 13 Jun 2022 00:55:24 -0700 Subject: [PATCH 02/22] create Button.js && Button-test.js --- .../react-ape/renderer/elements/Button.js | 71 +++++++++++++++++++ .../elements/__tests__/Button-test.js | 0 2 files changed, 71 insertions(+) create mode 100644 packages/react-ape/renderer/elements/Button.js create mode 100644 packages/react-ape/renderer/elements/__tests__/Button-test.js diff --git a/packages/react-ape/renderer/elements/Button.js b/packages/react-ape/renderer/elements/Button.js new file mode 100644 index 0000000..5f7b3fd --- /dev/null +++ b/packages/react-ape/renderer/elements/Button.js @@ -0,0 +1,71 @@ +/** + * @https://github.com/facebook/react-native/blob/main/Libraries/Components/Button.js + * + * @flow + * + */ + +type ButtonProps = {| + title:string, + onPress:(event?:OnPressEvent):mixed, + touchSoundDisabled?:?boolean, + color?:?string, + /** + * TV next focus down (see documentation for the View component). + * + * @platform android + */ + nextFocusDown?: ?number, + /** + * TV next focus forward (see documentation for the View component). + * + * @platform android + */ + nextFocusForward?: ?number, + + /** + * TV next focus left (see documentation for the View component). + * + * @platform android + */ + nextFocusLeft?: ?number, + + /** + * TV next focus right (see documentation for the View component). + * + * @platform android + */ + nextFocusRight?: ?number, + + /** + * TV next focus up (see documentation for the View component). + * + * @platform android + */ + nextFocusUp?: ?number, + + /** + * Text to display for blindness accessibility features + */ + accessibilityLabel?: ?string, + + /** + * If true, disable all interactions for this component. + */ + disabled?: ?boolean, + + /** + * Used to locate this view in end-to-end tests. + */ + testID?: ?string, + + |} + +function renderButton( + props, + apeContext, + parentLayout) +{ + + +} \ No newline at end of file diff --git a/packages/react-ape/renderer/elements/__tests__/Button-test.js b/packages/react-ape/renderer/elements/__tests__/Button-test.js new file mode 100644 index 0000000..e69de29 From 25ad213ee84de35e1d36183972c373c0e1949b94 Mon Sep 17 00:00:00 2001 From: hayanisaid Date: Wed, 15 Jun 2022 01:30:48 -0700 Subject: [PATCH 03/22] draw Button --- packages/app/src/Sidebar.js | 6 ++ packages/react-ape/reactApeEntry.js | 1 + .../react-ape/renderer/constants/index.js | 22 ++++++ .../react-ape/renderer/elements/Button.js | 69 ++++++++++++++++++- .../react-ape/renderer/reactApeComponent.js | 2 + 5 files changed, 99 insertions(+), 1 deletion(-) diff --git a/packages/app/src/Sidebar.js b/packages/app/src/Sidebar.js index 8a85de2..b62d3e9 100644 --- a/packages/app/src/Sidebar.js +++ b/packages/app/src/Sidebar.js @@ -6,6 +6,7 @@ import { StyleSheet, registerComponent, Navigation, + Button } from '../../react-ape/reactApeEntry'; const {height} = Dimensions.get('screen'); @@ -40,6 +41,11 @@ class Sidebar extends Component { Rio de Janeiro Kyoto Stockholm +