Element functions are now split into multiple file and started the ground work for onPress support

This commit is contained in:
Clément Le Bihan
2023-04-10 21:43:34 +02:00
parent 87fecb7522
commit 0ce17054fc
5 changed files with 227 additions and 189 deletions
+15
View File
@@ -0,0 +1,15 @@
import React from "react";
import { ElementProps } from "./ElementList";
import { RawElement } from "./RawElement";
import { Pressable } from "native-base";
export const Element = (props: ElementProps) => {
if (props.type === "text" && props.data?.onPress) {
return (
<Pressable onPress={props.data.onPress}>
<RawElement {...props} />
</Pressable>
);
}
return <RawElement {...props} />;
};