saleor-dashboard/src/storybook/UserDecorator.tsx

21 lines
510 B
TypeScript
Raw Normal View History

import { UserContext } from "@saleor/auth";
import { User } from "@saleor/fragments/types/User";
import React from "react";
export const UserDecorator = (user: User) => storyFn => (
<UserContext.Provider
value={{
login: undefined,
requestLoginByExternalPlugin: undefined,
2021-01-26 22:04:54 +00:00
loginByExternalPlugin: undefined,
logout: undefined,
user,
authenticated: false,
authenticating: false
}}
>
{storyFn()}
</UserContext.Provider>
);
export default UserDecorator;