Element functions are now split into multiple file and started the ground work for onPress support
This commit is contained in:
@@ -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} />;
|
||||
};
|
||||
Reference in New Issue
Block a user