From caa04f4a4444b51eb486840799be4b81b52f1fe0 Mon Sep 17 00:00:00 2001 From: Lorenzo Blasa Date: Fri, 8 Jul 2022 14:17:52 -0700 Subject: [PATCH] Move User to flipper-common Summary: Move User from reducers to flipper-common. User will now be usable by other modules. Reviewed By: passy Differential Revision: D37599802 fbshipit-source-id: 66412e7ed00bf27448fa2deae70f0e8e80303aba --- desktop/flipper-common/src/User.tsx | 16 ++++++++++++++++ desktop/flipper-common/src/index.tsx | 1 + desktop/flipper-ui-core/src/fb-stubs/user.tsx | 3 +-- desktop/flipper-ui-core/src/reducers/user.tsx | 9 +-------- 4 files changed, 19 insertions(+), 10 deletions(-) create mode 100644 desktop/flipper-common/src/User.tsx diff --git a/desktop/flipper-common/src/User.tsx b/desktop/flipper-common/src/User.tsx new file mode 100644 index 000000000..a503bdc10 --- /dev/null +++ b/desktop/flipper-common/src/User.tsx @@ -0,0 +1,16 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +export type User = { + id?: string; + name?: string; + profile_picture?: { + uri: string; + }; +}; diff --git a/desktop/flipper-common/src/index.tsx b/desktop/flipper-common/src/index.tsx index c9b5c702a..b28ae7fb9 100644 --- a/desktop/flipper-common/src/index.tsx +++ b/desktop/flipper-common/src/index.tsx @@ -64,3 +64,4 @@ export * from './PluginDetails'; export * from './doctor'; export * from './ServerAddOn'; export * from './transport'; +export * from './User'; diff --git a/desktop/flipper-ui-core/src/fb-stubs/user.tsx b/desktop/flipper-ui-core/src/fb-stubs/user.tsx index ddd20b6b9..451175d9a 100644 --- a/desktop/flipper-ui-core/src/fb-stubs/user.tsx +++ b/desktop/flipper-ui-core/src/fb-stubs/user.tsx @@ -7,9 +7,8 @@ * @format */ -import {GraphFileUpload} from 'flipper-common'; +import {GraphFileUpload, User} from 'flipper-common'; import {Atom, createState} from 'flipper-plugin'; -import {User} from '../reducers/user'; export async function getUser(): Promise { throw new Error('Feature not implemented'); diff --git a/desktop/flipper-ui-core/src/reducers/user.tsx b/desktop/flipper-ui-core/src/reducers/user.tsx index 38eeca364..270db7217 100644 --- a/desktop/flipper-ui-core/src/reducers/user.tsx +++ b/desktop/flipper-ui-core/src/reducers/user.tsx @@ -8,14 +8,7 @@ */ import {Actions} from './'; - -export type User = { - id?: string; - name?: string; - profile_picture?: { - uri: string; - }; -}; +import {User} from 'flipper-common'; export type State = User;