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

🐛 [BUG] - <Skeleton loading in dark mode appears like light mode in chat> #1313

Closed
wants to merge 5 commits into from

Conversation

corlard3y
Copy link
Collaborator

fix #1308
Skeleton loading in dark mode appears like light mode in chat

Fixes Issue

Changes proposed

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/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx

  1. In the ChatPreview component, there is a missing opening curly brace '{' on line 83 before 'className={options.readmode ? 'skeleton' : ''}'.
  2. The and 'File' in the ternary condition on line 95 should be wrapped within a
    component.
  3. There is a missing closing tag at the end of the ChatPreview component.
All looks good.

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

  1. The 'overscroll-behavior' property in the ChatViewListCard styled component on line 70 is missing a closing curly brace '}'. It should be 'overscroll-behavior: contain;}'.
  2. In the ChatViewList component, on line 106, there is a missing closing tag after the component.
All looks good.

File: packages/uiweb/src/lib/components/chat/ChatViewList/MessageEncryption.tsx

  1. There is a syntax error in the EncryptionMessageContent object on line 6. The 'NO_ENCRYPTED_GROUP' and 'PREVIEW' keys are missing closing brackets '}'; also, the 'LOADING' key is missing an opening curly brace '{'.
  2. The closing tag at the end of the MessageEncryption component is missing.
All looks good.

File: packages/uiweb/src/lib/components/chat/reusables/ProfileContainer.tsx

  1. The
    tag on line 91 should be moved inside the
    component and wrapped with a closing
    tag.
  2. The Tooltip component on lines 158-178 is missing a closing tag.
  3. The closing tag is missing at the end of the ProfileContainer component.
All looks good.

File: packages/uiweb/src/lib/components/chat/theme/index.ts

No content provided for review.

File: packages/uiweb/src/lib/components/reusables/sharedStyling.tsx

No content provided for review.

Copy link

In the file packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx:

  • Line 56: The <FaFile /> component is missing enclosing tags. It should be wrapped inside a <Section> component.
  • Line 83: The className and animation props should be inside a <Section> component.
  • Line 97: The props for <Section> component are incorrectly placed outside of the component. They should be moved inside the component.

In the file packages/uiweb/src/lib/components/chat/ChatViewList/MessageEncryption.tsx:

  • The object NO_ENCRYPTED_GROUP is missing a closing curly brace after the text property.
  • The object PREVIEW is missing a closing curly brace after the text property.
  • The object LOADING is missing a closing curly brace after the text property.
  • There are missing closing curly braces for the ENCRYPTION_MESSAGE object definition.

In the file packages/uiweb/src/lib/components/chat/reusables/ProfileContainer.tsx:

  • Line 54: The opening curly brace for the ProfileContainer component should be followed by a newline.
  • Line 158: The closing curly brace for the if condition is missing.
  • Line 188: The closing tag for the <Section> component should be moved to line 194.
  • Line 218: The opening <Span> tag is missing the closing angle bracket >.
  • Line 238: The animation prop is inside the JSX tag and should be moved outside.
  • Line 240: The opening curly brace for the if condition is missing.
  • There is a missing closing curly brace at the end of the file.

In the file packages/uiweb/src/lib/components/chat/theme/index.ts:

  • There is a missing semicolon ; after the closing curly brace of the NO_ENCRYPTED_GROUP object.
  • The chatWidget property is misspelled as chatWidet in the lightChatTheme object definition.

For the file packages/uiweb/src/lib/components/reusables/sharedStyling.tsx, no content was given, so there is no feedback for this file.

Please address the above issues, and if there are no further mistakes in the provided files, please write 'All looks good.'

Copy link
Collaborator

@mishramonalisha76 mishramonalisha76 left a comment

Choose a reason for hiding this comment

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

LGTM

@corlard3y corlard3y changed the base branch from main to alpha May 24, 2024 11:18
Copy link

In ChatPreview.tsx:

  1. There is a missing opening curly brace ("{") after the condition in the ternary operator in the Message component. It should be added.
  2. The components like <CiImageOn /> and <FaFile /> inside the ternary operator need to be wrapped inside <Section> component for consistency.

In MessageEncryption.tsx:

  1. In the NO_ENCRYPTED_GROUP object, there is a missing closing curly brace after the text property.
  2. The PREVIEW, LOADING, and NO_ENCRYPTED_GROUP objects do not close properly. You need to add closing braces for each object.

In ProfileContainer.tsx:

  1. In the return statement, the opening brace after the position property in the first Section component should be moved to the next line for consistent formatting.
  2. Inside the second Section component, the closing tag for the <Div> component is missing. It should be added after the <Div> content.
  3. Inside the Tooltip component, the animation prop is not properly formatted and should be moved to a separate line.
  4. Inside the RecipientSpan component, the text-wrap attribute should be corrected to white-space for CSS property.
  5. The Tooltip component is not properly closed. The closing tag should be added after the contents of the tooltip.
  6. Inside the Tooltip component, the Section component needs proper indentation and closing tags.
  7. The RecipientSpan component is not fully closed with a closing tag. It should be properly closed with </RecipientSpan>.

Overall, some minor syntax and formatting issues need to be addressed. Here are the corrections made:

// Inside the ternary operator in Message component
<CiImageOn />
File

(FaFile />)
// Inside the NO_ENCRYPTED_GROUP object
NO_ENCRYPTED_GROUP: {
  text: `Messages in this group are not encrypted`,
},
// Inside the remaining objects in MessageEncryption.tsx
PREVIEW: {
  IconComponent: (
    <PublicChatIcon
      size={15}
      color={theme?.iconColor?.subtleColor}
    />
  ),
  text: `Chat in preview mode. Only public groups messages are visible`,
},

LOADING: {
  IconComponent: null,
  text: `Please wait while Push Chat loads the status of this chat...`,
},
// Inside the second Section component in ProfileContainer.tsx
  <Div
    ref={blockieContainerRef}
    width={customStyle?.imgHeight ?? '48px'}
  ></Div>
</Section>
// Inside the Tooltip and RecipientSpan components in ProfileContainer.tsx
<Tooltip content={copyText}>
  <Section
    justifyContent="flex-start"
    gap="5px"
    cursor="pointer"
    minHeight="22px"
    minWidth="140px"
    onMouseEnter={() => {
      const text = member.chatId === member.recipient ? 'Copy Chat ID' : 'Copy Wallet';
      setCopyText(text);
    }}
    onMouseLeave={() => setCopyText('')}
    onClick={() => {
      copyToClipboard(pCAIP10ToWallet(member?.recipient || ''));
      setCopyText('Copied');
    }}
    animation={theme.skeletonBG}
    className={loading ? 'skeleton' : ''}
  >
    <RecipientSpan
      fontSize={member?.name || member?.web3Name ? '14px' : customStyle?.fontSize ?? '18px'}
      fontWeight={member?.name || member?.web3Name ? '500' : customStyle?.fontWeight ?? '400'}
      color={
        member?.name || member?.web3Name
          ? theme.textColor?.modalSubHeadingText
          : customStyle?.textColor ?? theme.textColor?.modalSubHeadingText
      }
      position="relative"
      whiteSpace="nowrap"
      cursor="pointer"
      textAlign="left"
    >
      {member?.name && member?.web3Name
        ? `${member?.web3Name} | ${member.abbrRecipient}`
        : member.abbrRecipient}
    </RecipientSpan>
    {copy && copyText && (
      <Div cursor="pointer">
        <CopyIcon
          size={16}
          color={theme?.iconColor?.primaryColor}
        />
      </Div>
    )}
  </Section>
</Tooltip>

All looks good.

Copy link

In ChatPreview.tsx:

  1. There seems to be a missing element for rendering the components conditionally based on options.readmode. It should be wrapped inside a Section or Span element.
  2. The conditional rendering for the FileType and File component is missing proper syntax. It should be enclosed within JSX tags or a Span element.
  3. There is a missing closing curly brace after the transformSteamMessage function.

In ChatViewList.tsx:

  1. There is a missing closing parenthesis for the requestAnimationFrame function inside the scrollToBottom method.
  2. The async function inside the useEffect hook doesn't have a proper syntax and is not being invoked.
  3. There is a missing closing curly brace after the transformSteamMessage function.
  4. There is a missing closing curly brace after the setFilteredMessages function.
  5. The return statement inside the if (!reference) block should have a closing curly brace after it.
  6. The closing curly brace for the setFilteredMessages function is misplaced.
  7. There is a missing closing curly brace after the onScroll function.
  8. The opening and closing curly braces for the render block inside map should be inside the return statement in ChatViewList.tsx.
  9. There is a missing closing curly brace at the end of the file.

Please correct these issues in the respective files.

Copy link

In ChatPreview.tsx:

  1. Line 40: The 'className' attribute is not inside a JSX element. It should be wrapped in a JSX element or specified as a prop.
  2. Line 41: 'animation' prop doesn't seem to be applied to any element. Verify if it's intended to be applied on a specific element.

In ChatViewList.tsx:

  1. Line 146: Missing closing brace '}' after the return statement inside the useEffect hook.
  2. Line 269: 'if (!user) {' block is missing a closing brace '}'. Place it before the next condition check.
  3. Line 282: 'transformSteamMessage' function is not properly closed and missing closing brace '}'.
  4. Line 308: 'if (messages && messages?.length && messages?.length <= limit) {' does not have a closing brace '}'. Add the missing closing brace.
  5. Line 359: 'if (!reference) {' does not have a closing brace '}'. Add the missing closing brace.
  6. Line 410: 'if (user && !stopFetchingChats) {' does not have a closing brace '}'. Close it with a brace.
  7. Line 483: 'return (' in the 'renderDate' function seems to be misplaced. Move it to the previous line to match the function structure.
  8. Line 586: Unexpected '{' inside the 'if (initialized.loading) return;' block. Remove the extra curly brace.
  9. Line 658: Need to check the logic and verify if this block should be part of the useEffect hook.

Other files are not analyzed as per the task.

Please review these points and make necessary corrections.

@corlard3y corlard3y closed this May 27, 2024
@corlard3y corlard3y deleted the 1308-bug-skeleton-loading-in-dark branch May 27, 2024 18:29
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.

🐛 [BUG] - <Skeleton loading in dark mode appears like light mode in chat>
3 participants