Skip Navigation

PublicCslService

The PublicCslService allows to create and register custom tiles (widgets) that will be added to hotel search drawer and hotel details drawer.

Acquiring PublicCslService

In order to obtain PublicCslService and use it, you need to import it, e.g.

import { PublicCslService } from 'sabre-ngv-csl/response/service/PublicCslService';

Then obtain the service inside your source as below:

const cslService: PublicCslService = getService(PublicCslService);

Available methods

createCslHotelSearchTile
createCslHotelSearchTile(content: (data: PublicCslData) => ReactElement, tileAction: (data: PublicCslData) => void, title: string): void;

Type Parameters:

  • content - function that returns React component that will be used as a content of the tile

  • tileAction - another function, this one is called when user clicks on our tile

  • title - title of the tile. It will be displayed above the tile content

Creates custom tile and registers it in the hotel search (CSL) result drawer.

createCslHotelDetailsTile
createCslHotelDetailsTile(content: (data: PublicCslData) => ReactElement, tileAction: (data: PublicCslData) => void, title: string): void;

Type Parameters:

  • content - function that returns React component that will be used as a content of the tile

  • tileAction - another function, this one is called when user clicks on our tile

  • title - title of the tile. It will be displayed above the tile content

Creates custom tile and registers it in the hotel details (CSL) result drawer.

See com.sabre.redapp.example3.web.csl.tile sample for implementation.