@gechiui/components
Version:
UI components for GeChiUI.
50 lines (43 loc) • 1.12 kB
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import { createElement } from "@gechiui/element";
/**
* External dependencies
*/
import { useNavigation, useRoute } from '@react-navigation/native';
/**
* GeChiUI dependencies
*/
import { useMemo } from '@gechiui/element';
/**
* Internal dependencies
*/
import LinkSettings from './';
const LinkSettingsScreen = props => {
const navigation = useNavigation();
const route = useRoute();
const {
url = ''
} = props;
const {
inputValue = url
} = route.params || {};
const onLinkCellPressed = () => {
if (props.onLinkCellPressed) {
props.onLinkCellPressed({
navigation
});
} else {
navigation.navigate('linkPicker', {
inputValue
});
}
};
return useMemo(() => {
return createElement(LinkSettings, _extends({}, props, {
onLinkCellPressed: props.hasPicker ? onLinkCellPressed : undefined,
urlValue: inputValue
}));
}, [props, inputValue, navigation, route]);
};
export default LinkSettingsScreen;
//# sourceMappingURL=link-settings-screen.native.js.map