Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat PA-4828: Adjust renderAuthComponent interface #72

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading