Skip to content

Instantly share code, notes, and snippets.

@RubaXa
Created August 26, 2019 15:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RubaXa/e2925778db2e1e1a6185bd56c02074bb to your computer and use it in GitHub Desktop.
Save RubaXa/e2925778db2e1e1a6185bd56c02074bb to your computer and use it in GitHub Desktop.
Poor slots. Describe.
type LoginFormProps = {
header?: boolean; // ⬅ опа 1️⃣
title?: React.ReactNode;
email?: string;
password?: string;
}
function LoginForm(props: LoginFormProps) {
return (
<Form>
{/* 2️⃣ готово */ }
{props.header !== false && <div className="header">
<h2>{props.title || <>Вход</>}</h2>
</div>}
<div className="fields">
<Input name="email" value={props.email} />
<Input name="password" value={props.password} />
</div>
<div className="controls">
<Button kind="primary"/>
</div>
</Form>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment