--- name: ViewportDialogProvider route: customHooks/viewportDialogProvider --- import { Playground, Props } from 'docz'; import { UIViewportDialogService, ServicesManager } from './../../../core/src/services'; import { ViewportDialogProvider, Dialog, Button, useViewportDialog, Notification, } from '@ohif/ui'; # Viewport Dialog Provider This is a context provider that allow the application to share the modal component across all application. ## Sample {() => { const ViewportNotification = ({ hide }) => { return ( { window.alert(value); }} /> ); }; const ViewportActionButtons = () => { const dialog = useViewportDialog(); return ( ); }; return (
CONTENT 1
CONTENT 1
); }}
## Example using UIViewportDialogService {() => { const ViewportNotification = ({ hide }) => { return ( { window.alert(value); }} /> ); }; // Creating servicesManager and register services should be in the root of your app const servicesManager = new ServicesManager(); servicesManager.registerServices([UIViewportDialogService]); // Get service instance const _UIViewportDialogService = servicesManager.services.UIViewportDialogService; return (
CONTENT 0
CONTENT 1
); }}
## Properties: