2020-11-30 13:08:09 +00:00
|
|
|
import { UserContext } from "@saleor/auth";
|
2022-03-09 08:56:55 +00:00
|
|
|
import { UserFragment } from "@saleor/graphql";
|
2020-11-30 13:08:09 +00:00
|
|
|
import React from "react";
|
|
|
|
|
2022-03-09 08:56:55 +00:00
|
|
|
export const UserDecorator = (user: UserFragment) => storyFn => (
|
2020-11-30 13:08:09 +00:00
|
|
|
<UserContext.Provider
|
|
|
|
value={{
|
|
|
|
login: undefined,
|
2021-12-17 11:10:54 +00:00
|
|
|
requestLoginByExternalPlugin: undefined,
|
2021-01-26 22:04:54 +00:00
|
|
|
loginByExternalPlugin: undefined,
|
2020-11-30 13:08:09 +00:00
|
|
|
logout: undefined,
|
2021-12-17 11:10:54 +00:00
|
|
|
user,
|
|
|
|
authenticated: false,
|
2022-06-21 09:36:55 +00:00
|
|
|
authenticating: false,
|
2020-11-30 13:08:09 +00:00
|
|
|
}}
|
|
|
|
>
|
|
|
|
{storyFn()}
|
|
|
|
</UserContext.Provider>
|
|
|
|
);
|
|
|
|
export default UserDecorator;
|