Skip to content

Commit

Permalink
Merge pull request #72 from spring-media/PA-4828
Browse files Browse the repository at this point in the history
feat PA-4828: Adjust renderAuthComponent interface
  • Loading branch information
eschmittel authored Oct 8, 2024
2 parents 214c96d + 55fca1d commit 1da8b78
Showing 1 changed file with 29 additions and 8 deletions.
37 changes: 29 additions & 8 deletions src/ps-web-apis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,25 +181,46 @@ export interface WhoamiV1 {
* @param container - The HTML element in which the Wonderwall should be rendered.
* The container should be an HTML element.
*
* @param props - The props that should be passed, which will be used to render the Wonderwall.
* The props should contain the template and variant.
* The props can optional contain the headline and ctaText.
* @param {Object} props - The props that should be passed, which will be passed to the auth component.
* @param {String} props.template - valid choices are "register" and "login"
* @param {String} props.variant - variant of the brand that should be shown e.g bild or welt
* @param {boolean} [props.abortable] - user can leave auth screen if true (not yet implemented)
* @param {String} [props.loginHeadline]
* @param {String} [props.registerHeadline]
* @param {String} [props.loginCta]
* @param {String} [props.registerCta]
*
* @param abortable - If true, the Wonderwall can be aborted by the user.
*/
renderAuthComponent(container: HTMLElement, props: WonderwallProps, abortable: boolean): Promise<AuthRes>;
renderAuthComponent(container: HTMLElement, props: WonderwallProps): Promise<AuthRes>;
}

export interface AuthRes {
isLoggedIn: boolean;
message: string;
}

export type WonderwallVariant =
| "welt"
| "bild"
| "bild-tv"
| "sportbild"
| "bild-markenshop"
| "osp"
| "computerbild-vip-lounge"
| "autobild"
| "autobild-vip-lounge"
| "sportbild-fanmeile"
| "lidlbild"
| "bz";

export type WonderwallProps = {
template: "login" | "register";
variant: string;
headline?: string;
ctaText?: string;
variant: WonderwallVariant;
abortable?: boolean;
loginHeadline: string;
registerHeadline: string;
loginCta?: string;
registerCta?: string;
};

export interface UtilsV1 {
Expand Down

0 comments on commit 1da8b78

Please sign in to comment.