Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

948 passvideo chatprofile #957

Merged
merged 4 commits into from
Dec 26, 2023
Merged

948 passvideo chatprofile #957

merged 4 commits into from
Dec 26, 2023

Conversation

KlausMikhaelson
Copy link
Contributor

@KlausMikhaelson KlausMikhaelson commented Dec 21, 2023

Fixes Issue #948

Changes proposed

added an option in chat profile to pass a component so that features like video or other customizations can be implemented easily

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • My change requires changes to the documentation.
  • I have updated the documentation accordingly.
  • This PR does not contain plagiarized content.
  • The title of my pull request is a short description of the requested changes.

Screenshots

Note to reviewers

Copy link

File: packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatProfile.tsx

  • Please remove the commented lines for chatId.

File: packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatViewComponent.tsx

  • In line 11, import { ChatView } from '@pushprotocol/uiweb'; should be removed as it is not being used in the code.

File: packages/uiweb/src/lib/components/chat/ChatProfile/AddWalletContent.tsx

  • In line 20, there is a typo, key={index} should be inside parentheses.

File: packages/uiweb/src/lib/components/chat/ChatProfile/ChatProfile.tsx

  • In line 224, there is a typo, const is missing before getImage().

File: packages/uiweb/src/lib/components/chat/ChatViewComponent/ChatViewComponent.tsx

  • In line 80, there is a typo, Conatiner should be Container.

File: packages/uiweb/src/lib/components/chat/CreateGroup/AddWallets.tsx

  • This file is empty. Please remove it.

File: packages/uiweb/src/lib/components/chat/exportedTypes.ts

  • This file is empty. Please remove it.

onSubmit()
}}
isLoading={isLoading}
memberListCount={memberList?.length > 0}
theme={theme}
disabled={isLoading || groupMembers.length === 0}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for making the create group button disable when the group is being created and to add a condition that there should be at least one more wallet address added here

@@ -20,7 +20,7 @@ const ChatViewComponentTest = () => {
<ChatView
onVerificationFail={() => console.log("BOIIII RETURNNNSSSSS")}
chatId='0xf8250D363BD1F25f52F10C21188fe82c68C049c4'

Component={() => <div><a href="https://github.com" target="_blank">Test</a></div>}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason the Component parameter in captalized

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was actually giving an error that Property 'component' does not exist on type 'JSX.IntrinsicElements' while using small letters and I think since it's a component it will be better to keep it capitalized but let me know what you think about it

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KlausMikhaelson let make the Component to some meaningful name and in small case, also give the type as HTMLDivElement.

@@ -127,6 +128,11 @@ export const ChatProfile: React.FC<IChatProfile> = ({
margin="0 20px 0 auto"
alignSelf="center"
>
{(Component && !groupInfo) && (
<Section>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add dimensions for the section

Copy link

In ChatProfile.tsx:

  • Line 10: There is a comment inside the props of ChatProfile component. You should remove it.
  • Line 22: There is a comment inside the props of ChatProfile component. You should remove it.
  • Line 32: There is a comment inside the props of ChatProfile component. You should remove it.

In ChatViewComponent.tsx:

  • Line 15: variable name is "ChatViewComponentTest" but it should be "ChatViewComponent".
  • Line 102: There is an extra space after "=" in "groupInfoModalPositionType = MODAL_POSITION_TYPE.GLOBAL". It should be "groupInfoModalPositionType = MODAL_POSITION_TYPE.GLOBAL".

In AddWalletContent.tsx:

  • Line 73: There is a closing parenthesis ")" missing after "darkIcon={}".

In ChatProfile.tsx:

  • Line 114: The closing parenthesis ")" for "-> toDataURL()?.toString();" is missing.

In ChatViewComponent.tsx:

  • Line 146: There is a missing closing parenthesis ")" after "padding="13px"".

In AddWallets.tsx:

  • File is empty.

In exportedTypes.ts:

  • File is empty.

All looks good.

Copy link

File: packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatProfile.tsx

  1. In the ChatProfileTest component, there is an unused import statement for ChatProfile from "@pushprotocol/uiweb". You can remove it since it is not being used.

File: packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatViewComponent.tsx

  1. In the ChatViewComponentTest component, there are unused import statements for CreateGroupModal, MODAL_BACKGROUND_TYPE, and MODAL_POSITION_TYPE from "@pushprotocol/uiweb". You can remove them since they are not being used.

File: packages/uiweb/src/lib/components/chat/ChatProfile/AddWalletContent.tsx

  1. In the MultipleMemberList styled component, there is a missing closing angle bracket ">" after the key={index} prop. You should add the closing angle bracket.

File: packages/uiweb/src/lib/components/chat/ChatProfile/ChatProfile.tsx

  1. In the ChatProfile component, there is a typo in the import statement for the GroupInfoModal component. The correct import statement should be import { GroupInfoModal } from './GroupInfoModal';.

  2. In the ChatProfile component, there is a typo in the import statement for the isValidETHAddress helper function. The correct import statement should be import { isValidETHAddress } from '../helpers/helper';.

  3. In the getProfileImage function, there is an unnecessary conditional block that always returns the value createBlockie?.(chatId)?.toDataURL()?.toString();. You can remove this conditional block since it does not have any effect on the return value.

  4. In the getProfileName function, there is a missing opening parenthesis "(" before the isMobile conditional statement. You should add the opening parenthesis.

  5. In the getProfileName function, there is a missing closing parenthesis ")" after the true) parameter of the shortenText function. You should add the closing parenthesis.

  6. In the getProfileName function, there is an unnecessary conditional block that always returns the value shortenText(chatInfo.did?.split(':')[1] ?? '', 6, true) when ensName is falsy. You can remove this conditional block and directly return the value.

  7. In the getProfileName function, there is an unnecessary conditional block that always returns the value shortenText(chatId, 6, true) when chatInfo is falsy. You can remove this conditional block and directly return the value.

File: packages/uiweb/src/lib/components/chat/ChatViewComponent/ChatViewComponent.tsx

  1. In the ChatViewComponent component, the options parameter should be destructured as {} instead of IChatViewComponentProps.

  2. In the ChatViewComponent component, there is an unused import statement for useEffect from 'react'. You can remove it since it is not being used.

  3. In the ChatViewComponent component, there is a missing import statement for Conatiner from '../reusables'. You should add the import statement.

  4. In the ChatViewComponent component, the padding prop in the Conatiner component should be changed to padding instead of padding="13px".

  5. In the ChatViewComponent component, the theme prop should be passed to the ChatProfile component as theme={theme}.

File: packages/uiweb/src/lib/components/chat/CreateGroup/AddWallets.tsx

  1. The file is empty. You can remove it.

File: packages/uiweb/src/lib/components/chat/exportedTypes.ts

  1. The file is empty. You can remove it.

All looks good.

@KlausMikhaelson KlausMikhaelson merged commit 2ce025a into main Dec 26, 2023
1 check passed
@KlausMikhaelson KlausMikhaelson deleted the 948-passvideo-chatprofile branch December 26, 2023 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants