From 570c6f59d7666bc16cf5c568a8fd934e02239c0f Mon Sep 17 00:00:00 2001 From: Henrique Pozzolini Date: Sun, 26 Jan 2025 17:14:55 -0300 Subject: [PATCH 1/8] BA-2128-fe-storybook-profile-page --- .../BlockButtonWithDialogWithQuery.graphql.ts | 172 +++++++++ .../ProfileComponentWithQuery.graphql.ts | 338 ++++++++++++++++++ .../__storybook__/BlockButtonWithDialog.mdx | 70 ++++ .../BlockButtonWithDialogWithQuery/index.tsx | 27 ++ .../__storybook__/mockResolvers.ts | 8 + .../__storybook__/stories.tsx | 33 ++ .../__storybook__/ProfileComponent.mdx | 69 ++++ .../ProfileComponentWithQuery/index.tsx | 31 ++ .../__storybook__/mockResolvers.ts | 19 + .../__storybook__/stories.tsx | 79 ++++ .../profiles/ProfileComponent/index.tsx | 7 +- 11 files changed, 850 insertions(+), 3 deletions(-) create mode 100644 packages/components/__generated__/BlockButtonWithDialogWithQuery.graphql.ts create mode 100644 packages/components/__generated__/ProfileComponentWithQuery.graphql.ts create mode 100644 packages/components/modules/profiles/ProfileComponent/BlockButtonWithDialog/__storybook__/BlockButtonWithDialog.mdx create mode 100644 packages/components/modules/profiles/ProfileComponent/BlockButtonWithDialog/__storybook__/BlockButtonWithDialogWithQuery/index.tsx create mode 100644 packages/components/modules/profiles/ProfileComponent/BlockButtonWithDialog/__storybook__/mockResolvers.ts create mode 100644 packages/components/modules/profiles/ProfileComponent/BlockButtonWithDialog/__storybook__/stories.tsx create mode 100644 packages/components/modules/profiles/ProfileComponent/__storybook__/ProfileComponent.mdx create mode 100644 packages/components/modules/profiles/ProfileComponent/__storybook__/ProfileComponentWithQuery/index.tsx create mode 100644 packages/components/modules/profiles/ProfileComponent/__storybook__/mockResolvers.ts create mode 100644 packages/components/modules/profiles/ProfileComponent/__storybook__/stories.tsx diff --git a/packages/components/__generated__/BlockButtonWithDialogWithQuery.graphql.ts b/packages/components/__generated__/BlockButtonWithDialogWithQuery.graphql.ts new file mode 100644 index 00000000..e1bbe306 --- /dev/null +++ b/packages/components/__generated__/BlockButtonWithDialogWithQuery.graphql.ts @@ -0,0 +1,172 @@ +/** + * @generated SignedSource<<4286df78f7707f1b714efcc0e997c7a2>> + * @lightSyntaxTransform + * @nogrep + */ + +/* tslint:disable */ + +/* eslint-disable */ +// @ts-nocheck +import { ConcreteRequest, Query } from 'relay-runtime' +import { FragmentRefs } from 'relay-runtime' + +export type BlockButtonWithDialogWithQuery$variables = Record +export type BlockButtonWithDialogWithQuery$data = { + readonly target: + | { + readonly ' $fragmentSpreads': FragmentRefs<'BlockToggleFragment'> + } + | null + | undefined +} +export type BlockButtonWithDialogWithQuery = { + response: BlockButtonWithDialogWithQuery$data + variables: BlockButtonWithDialogWithQuery$variables +} + +const node: ConcreteRequest = (function () { + var v0 = [ + { + kind: 'Literal', + name: 'id', + value: 'test-id', + }, + ], + v1 = { + enumValues: null, + nullable: false, + plural: false, + type: 'String', + } + return { + fragment: { + argumentDefinitions: [], + kind: 'Fragment', + metadata: null, + name: 'BlockButtonWithDialogWithQuery', + selections: [ + { + alias: 'target', + args: v0 /*: any*/, + concreteType: null, + kind: 'LinkedField', + name: 'node', + plural: false, + selections: [ + { + args: null, + kind: 'FragmentSpread', + name: 'BlockToggleFragment', + }, + ], + storageKey: 'node(id:"test-id")', + }, + ], + type: 'Query', + abstractKey: null, + }, + kind: 'Request', + operation: { + argumentDefinitions: [], + kind: 'Operation', + name: 'BlockButtonWithDialogWithQuery', + selections: [ + { + alias: 'target', + args: v0 /*: any*/, + concreteType: null, + kind: 'LinkedField', + name: 'node', + plural: false, + selections: [ + { + alias: null, + args: null, + kind: 'ScalarField', + name: '__typename', + storageKey: null, + }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'id', + storageKey: null, + }, + { + kind: 'InlineFragment', + selections: [ + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'isBlockedByMe', + storageKey: null, + }, + { + kind: 'InlineFragment', + selections: [ + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'name', + storageKey: null, + }, + ], + type: 'Profile', + abstractKey: null, + }, + ], + type: 'BlocksInterface', + abstractKey: '__isBlocksInterface', + }, + ], + storageKey: 'node(id:"test-id")', + }, + ], + }, + params: { + cacheID: '46bccdb0823872000701422556204141', + id: null, + metadata: { + relayTestingSelectionTypeInfo: { + target: { + enumValues: null, + nullable: true, + plural: false, + type: 'Node', + }, + 'target.__isBlocksInterface': v1 /*: any*/, + 'target.__typename': v1 /*: any*/, + 'target.id': { + enumValues: null, + nullable: false, + plural: false, + type: 'ID', + }, + 'target.isBlockedByMe': { + enumValues: null, + nullable: true, + plural: false, + type: 'Boolean', + }, + 'target.name': { + enumValues: null, + nullable: true, + plural: false, + type: 'String', + }, + }, + }, + name: 'BlockButtonWithDialogWithQuery', + operationKind: 'query', + text: 'query BlockButtonWithDialogWithQuery {\n target: node(id: "test-id") {\n __typename\n ...BlockToggleFragment\n id\n }\n}\n\nfragment BlockToggleFragment on BlocksInterface {\n __isBlocksInterface: __typename\n id\n isBlockedByMe\n ... on Profile {\n id\n name\n }\n}\n', + }, + } +})() + +;(node as any).hash = 'f5b38828572bb07bae357ef2ff7a231e' + +export default node diff --git a/packages/components/__generated__/ProfileComponentWithQuery.graphql.ts b/packages/components/__generated__/ProfileComponentWithQuery.graphql.ts new file mode 100644 index 00000000..ebbaef18 --- /dev/null +++ b/packages/components/__generated__/ProfileComponentWithQuery.graphql.ts @@ -0,0 +1,338 @@ +/** + * @generated SignedSource<<316ca690b86d88bcb1f06c1829b6ffe0>> + * @lightSyntaxTransform + * @nogrep + */ + +/* tslint:disable */ + +/* eslint-disable */ +// @ts-nocheck +import { ConcreteRequest, Query } from 'relay-runtime' +import { FragmentRefs } from 'relay-runtime' + +export type ProfileComponentWithQuery$variables = Record +export type ProfileComponentWithQuery$data = { + readonly profile: + | { + readonly ' $fragmentSpreads': FragmentRefs<'ProfileComponentFragment'> + } + | null + | undefined +} +export type ProfileComponentWithQuery = { + response: ProfileComponentWithQuery$data + variables: ProfileComponentWithQuery$variables +} + +const node: ConcreteRequest = (function () { + var v0 = [ + { + kind: 'Literal', + name: 'id', + value: 'test-id', + }, + ], + v1 = { + alias: null, + args: null, + kind: 'ScalarField', + name: 'id', + storageKey: null, + }, + v2 = [ + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'url', + storageKey: null, + }, + ], + v3 = { + enumValues: null, + nullable: false, + plural: false, + type: 'String', + }, + v4 = { + enumValues: null, + nullable: true, + plural: false, + type: 'File', + }, + v5 = { + enumValues: null, + nullable: true, + plural: false, + type: 'String', + }, + v6 = { + enumValues: null, + nullable: true, + plural: false, + type: 'Boolean', + }, + v7 = { + enumValues: null, + nullable: true, + plural: false, + type: 'Int', + }, + v8 = { + enumValues: null, + nullable: false, + plural: false, + type: 'ID', + } + return { + fragment: { + argumentDefinitions: [], + kind: 'Fragment', + metadata: null, + name: 'ProfileComponentWithQuery', + selections: [ + { + alias: null, + args: v0 /*: any*/, + concreteType: 'Profile', + kind: 'LinkedField', + name: 'profile', + plural: false, + selections: [ + { + args: null, + kind: 'FragmentSpread', + name: 'ProfileComponentFragment', + }, + ], + storageKey: 'profile(id:"test-id")', + }, + ], + type: 'Query', + abstractKey: null, + }, + kind: 'Request', + operation: { + argumentDefinitions: [], + kind: 'Operation', + name: 'ProfileComponentWithQuery', + selections: [ + { + alias: null, + args: v0 /*: any*/, + concreteType: 'Profile', + kind: 'LinkedField', + name: 'profile', + plural: false, + selections: [ + v1 /*: any*/, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'status', + storageKey: null, + }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'name', + storageKey: null, + }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'biography', + storageKey: null, + }, + { + alias: null, + args: [ + { + kind: 'Literal', + name: 'height', + value: 96, + }, + { + kind: 'Literal', + name: 'width', + value: 96, + }, + ], + concreteType: 'File', + kind: 'LinkedField', + name: 'image', + plural: false, + selections: v2 /*: any*/, + storageKey: 'image(height:96,width:96)', + }, + { + alias: null, + args: [ + { + kind: 'Literal', + name: 'height', + value: 290, + }, + { + kind: 'Literal', + name: 'width', + value: 868, + }, + ], + concreteType: 'File', + kind: 'LinkedField', + name: 'bannerImage', + plural: false, + selections: v2 /*: any*/, + storageKey: 'bannerImage(height:290,width:868)', + }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'isFollowedByMe', + storageKey: null, + }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'followersCount', + storageKey: null, + }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'followingCount', + storageKey: null, + }, + { + alias: 'canChange', + args: [ + { + kind: 'Literal', + name: 'perm', + value: 'change', + }, + ], + kind: 'ScalarField', + name: 'hasPerm', + storageKey: 'hasPerm(perm:"change")', + }, + { + alias: null, + args: null, + concreteType: 'URLPath', + kind: 'LinkedField', + name: 'urlPath', + plural: false, + selections: [ + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'path', + storageKey: null, + }, + v1 /*: any*/, + ], + storageKey: null, + }, + { + alias: null, + args: null, + concreteType: 'User', + kind: 'LinkedField', + name: 'owner', + plural: false, + selections: [ + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'phoneNumber', + storageKey: null, + }, + v1 /*: any*/, + ], + storageKey: null, + }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'isBlockedByMe', + storageKey: null, + }, + { + kind: 'TypeDiscriminator', + abstractKey: '__isBlocksInterface', + }, + ], + storageKey: 'profile(id:"test-id")', + }, + ], + }, + params: { + cacheID: 'b7626920ad43e987ddd718d6ddd137ca', + id: null, + metadata: { + relayTestingSelectionTypeInfo: { + profile: { + enumValues: null, + nullable: true, + plural: false, + type: 'Profile', + }, + 'profile.__isBlocksInterface': v3 /*: any*/, + 'profile.bannerImage': v4 /*: any*/, + 'profile.bannerImage.url': v3 /*: any*/, + 'profile.biography': v5 /*: any*/, + 'profile.canChange': v6 /*: any*/, + 'profile.followersCount': v7 /*: any*/, + 'profile.followingCount': v7 /*: any*/, + 'profile.id': v8 /*: any*/, + 'profile.image': v4 /*: any*/, + 'profile.image.url': v3 /*: any*/, + 'profile.isBlockedByMe': v6 /*: any*/, + 'profile.isFollowedByMe': v6 /*: any*/, + 'profile.name': v5 /*: any*/, + 'profile.owner': { + enumValues: null, + nullable: false, + plural: false, + type: 'User', + }, + 'profile.owner.id': v8 /*: any*/, + 'profile.owner.phoneNumber': v5 /*: any*/, + 'profile.status': { + enumValues: ['A_1', 'A_2'], + nullable: false, + plural: false, + type: 'ProfilesProfileStatusChoices', + }, + 'profile.urlPath': { + enumValues: null, + nullable: true, + plural: false, + type: 'URLPath', + }, + 'profile.urlPath.id': v8 /*: any*/, + 'profile.urlPath.path': v3 /*: any*/, + }, + }, + name: 'ProfileComponentWithQuery', + operationKind: 'query', + text: 'query ProfileComponentWithQuery {\n profile(id: "test-id") {\n ...ProfileComponentFragment\n id\n }\n}\n\nfragment BlockToggleFragment on BlocksInterface {\n __isBlocksInterface: __typename\n id\n isBlockedByMe\n ... on Profile {\n id\n name\n }\n}\n\nfragment ProfileComponentFragment on Profile {\n id\n status\n name\n biography\n image(height: 96, width: 96) {\n url\n }\n bannerImage(height: 290, width: 868) {\n url\n }\n isFollowedByMe\n followersCount\n followingCount\n canChange: hasPerm(perm: "change")\n urlPath {\n path\n id\n }\n owner {\n phoneNumber\n id\n }\n isBlockedByMe\n ...BlockToggleFragment\n}\n', + }, + } +})() + +;(node as any).hash = '9cad7df73c0ed7ce27f6a70686ce41a3' + +export default node diff --git a/packages/components/modules/profiles/ProfileComponent/BlockButtonWithDialog/__storybook__/BlockButtonWithDialog.mdx b/packages/components/modules/profiles/ProfileComponent/BlockButtonWithDialog/__storybook__/BlockButtonWithDialog.mdx new file mode 100644 index 00000000..c44e31e5 --- /dev/null +++ b/packages/components/modules/profiles/ProfileComponent/BlockButtonWithDialog/__storybook__/BlockButtonWithDialog.mdx @@ -0,0 +1,70 @@ +import { Meta } from '@storybook/addon-docs' + + + +# Component Documentation + +## BlockButtonWithDialog + +- **Purpose**: + The `BlockButtonWithDialog` component allows users to block or unblock a profile. It provides a confirmation dialog to ensure the user understands the action before proceeding. + +- **Expected Behavior**: + - When clicked, the button opens a confirmation dialog to block or unblock a profile. + - The state of the button dynamically changes based on whether the profile is already blocked (`isBlockedByMe`). + - Displays a loading indicator when the mutation is in progress. + - Displays a toast notification with feedback after the action is completed or if an error occurs. + +--- + +## Use Cases + +- **Current Usage**: Used within the `ProfileComponent` to manage the block/unblock functionality for a user profile. + +- **Potential Usage**: Can be reused in any other context where blocking/unblocking a user is needed, such as chat applications or user management dashboards. + +--- + +## Props + +- **target** (Relay Fragment Reference): The target profile to be blocked or unblocked. Includes data like `id`, `name`, and `isBlockedByMe`. + +- **currentProfileId** (string): The ID of the currently logged-in user's profile. Used to identify the actor of the block/unblock action. + +- **isMenu** (boolean): Determines whether the button is rendered as part of a menu. Defaults to `false`. + +- **handleError** (function): Callback function to handle errors that occur during the block/unblock action. + +- **handleCloseMenu** (function): Callback function to close the menu if the button is used inside a dropdown or context menu. + +--- + +## Notes + +- **Related Components**: `ProfileComponent`: Integrates the `BlockButtonWithDialog` to manage block/unblock actions. + +--- + +## Example Usage + +```javascript +import BlockButtonWithDialog from '@baseapp-frontend/components/Profiles/BlockButtonWithDialog' + +const ExampleBlockButton = () => { + const targetProfile = { + id: 'profile-2', + name: 'Jane Doe', + isBlockedByMe: false, + } + + return ( + console.error('An error occurred while blocking/unblocking the profile.')} + /> + ) +} + +export default ExampleBlockButton +``` diff --git a/packages/components/modules/profiles/ProfileComponent/BlockButtonWithDialog/__storybook__/BlockButtonWithDialogWithQuery/index.tsx b/packages/components/modules/profiles/ProfileComponent/BlockButtonWithDialog/__storybook__/BlockButtonWithDialogWithQuery/index.tsx new file mode 100644 index 00000000..b16fb6c7 --- /dev/null +++ b/packages/components/modules/profiles/ProfileComponent/BlockButtonWithDialog/__storybook__/BlockButtonWithDialogWithQuery/index.tsx @@ -0,0 +1,27 @@ +import { graphql, useLazyLoadQuery } from 'react-relay' + +import BlockButtonWithDialog from '../..' +import { BlockButtonWithDialogWithQuery as Query } from '../../../../../../__generated__/BlockButtonWithDialogWithQuery.graphql' +import { BlockToggleFragment$key } from '../../../../../../__generated__/BlockToggleFragment.graphql' + +const BlockButtonWithDialogWithQuery = () => { + const data = useLazyLoadQuery( + graphql` + query BlockButtonWithDialogWithQuery @relay_test_operation { + target: node(id: "test-id") { + ...BlockToggleFragment + } + } + `, + {}, + ) + + return ( + + ) +} + +export default BlockButtonWithDialogWithQuery diff --git a/packages/components/modules/profiles/ProfileComponent/BlockButtonWithDialog/__storybook__/mockResolvers.ts b/packages/components/modules/profiles/ProfileComponent/BlockButtonWithDialog/__storybook__/mockResolvers.ts new file mode 100644 index 00000000..7bcc2c98 --- /dev/null +++ b/packages/components/modules/profiles/ProfileComponent/BlockButtonWithDialog/__storybook__/mockResolvers.ts @@ -0,0 +1,8 @@ +export const mockResolvers = { + Node: () => ({ + __typename: 'Profile', + id: 'profile-1', + name: 'John Doe', + isBlockedByMe: false, + }), +} diff --git a/packages/components/modules/profiles/ProfileComponent/BlockButtonWithDialog/__storybook__/stories.tsx b/packages/components/modules/profiles/ProfileComponent/BlockButtonWithDialog/__storybook__/stories.tsx new file mode 100644 index 00000000..ac13be2f --- /dev/null +++ b/packages/components/modules/profiles/ProfileComponent/BlockButtonWithDialog/__storybook__/stories.tsx @@ -0,0 +1,33 @@ +import { Meta, StoryObj } from '@storybook/react' + +import BlockButtonWithDialog from '..' +import BlockButtonWithDialogWithQuery from './BlockButtonWithDialogWithQuery' +import { mockResolvers } from './mockResolvers' + +const meta: Meta = { + title: '@baseapp-frontend | components/Profiles/ProfileComponent/BlockButtonWithDialog', + component: BlockButtonWithDialogWithQuery, +} + +export default meta + +type Story = StoryObj + +export const NotBlocked: Story = { + name: 'Not Blocked', + parameters: { + mockResolvers, + }, +} + +export const Blocked: Story = { + name: 'Blocked', + parameters: { + mockResolvers: { + Node: () => ({ + ...mockResolvers.Node(), + isBlockedByMe: true, + }), + }, + }, +} diff --git a/packages/components/modules/profiles/ProfileComponent/__storybook__/ProfileComponent.mdx b/packages/components/modules/profiles/ProfileComponent/__storybook__/ProfileComponent.mdx new file mode 100644 index 00000000..66917ff0 --- /dev/null +++ b/packages/components/modules/profiles/ProfileComponent/__storybook__/ProfileComponent.mdx @@ -0,0 +1,69 @@ +import { Meta } from '@storybook/addon-docs' + + + +# Component Documentation + +## ProfileComponent + +- **Purpose**: The `ProfileComponent` displays a detailed view of a user profile, including their profile picture, name, biography, followers count, and additional actions like "Follow," "Block," or "Edit Profile" (when applicable). + +- **Expected Behavior**: + The component should render all profile-related information and actions based on the props provided. It also supports: + - Conditional rendering of the "Edit Profile" button if the `currentProfileId` matches the profile's `id`. + - Feedback when the "Share Profile" button is clicked. + - Handling edge cases, such as missing profile data or API errors. + +--- + +## Use Cases + +- **Current Usage**: The `ProfileComponent` is used in the `ProfilePage` to provide a detailed view of a user's profile. + +--- + +## Props + +- **profile** (Relay Fragment Reference): The profile data to be displayed. This includes the user's name, biography, images, and other information about the profile. + +- **currentProfileId** (string): The ID of the currently logged-in user's profile. Used to determine if the "Edit Profile" button should be displayed. + +--- + +## Notes + +- **Related Components**: + - `BlockButtonWithDialog`: Used within the `ProfileComponent` for blocking or unblocking profiles. + - `FollowToggleButton`: Allows toggling the follow/unfollow state for the profile. + +--- + +## Example Usage + +```javascript +import ProfileComponent from '@baseapp-frontend/components/Profiles/ProfileComponent' + +const ExampleProfile = () => { + const profileData = { + id: 'profile-1', + name: 'John Doe', + biography: 'Software Engineer at Example Inc.', + image: { + url: 'https://developers.elementor.com/docs/assets/img/elementor-placeholder-image.png', + }, + bannerImage: { + url: 'https://developers.elementor.com/docs/assets/img/elementor-placeholder-image.png', + }, + followersCount: 120, + followingCount: 80, + isFollowedByMe: false, + isBlockedByMe: false, + canChange: true, + urlPath: { path: '/john-doe' }, + } + + return +} + +export default ExampleProfile +``` diff --git a/packages/components/modules/profiles/ProfileComponent/__storybook__/ProfileComponentWithQuery/index.tsx b/packages/components/modules/profiles/ProfileComponent/__storybook__/ProfileComponentWithQuery/index.tsx new file mode 100644 index 00000000..caacbdb7 --- /dev/null +++ b/packages/components/modules/profiles/ProfileComponent/__storybook__/ProfileComponentWithQuery/index.tsx @@ -0,0 +1,31 @@ +import { graphql, useLazyLoadQuery } from 'react-relay' + +import ProfileComponent from '../..' +import { ProfileComponentFragment$key } from '../../../../../__generated__/ProfileComponentFragment.graphql' +import { ProfileComponentWithQuery as Query } from '../../../../../__generated__/ProfileComponentWithQuery.graphql' + +interface ProfileComponentWithQueryProps { + currentProfileId: string +} + +const ProfileComponentWithQuery = ({ currentProfileId }: ProfileComponentWithQueryProps) => { + const data = useLazyLoadQuery( + graphql` + query ProfileComponentWithQuery @relay_test_operation { + profile(id: "test-id") { + ...ProfileComponentFragment + } + } + `, + {}, + ) + + return ( + + ) +} + +export default ProfileComponentWithQuery diff --git a/packages/components/modules/profiles/ProfileComponent/__storybook__/mockResolvers.ts b/packages/components/modules/profiles/ProfileComponent/__storybook__/mockResolvers.ts new file mode 100644 index 00000000..ace20e84 --- /dev/null +++ b/packages/components/modules/profiles/ProfileComponent/__storybook__/mockResolvers.ts @@ -0,0 +1,19 @@ +export const mockResolvers = { + Profile: () => ({ + id: 'profile-1', + name: 'John Doe', + biography: 'Software Engineer at Example Inc.', + image: { + url: 'https://nyc3.digitaloceanspaces.com/baseapp-production-storage/media/user-avatars/c/9/19/resized/50/50/cb95449a94688af33f6e9bb090cf2936.png', + }, + bannerImage: { + url: 'https://developers.elementor.com/docs/assets/img/elementor-placeholder-image.png', + }, + followersCount: 120, + followingCount: 80, + isFollowedByMe: false, + isBlockedByMe: false, + canChange: true, + urlPath: { path: '/john-doe' }, + }), +} diff --git a/packages/components/modules/profiles/ProfileComponent/__storybook__/stories.tsx b/packages/components/modules/profiles/ProfileComponent/__storybook__/stories.tsx new file mode 100644 index 00000000..769afe3e --- /dev/null +++ b/packages/components/modules/profiles/ProfileComponent/__storybook__/stories.tsx @@ -0,0 +1,79 @@ +import { Meta, StoryObj } from '@storybook/react' + +import ProfileComponentWithQuery from './ProfileComponentWithQuery' +import { mockResolvers } from './mockResolvers' + +const meta: Meta = { + title: '@baseapp-frontend | components/Profiles/ProfileComponent', + component: ProfileComponentWithQuery, + decorators: [ + (Story) => ( +
{ + if (e.key === 'Enter' || e.key === ' ') { + const target = e.target as HTMLElement + if ((e.target as HTMLElement).tagName === 'A') { + e.preventDefault() + } + if (target && target.innerText === 'Share profile') { + alert('Profile URL copied to clipboard!') + } + } + }} + onClick={(e) => { + const target = e.target as HTMLElement + if ((e.target as HTMLElement).tagName === 'A') { + e.preventDefault() + } + if (target && target.innerText === 'Share profile') { + alert('Profile URL copied to clipboard!') + } + }} + style={{ cursor: 'pointer' }} + > + +
+ ), + ], +} + +export default meta + +type Story = StoryObj + +export const UnfollowedProfile: Story = { + name: 'Unfollowed Profile', + args: { + currentProfileId: 'profile-2', + }, + parameters: { + mockResolvers, + }, +} + +export const FollowedProfile: Story = { + name: 'Followed Profile', + args: { + currentProfileId: 'profile-2', + }, + parameters: { + mockResolvers: { + Profile: () => ({ + ...mockResolvers.Profile(), + isFollowedByMe: true, + }), + }, + }, +} + +export const ProfileOwner: Story = { + name: 'Profile Owner', + args: { + currentProfileId: 'profile-1', + }, + parameters: { + mockResolvers, + }, +} diff --git a/packages/components/modules/profiles/ProfileComponent/index.tsx b/packages/components/modules/profiles/ProfileComponent/index.tsx index 4f59260e..d52c88b4 100644 --- a/packages/components/modules/profiles/ProfileComponent/index.tsx +++ b/packages/components/modules/profiles/ProfileComponent/index.tsx @@ -14,7 +14,7 @@ import { import { useNotification } from '@baseapp-frontend/utils' import { Button, MenuItem, Typography } from '@mui/material' -import { useRouter } from 'next/navigation' +// import { useRouter } from 'next/navigation' import numbro from 'numbro' import { useFragment } from 'react-relay' @@ -33,7 +33,7 @@ import { ProfileComponentProps } from './types' const ProfileComponent: FC = ({ profile: profileRef, currentProfileId }) => { const profile = useFragment(ProfileComponentFragment, profileRef) const smDown = useResponsive('down', 'sm') - const router = useRouter() + // const router = useRouter() const [anchorEl, setAnchorEl] = useState(null) const open = Boolean(anchorEl) @@ -75,7 +75,8 @@ const ProfileComponent: FC = ({ profile: profileRef, curr color="inherit" startIcon={} sx={{ maxWidth: smDown ? '100%' : 'fit-content' }} - onClick={() => router.push('/user/settings')} + // onClick={() => router.push('/user/settings')} + href="/user/settings" > Edit Profile From 27762b0f605772a32ee4fb9c621e17b1dfd7c6b6 Mon Sep 17 00:00:00 2001 From: Henrique Pozzolini Date: Mon, 27 Jan 2025 19:19:20 -0300 Subject: [PATCH 2/8] remove comments --- .../components/modules/profiles/ProfileComponent/index.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/components/modules/profiles/ProfileComponent/index.tsx b/packages/components/modules/profiles/ProfileComponent/index.tsx index d52c88b4..74a43c9f 100644 --- a/packages/components/modules/profiles/ProfileComponent/index.tsx +++ b/packages/components/modules/profiles/ProfileComponent/index.tsx @@ -14,7 +14,6 @@ import { import { useNotification } from '@baseapp-frontend/utils' import { Button, MenuItem, Typography } from '@mui/material' -// import { useRouter } from 'next/navigation' import numbro from 'numbro' import { useFragment } from 'react-relay' @@ -33,7 +32,6 @@ import { ProfileComponentProps } from './types' const ProfileComponent: FC = ({ profile: profileRef, currentProfileId }) => { const profile = useFragment(ProfileComponentFragment, profileRef) const smDown = useResponsive('down', 'sm') - // const router = useRouter() const [anchorEl, setAnchorEl] = useState(null) const open = Boolean(anchorEl) @@ -75,7 +73,6 @@ const ProfileComponent: FC = ({ profile: profileRef, curr color="inherit" startIcon={} sx={{ maxWidth: smDown ? '100%' : 'fit-content' }} - // onClick={() => router.push('/user/settings')} href="/user/settings" > Edit Profile From eb96b1e177e937c48438635b51c41d6724069568 Mon Sep 17 00:00:00 2001 From: Henrique Pozzolini Date: Tue, 28 Jan 2025 18:20:59 -0300 Subject: [PATCH 3/8] mock click on icon behaviour for ProfileComponent storybook --- .../profiles/ProfileComponent/__storybook__/stories.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/components/modules/profiles/ProfileComponent/__storybook__/stories.tsx b/packages/components/modules/profiles/ProfileComponent/__storybook__/stories.tsx index 769afe3e..7b1eb9b1 100644 --- a/packages/components/modules/profiles/ProfileComponent/__storybook__/stories.tsx +++ b/packages/components/modules/profiles/ProfileComponent/__storybook__/stories.tsx @@ -14,7 +14,7 @@ const meta: Meta = { onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { const target = e.target as HTMLElement - if ((e.target as HTMLElement).tagName === 'A') { + if ((e.target as HTMLElement).tagName === 'A' || target.closest('a')) { e.preventDefault() } if (target && target.innerText === 'Share profile') { @@ -24,7 +24,7 @@ const meta: Meta = { }} onClick={(e) => { const target = e.target as HTMLElement - if ((e.target as HTMLElement).tagName === 'A') { + if ((e.target as HTMLElement).tagName === 'A' || target.closest('a')) { e.preventDefault() } if (target && target.innerText === 'Share profile') { From 1e92899fac8890547fbd5563d5b7dc7af87c8106 Mon Sep 17 00:00:00 2001 From: Henrique Pozzolini Date: Tue, 28 Jan 2025 22:45:02 -0300 Subject: [PATCH 4/8] change BlockButtonWithDialog variant --- .../__storybook__/BlockButtonWithDialogWithQuery/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/components/modules/profiles/ProfileComponent/BlockButtonWithDialog/__storybook__/BlockButtonWithDialogWithQuery/index.tsx b/packages/components/modules/profiles/ProfileComponent/BlockButtonWithDialog/__storybook__/BlockButtonWithDialogWithQuery/index.tsx index b16fb6c7..77b15e97 100644 --- a/packages/components/modules/profiles/ProfileComponent/BlockButtonWithDialog/__storybook__/BlockButtonWithDialogWithQuery/index.tsx +++ b/packages/components/modules/profiles/ProfileComponent/BlockButtonWithDialog/__storybook__/BlockButtonWithDialogWithQuery/index.tsx @@ -20,6 +20,7 @@ const BlockButtonWithDialogWithQuery = () => { ) } From e5a88945f37db2dc85df6d1d6f4ae9ad79a0405a Mon Sep 17 00:00:00 2001 From: Henrique Pozzolini Date: Fri, 14 Feb 2025 16:25:32 -0300 Subject: [PATCH 5/8] bump components version --- packages/components/CHANGELOG.md | 6 ++++++ packages/components/package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 6738e03b..ca943b07 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -1,5 +1,11 @@ # @baseapp-frontend/components +## 1.0.8 + +### Patch Changes + +- Create profile page storybook + ## 1.0.7 ### Patch Changes diff --git a/packages/components/package.json b/packages/components/package.json index 560ec71c..be05369e 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,7 +1,7 @@ { "name": "@baseapp-frontend/components", "description": "BaseApp components modules such as comments, notifications, messages, and more.", - "version": "1.0.7", + "version": "1.0.8", "sideEffects": false, "scripts": { "babel:bundle": "babel modules -d tmp-babel --extensions .ts,.tsx --ignore '**/__tests__/**','**/__storybook__/**'", From 61b7e5b1aac4c8c523a9b56747b88a873ce8f161 Mon Sep 17 00:00:00 2001 From: Henrique Pozzolini Date: Mon, 17 Mar 2025 18:12:12 -0300 Subject: [PATCH 6/8] bump components version --- packages/components/CHANGELOG.md | 6 ++++++ packages/components/package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 2dcb3b14..a29181a0 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -1,5 +1,11 @@ # @baseapp-frontend/components +## 1.0.24 + +### Patch Changes + +- create profile page storybook + ## 1.0.23 ### Patch Changes diff --git a/packages/components/package.json b/packages/components/package.json index ff3f2e38..99cd687f 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,7 +1,7 @@ { "name": "@baseapp-frontend/components", "description": "BaseApp components modules such as comments, notifications, messages, and more.", - "version": "1.0.23", + "version": "1.0.24", "sideEffects": false, "scripts": { "babel:transpile": "babel modules -d tmp-babel --extensions .ts,.tsx --ignore '**/__tests__/**','**/__storybook__/**'", From cbd555df7b4a8bbee2d49b76f1267d33e3fa5c1e Mon Sep 17 00:00:00 2001 From: Henrique Pozzolini Date: Mon, 17 Mar 2025 18:17:14 -0300 Subject: [PATCH 7/8] remove generated files --- packages/components/__generated__/.keep | 0 .../ActivityLogsFragment.graphql.ts | 288 --------------- .../BlockButtonWithDialogWithQuery.graphql.ts | 172 --------- .../ProfileComponentWithQuery.graphql.ts | 338 ------------------ .../RemoveMemberMutation.graphql.ts | 119 ------ 5 files changed, 917 deletions(-) delete mode 100644 packages/components/__generated__/.keep delete mode 100644 packages/components/__generated__/ActivityLogsFragment.graphql.ts delete mode 100644 packages/components/__generated__/BlockButtonWithDialogWithQuery.graphql.ts delete mode 100644 packages/components/__generated__/ProfileComponentWithQuery.graphql.ts delete mode 100644 packages/components/__generated__/RemoveMemberMutation.graphql.ts diff --git a/packages/components/__generated__/.keep b/packages/components/__generated__/.keep deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/components/__generated__/ActivityLogsFragment.graphql.ts b/packages/components/__generated__/ActivityLogsFragment.graphql.ts deleted file mode 100644 index a2f6832d..00000000 --- a/packages/components/__generated__/ActivityLogsFragment.graphql.ts +++ /dev/null @@ -1,288 +0,0 @@ -/** - * @generated SignedSource<> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ - -/* eslint-disable */ -// @ts-nocheck -import { ReaderFragment, RefetchableFragment } from 'relay-runtime' -import { FragmentRefs } from 'relay-runtime' - -export type ActivityLogsFragment$data = { - readonly activityLogs: - | { - readonly edges: ReadonlyArray< - | { - readonly node: - | { - readonly createdAt: any - readonly id: string - readonly url: string | null | undefined - readonly user: - | { - readonly avatar: - | { - readonly url: string - } - | null - | undefined - readonly email: string | null | undefined - readonly fullName: string | null | undefined - readonly id: string - } - | null - | undefined - readonly verb: string | null | undefined - } - | null - | undefined - } - | null - | undefined - > - readonly pageInfo: { - readonly endCursor: string | null | undefined - readonly hasNextPage: boolean - } - } - | null - | undefined - readonly ' $fragmentType': 'ActivityLogsFragment' -} -export type ActivityLogsFragment$key = { - readonly ' $data'?: ActivityLogsFragment$data - readonly ' $fragmentSpreads': FragmentRefs<'ActivityLogsFragment'> -} - -const node: ReaderFragment = (function () { - var v0 = ['activityLogs'], - v1 = { - alias: null, - args: null, - kind: 'ScalarField', - name: 'id', - storageKey: null, - }, - v2 = { - alias: null, - args: null, - kind: 'ScalarField', - name: 'url', - storageKey: null, - } - return { - argumentDefinitions: [ - { - defaultValue: 10, - kind: 'LocalArgument', - name: 'count', - }, - { - defaultValue: null, - kind: 'LocalArgument', - name: 'createdFrom', - }, - { - defaultValue: null, - kind: 'LocalArgument', - name: 'createdTo', - }, - { - defaultValue: null, - kind: 'LocalArgument', - name: 'cursor', - }, - { - defaultValue: null, - kind: 'LocalArgument', - name: 'userName', - }, - ], - kind: 'Fragment', - metadata: { - connection: [ - { - count: 'count', - cursor: 'cursor', - direction: 'forward', - path: v0 /*: any*/, - }, - ], - refetch: { - connection: { - forward: { - count: 'count', - cursor: 'cursor', - }, - backward: null, - path: v0 /*: any*/, - }, - fragmentPathInResult: [], - operation: require('./ActivityLogsPaginationQuery.graphql'), - }, - }, - name: 'ActivityLogsFragment', - selections: [ - { - alias: 'activityLogs', - args: [ - { - kind: 'Variable', - name: 'createdFrom', - variableName: 'createdFrom', - }, - { - kind: 'Variable', - name: 'createdTo', - variableName: 'createdTo', - }, - { - kind: 'Variable', - name: 'userName', - variableName: 'userName', - }, - ], - concreteType: 'ActivityLogConnection', - kind: 'LinkedField', - name: '__ActivityLogs_activityLogs_connection', - plural: false, - selections: [ - { - alias: null, - args: null, - concreteType: 'ActivityLogEdge', - kind: 'LinkedField', - name: 'edges', - plural: true, - selections: [ - { - alias: null, - args: null, - concreteType: 'ActivityLog', - kind: 'LinkedField', - name: 'node', - plural: false, - selections: [ - v1 /*: any*/, - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'createdAt', - storageKey: null, - }, - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'verb', - storageKey: null, - }, - v2 /*: any*/, - { - alias: null, - args: null, - concreteType: 'User', - kind: 'LinkedField', - name: 'user', - plural: false, - selections: [ - v1 /*: any*/, - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'fullName', - storageKey: null, - }, - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'email', - storageKey: null, - }, - { - alias: null, - args: [ - { - kind: 'Literal', - name: 'height', - value: 48, - }, - { - kind: 'Literal', - name: 'width', - value: 48, - }, - ], - concreteType: 'File', - kind: 'LinkedField', - name: 'avatar', - plural: false, - selections: [v2 /*: any*/], - storageKey: 'avatar(height:48,width:48)', - }, - ], - storageKey: null, - }, - { - alias: null, - args: null, - kind: 'ScalarField', - name: '__typename', - storageKey: null, - }, - ], - storageKey: null, - }, - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'cursor', - storageKey: null, - }, - ], - storageKey: null, - }, - { - alias: null, - args: null, - concreteType: 'PageInfo', - kind: 'LinkedField', - name: 'pageInfo', - plural: false, - selections: [ - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'endCursor', - storageKey: null, - }, - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'hasNextPage', - storageKey: null, - }, - ], - storageKey: null, - }, - ], - storageKey: null, - }, - ], - type: 'Query', - abstractKey: null, - } -})() - -;(node as any).hash = 'f5d29f31cbedd5432a4805c649a74929' - -export default node diff --git a/packages/components/__generated__/BlockButtonWithDialogWithQuery.graphql.ts b/packages/components/__generated__/BlockButtonWithDialogWithQuery.graphql.ts deleted file mode 100644 index e1bbe306..00000000 --- a/packages/components/__generated__/BlockButtonWithDialogWithQuery.graphql.ts +++ /dev/null @@ -1,172 +0,0 @@ -/** - * @generated SignedSource<<4286df78f7707f1b714efcc0e997c7a2>> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ - -/* eslint-disable */ -// @ts-nocheck -import { ConcreteRequest, Query } from 'relay-runtime' -import { FragmentRefs } from 'relay-runtime' - -export type BlockButtonWithDialogWithQuery$variables = Record -export type BlockButtonWithDialogWithQuery$data = { - readonly target: - | { - readonly ' $fragmentSpreads': FragmentRefs<'BlockToggleFragment'> - } - | null - | undefined -} -export type BlockButtonWithDialogWithQuery = { - response: BlockButtonWithDialogWithQuery$data - variables: BlockButtonWithDialogWithQuery$variables -} - -const node: ConcreteRequest = (function () { - var v0 = [ - { - kind: 'Literal', - name: 'id', - value: 'test-id', - }, - ], - v1 = { - enumValues: null, - nullable: false, - plural: false, - type: 'String', - } - return { - fragment: { - argumentDefinitions: [], - kind: 'Fragment', - metadata: null, - name: 'BlockButtonWithDialogWithQuery', - selections: [ - { - alias: 'target', - args: v0 /*: any*/, - concreteType: null, - kind: 'LinkedField', - name: 'node', - plural: false, - selections: [ - { - args: null, - kind: 'FragmentSpread', - name: 'BlockToggleFragment', - }, - ], - storageKey: 'node(id:"test-id")', - }, - ], - type: 'Query', - abstractKey: null, - }, - kind: 'Request', - operation: { - argumentDefinitions: [], - kind: 'Operation', - name: 'BlockButtonWithDialogWithQuery', - selections: [ - { - alias: 'target', - args: v0 /*: any*/, - concreteType: null, - kind: 'LinkedField', - name: 'node', - plural: false, - selections: [ - { - alias: null, - args: null, - kind: 'ScalarField', - name: '__typename', - storageKey: null, - }, - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'id', - storageKey: null, - }, - { - kind: 'InlineFragment', - selections: [ - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'isBlockedByMe', - storageKey: null, - }, - { - kind: 'InlineFragment', - selections: [ - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'name', - storageKey: null, - }, - ], - type: 'Profile', - abstractKey: null, - }, - ], - type: 'BlocksInterface', - abstractKey: '__isBlocksInterface', - }, - ], - storageKey: 'node(id:"test-id")', - }, - ], - }, - params: { - cacheID: '46bccdb0823872000701422556204141', - id: null, - metadata: { - relayTestingSelectionTypeInfo: { - target: { - enumValues: null, - nullable: true, - plural: false, - type: 'Node', - }, - 'target.__isBlocksInterface': v1 /*: any*/, - 'target.__typename': v1 /*: any*/, - 'target.id': { - enumValues: null, - nullable: false, - plural: false, - type: 'ID', - }, - 'target.isBlockedByMe': { - enumValues: null, - nullable: true, - plural: false, - type: 'Boolean', - }, - 'target.name': { - enumValues: null, - nullable: true, - plural: false, - type: 'String', - }, - }, - }, - name: 'BlockButtonWithDialogWithQuery', - operationKind: 'query', - text: 'query BlockButtonWithDialogWithQuery {\n target: node(id: "test-id") {\n __typename\n ...BlockToggleFragment\n id\n }\n}\n\nfragment BlockToggleFragment on BlocksInterface {\n __isBlocksInterface: __typename\n id\n isBlockedByMe\n ... on Profile {\n id\n name\n }\n}\n', - }, - } -})() - -;(node as any).hash = 'f5b38828572bb07bae357ef2ff7a231e' - -export default node diff --git a/packages/components/__generated__/ProfileComponentWithQuery.graphql.ts b/packages/components/__generated__/ProfileComponentWithQuery.graphql.ts deleted file mode 100644 index ebbaef18..00000000 --- a/packages/components/__generated__/ProfileComponentWithQuery.graphql.ts +++ /dev/null @@ -1,338 +0,0 @@ -/** - * @generated SignedSource<<316ca690b86d88bcb1f06c1829b6ffe0>> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ - -/* eslint-disable */ -// @ts-nocheck -import { ConcreteRequest, Query } from 'relay-runtime' -import { FragmentRefs } from 'relay-runtime' - -export type ProfileComponentWithQuery$variables = Record -export type ProfileComponentWithQuery$data = { - readonly profile: - | { - readonly ' $fragmentSpreads': FragmentRefs<'ProfileComponentFragment'> - } - | null - | undefined -} -export type ProfileComponentWithQuery = { - response: ProfileComponentWithQuery$data - variables: ProfileComponentWithQuery$variables -} - -const node: ConcreteRequest = (function () { - var v0 = [ - { - kind: 'Literal', - name: 'id', - value: 'test-id', - }, - ], - v1 = { - alias: null, - args: null, - kind: 'ScalarField', - name: 'id', - storageKey: null, - }, - v2 = [ - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'url', - storageKey: null, - }, - ], - v3 = { - enumValues: null, - nullable: false, - plural: false, - type: 'String', - }, - v4 = { - enumValues: null, - nullable: true, - plural: false, - type: 'File', - }, - v5 = { - enumValues: null, - nullable: true, - plural: false, - type: 'String', - }, - v6 = { - enumValues: null, - nullable: true, - plural: false, - type: 'Boolean', - }, - v7 = { - enumValues: null, - nullable: true, - plural: false, - type: 'Int', - }, - v8 = { - enumValues: null, - nullable: false, - plural: false, - type: 'ID', - } - return { - fragment: { - argumentDefinitions: [], - kind: 'Fragment', - metadata: null, - name: 'ProfileComponentWithQuery', - selections: [ - { - alias: null, - args: v0 /*: any*/, - concreteType: 'Profile', - kind: 'LinkedField', - name: 'profile', - plural: false, - selections: [ - { - args: null, - kind: 'FragmentSpread', - name: 'ProfileComponentFragment', - }, - ], - storageKey: 'profile(id:"test-id")', - }, - ], - type: 'Query', - abstractKey: null, - }, - kind: 'Request', - operation: { - argumentDefinitions: [], - kind: 'Operation', - name: 'ProfileComponentWithQuery', - selections: [ - { - alias: null, - args: v0 /*: any*/, - concreteType: 'Profile', - kind: 'LinkedField', - name: 'profile', - plural: false, - selections: [ - v1 /*: any*/, - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'status', - storageKey: null, - }, - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'name', - storageKey: null, - }, - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'biography', - storageKey: null, - }, - { - alias: null, - args: [ - { - kind: 'Literal', - name: 'height', - value: 96, - }, - { - kind: 'Literal', - name: 'width', - value: 96, - }, - ], - concreteType: 'File', - kind: 'LinkedField', - name: 'image', - plural: false, - selections: v2 /*: any*/, - storageKey: 'image(height:96,width:96)', - }, - { - alias: null, - args: [ - { - kind: 'Literal', - name: 'height', - value: 290, - }, - { - kind: 'Literal', - name: 'width', - value: 868, - }, - ], - concreteType: 'File', - kind: 'LinkedField', - name: 'bannerImage', - plural: false, - selections: v2 /*: any*/, - storageKey: 'bannerImage(height:290,width:868)', - }, - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'isFollowedByMe', - storageKey: null, - }, - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'followersCount', - storageKey: null, - }, - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'followingCount', - storageKey: null, - }, - { - alias: 'canChange', - args: [ - { - kind: 'Literal', - name: 'perm', - value: 'change', - }, - ], - kind: 'ScalarField', - name: 'hasPerm', - storageKey: 'hasPerm(perm:"change")', - }, - { - alias: null, - args: null, - concreteType: 'URLPath', - kind: 'LinkedField', - name: 'urlPath', - plural: false, - selections: [ - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'path', - storageKey: null, - }, - v1 /*: any*/, - ], - storageKey: null, - }, - { - alias: null, - args: null, - concreteType: 'User', - kind: 'LinkedField', - name: 'owner', - plural: false, - selections: [ - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'phoneNumber', - storageKey: null, - }, - v1 /*: any*/, - ], - storageKey: null, - }, - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'isBlockedByMe', - storageKey: null, - }, - { - kind: 'TypeDiscriminator', - abstractKey: '__isBlocksInterface', - }, - ], - storageKey: 'profile(id:"test-id")', - }, - ], - }, - params: { - cacheID: 'b7626920ad43e987ddd718d6ddd137ca', - id: null, - metadata: { - relayTestingSelectionTypeInfo: { - profile: { - enumValues: null, - nullable: true, - plural: false, - type: 'Profile', - }, - 'profile.__isBlocksInterface': v3 /*: any*/, - 'profile.bannerImage': v4 /*: any*/, - 'profile.bannerImage.url': v3 /*: any*/, - 'profile.biography': v5 /*: any*/, - 'profile.canChange': v6 /*: any*/, - 'profile.followersCount': v7 /*: any*/, - 'profile.followingCount': v7 /*: any*/, - 'profile.id': v8 /*: any*/, - 'profile.image': v4 /*: any*/, - 'profile.image.url': v3 /*: any*/, - 'profile.isBlockedByMe': v6 /*: any*/, - 'profile.isFollowedByMe': v6 /*: any*/, - 'profile.name': v5 /*: any*/, - 'profile.owner': { - enumValues: null, - nullable: false, - plural: false, - type: 'User', - }, - 'profile.owner.id': v8 /*: any*/, - 'profile.owner.phoneNumber': v5 /*: any*/, - 'profile.status': { - enumValues: ['A_1', 'A_2'], - nullable: false, - plural: false, - type: 'ProfilesProfileStatusChoices', - }, - 'profile.urlPath': { - enumValues: null, - nullable: true, - plural: false, - type: 'URLPath', - }, - 'profile.urlPath.id': v8 /*: any*/, - 'profile.urlPath.path': v3 /*: any*/, - }, - }, - name: 'ProfileComponentWithQuery', - operationKind: 'query', - text: 'query ProfileComponentWithQuery {\n profile(id: "test-id") {\n ...ProfileComponentFragment\n id\n }\n}\n\nfragment BlockToggleFragment on BlocksInterface {\n __isBlocksInterface: __typename\n id\n isBlockedByMe\n ... on Profile {\n id\n name\n }\n}\n\nfragment ProfileComponentFragment on Profile {\n id\n status\n name\n biography\n image(height: 96, width: 96) {\n url\n }\n bannerImage(height: 290, width: 868) {\n url\n }\n isFollowedByMe\n followersCount\n followingCount\n canChange: hasPerm(perm: "change")\n urlPath {\n path\n id\n }\n owner {\n phoneNumber\n id\n }\n isBlockedByMe\n ...BlockToggleFragment\n}\n', - }, - } -})() - -;(node as any).hash = '9cad7df73c0ed7ce27f6a70686ce41a3' - -export default node diff --git a/packages/components/__generated__/RemoveMemberMutation.graphql.ts b/packages/components/__generated__/RemoveMemberMutation.graphql.ts deleted file mode 100644 index 3eaa670d..00000000 --- a/packages/components/__generated__/RemoveMemberMutation.graphql.ts +++ /dev/null @@ -1,119 +0,0 @@ -/** - * @generated SignedSource<<75b6ee0b9ad6bcd307634d310129e71b>> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ - -/* eslint-disable */ -// @ts-nocheck -import { ConcreteRequest, Mutation } from 'relay-runtime' - -export type ProfileRemoveMemberInput = { - clientMutationId?: string | null | undefined - profileId: string - userId: string -} -export type RemoveMemberMutation$variables = { - input: ProfileRemoveMemberInput -} -export type RemoveMemberMutation$data = { - readonly profileRemoveMember: - | { - readonly deletedId: string | null | undefined - } - | null - | undefined -} -export type RemoveMemberMutation = { - response: RemoveMemberMutation$data - variables: RemoveMemberMutation$variables -} - -const node: ConcreteRequest = (function () { - var v0 = [ - { - defaultValue: null, - kind: 'LocalArgument', - name: 'input', - }, - ], - v1 = [ - { - kind: 'Variable', - name: 'input', - variableName: 'input', - }, - ], - v2 = { - alias: null, - args: null, - kind: 'ScalarField', - name: 'deletedId', - storageKey: null, - } - return { - fragment: { - argumentDefinitions: v0 /*: any*/, - kind: 'Fragment', - metadata: null, - name: 'RemoveMemberMutation', - selections: [ - { - alias: null, - args: v1 /*: any*/, - concreteType: 'ProfileRemoveMemberPayload', - kind: 'LinkedField', - name: 'profileRemoveMember', - plural: false, - selections: [v2 /*: any*/], - storageKey: null, - }, - ], - type: 'Mutation', - abstractKey: null, - }, - kind: 'Request', - operation: { - argumentDefinitions: v0 /*: any*/, - kind: 'Operation', - name: 'RemoveMemberMutation', - selections: [ - { - alias: null, - args: v1 /*: any*/, - concreteType: 'ProfileRemoveMemberPayload', - kind: 'LinkedField', - name: 'profileRemoveMember', - plural: false, - selections: [ - v2 /*: any*/, - { - alias: null, - args: null, - filters: null, - handle: 'deleteRecord', - key: '', - kind: 'ScalarHandle', - name: 'deletedId', - }, - ], - storageKey: null, - }, - ], - }, - params: { - cacheID: '7ede42a17cf2d60398c7a5019de5f013', - id: null, - metadata: {}, - name: 'RemoveMemberMutation', - operationKind: 'mutation', - text: 'mutation RemoveMemberMutation(\n $input: ProfileRemoveMemberInput!\n) {\n profileRemoveMember(input: $input) {\n deletedId\n }\n}\n', - }, - } -})() - -;(node as any).hash = '4426831487fa708c1e351d2c7608e1f8' - -export default node From 66d191377ef407a836301c8b08e369ae4d3dd6a5 Mon Sep 17 00:00:00 2001 From: Henrique Pozzolini Date: Mon, 17 Mar 2025 18:24:20 -0300 Subject: [PATCH 8/8] create .keep file --- packages/components/__generated__/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 packages/components/__generated__/.keep diff --git a/packages/components/__generated__/.keep b/packages/components/__generated__/.keep new file mode 100644 index 00000000..e69de29b