diff --git a/docs/images/modals_show_notification.png b/docs/images/modals_show_notification.png new file mode 100644 index 000000000..cf7199032 Binary files /dev/null and b/docs/images/modals_show_notification.png differ diff --git a/services/modals/src/lib.rs b/services/modals/src/lib.rs index 6a0cafed1..0c22893e4 100644 --- a/services/modals/src/lib.rs +++ b/services/modals/src/lib.rs @@ -196,7 +196,33 @@ impl Modals { } } - /// this blocks until the notification has been acknowledged. + /// Text/QR code notification modal dialog. + /// + /// - `qrtext` turns submitted text into a qr code. + /// - This dialog blocks until the notification has been acknowledged via [ Press any key ]. + /// - Dialog does not scroll, burden is on the consumer to make sure text + qr code do not overflow + /// available space. + /// + ///
+ /// Example Image + /// + /// ![Example Image](https://github.com/betrusted-io/xous-core/blob/main/docs/images/modals_show_notification.png?raw=true) + /// + ///
+ /// + /// # Examples + /// ``` + /// use modals::Modals; + /// use xous_names::XousNames; + /// let xns = XousNames::new().unwrap(); + /// let modals = Modals::new(&xns).unwrap(); + /// modals + /// .show_notification( + /// "Check the wiki:", + /// Some("https://github.com/betrusted-io/betrusted-wiki/wiki"), + /// ) + /// .unwrap(); + /// ``` pub fn show_notification(&self, notification: &str, qrtext: Option<&str>) -> Result<(), xous::Error> { self.lock(); let qrtext = match qrtext {