@wordpress/components
Version:
UI components for WordPress.
44 lines (37 loc) • 997 B
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import { createElement } from "@wordpress/element";
/**
* External dependencies
*/
import { useNavigation, useRoute } from '@react-navigation/native';
/**
* WordPress dependencies
*/
import { useMemo } from '@wordpress/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 = () => {
navigation.navigate('linkPicker', {
inputValue
});
};
return useMemo(() => {
return createElement(LinkSettings, _extends({
onLinkCellPressed: props.hasPicker ? onLinkCellPressed : undefined,
urlValue: inputValue
}, props));
}, [props, inputValue, navigation, route]);
};
export default LinkSettingsScreen;
//# sourceMappingURL=link-settings-screen.native.js.map