apphouse
Version:
Component library for React that uses observable state management and theme-able components.
44 lines (43 loc) • 1.64 kB
TypeScript
import React from 'react';
import { ButtonStyles } from '../components/Button';
import { ApphouseComponent } from '../components/component.interfaces';
export interface RestrictedAreaStyles {
signOutButton?: ButtonStyles;
signInButton?: ButtonStyles;
}
export interface RestrictedAreaProps extends ApphouseComponent<RestrictedAreaStyles> {
/**
* The content to be displayed if the user is authorized and signed in
* @required
*/
children: React.ReactNode;
/**
* A boolean value that determines if the sign out button should be shown.
* This button will be displayed at the top right corner of the screen
* @default false
* @optional
*/
showSignOutButton?: boolean;
/**
* A boolean value that determines if the sign in button should be shown.
* This button will be displayed at the top right corner of the screen
* @default false
* @optional
*/
showSignInButton?: boolean;
/**
* if true, the sign in and sign up buttons will always be visible on the top right
* corner of the screen.
* @default false - the buttons will flow with the content
*/
stickyButtons?: boolean;
}
/**
* A component that restricts the content to be displayed to only
* authorized users. This component renders a sign in button that will
* trigger a popup with the sign in form if the user is not signed in
* and a sign up form if the user is not signed up.
*
* @param props RestrictedAreaProps
*/
export declare const RequiresFirebaseAuthentication: (props: RestrictedAreaProps) => import("react/jsx-runtime").JSX.Element | null;