initNavbar
Description
Initialize navbar for fullscreen apps
Parameters
| Parameter | Data Type | Required | Description |
|---|---|---|---|
| onClickBack | () => void | Yes | Function for navigating back. You can make use of window.history object or useHistory() hook of react-router-dom, depending on your application requirement and context. |
| show | boolean | No | Whether to show the navbar or not. Default is true |
| title | string | No | Title of the navbar. Default is "Zalopay" |
| titleColor | string | No | Title color of the navbar. Default is #fff |
| titleAlign | string | No | Title alignment of the navbar. Default is start |
| backgroundColor | string | No | Background color of the navbar. Default is #0033c9 |
| backBtnColor | string | No | Back button color of the navbar. Default is #fff |
Return Value
N/A
Error Code
N/A
Sample Code and Sample Return Data
Sample Request:
window.zlpSdk.UI.initNavbar({
title: "Test App",
})
.then((response) => console.log(response))
.catch((error) => console.error(error.errorCode));
Sample Response:
{ "data": {}, "status": "success" }