mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-05-31 14:11:58 +05:30
Change prettier rules
This commit is contained in:
@@ -7,44 +7,36 @@ import { Color } from 'app/components/ui';
|
||||
import BaseAuthBody from './BaseAuthBody';
|
||||
|
||||
export type Factory = () => {
|
||||
Title: ComponentType;
|
||||
Body: typeof BaseAuthBody;
|
||||
Footer: ComponentType;
|
||||
Links: ComponentType;
|
||||
Title: ComponentType;
|
||||
Body: typeof BaseAuthBody;
|
||||
Footer: ComponentType;
|
||||
Links: ComponentType;
|
||||
};
|
||||
|
||||
type RejectionLinkProps = ComponentProps<typeof RejectionLink>;
|
||||
interface FactoryParams {
|
||||
title: MessageDescriptor;
|
||||
body: typeof BaseAuthBody;
|
||||
footer: {
|
||||
color?: Color;
|
||||
label: string | MessageDescriptor;
|
||||
autoFocus?: boolean;
|
||||
};
|
||||
links?: RejectionLinkProps | Array<RejectionLinkProps>;
|
||||
title: MessageDescriptor;
|
||||
body: typeof BaseAuthBody;
|
||||
footer: {
|
||||
color?: Color;
|
||||
label: string | MessageDescriptor;
|
||||
autoFocus?: boolean;
|
||||
};
|
||||
links?: RejectionLinkProps | Array<RejectionLinkProps>;
|
||||
}
|
||||
|
||||
export default function ({
|
||||
title,
|
||||
body,
|
||||
footer,
|
||||
links,
|
||||
}: FactoryParams): Factory {
|
||||
return () => ({
|
||||
Title: () => <AuthTitle title={title} />,
|
||||
Body: body,
|
||||
Footer: () => <Button type="submit" {...footer} />,
|
||||
Links: () =>
|
||||
links ? (
|
||||
<span>
|
||||
{([] as Array<RejectionLinkProps>)
|
||||
.concat(links)
|
||||
.map((link, index) => [
|
||||
index ? ' | ' : '',
|
||||
<RejectionLink {...link} key={index} />,
|
||||
])}
|
||||
</span>
|
||||
) : null,
|
||||
});
|
||||
export default function ({ title, body, footer, links }: FactoryParams): Factory {
|
||||
return () => ({
|
||||
Title: () => <AuthTitle title={title} />,
|
||||
Body: body,
|
||||
Footer: () => <Button type="submit" {...footer} />,
|
||||
Links: () =>
|
||||
links ? (
|
||||
<span>
|
||||
{([] as Array<RejectionLinkProps>)
|
||||
.concat(links)
|
||||
.map((link, index) => [index ? ' | ' : '', <RejectionLink {...link} key={index} />])}
|
||||
</span>
|
||||
) : null,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user