Skip to content

Conversation

thecactoos
Copy link
Owner

No description provided.

thecactoos and others added 30 commits February 25, 2021 10:10
After log out user couldn't open socket connection without reload.
Left some warnings/errors to know where to eke out unhandled actions
BackToNav was misleading name of the component. Improves readability.
…n, add preview if conversation exists

-Add Redirect inside component, depending on newly created conversation
-Check existence of DM conversation, if exists show preview, after submit redirect to created/existed conversation
-Fix avatar, and heading display
…nut, add clearing data to SelectType.js

Clearing data on unmount of NewConveration was causing clearing data on changing route. It was unwanted action, decided to add clear action whenever user hit SelectType route
Add missing functionalities, fix redirect.
… unnecessary comment

- Change name isMobile to isSmallScreen, small screen doesn't have to be mobile
- Sidebar is rendered conditionally to improve performance
When new message received or created, the newest chats didn't go to first position
The name did not correspond to the performen action
*Change sending animation from keyframes to react-spring
*Fix rerender component to display sending animation correctly by wrap component by React.memo
*Remove unnused scss lines, change name of svg component
Hook which returns boolean representing is element is visible on screen
Scrolling functionalities:
* When conversation show-up, automatically scroll messages to bottom
* When new message create or received scroll to bottom
* When scroll to top get messages history (it's not finished, waiting for backend)
Probably temporary fix, but have more important things to do than configuration npm packages
Fix create-react-app app warning asociated to failing to load source map
Probably temporary fix, but have more important things to do than configuration npm packages
thecactoos and others added 10 commits April 12, 2023 03:44
* Configure eslint, apply changes coming from linter
* Move back to setupProxy.js instead .ts ?
* Add process.env.API_PROD_URL
* Add environmental dependency in url's connections
* Delete CI env variable in env setup
* Add netlify.toml to deploy without 404 etc.
* Add build folder to git ignore
* Add setupProxy.js and configure proxy for development
* Update socket.io to correct connection with cookies
* Update socket.io initiation on files
* Fix: Update url in setupProxy.js, because it's work only in dev mode
Add typescript and prepare to deploy
@thecactoos thecactoos requested a review from moonith April 16, 2023 20:04
Copy link
Collaborator

@moonith moonith left a comment

Choose a reason for hiding this comment

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

Few more comments:

  1. I don't think redux is required for an app of this complexity - read more on composition https://felixgerschau.com/react-component-composition/
  2. You are using custom hooks as kind of controller for react views, its an overkill
  3. TS is lacking here
  4. No tests

"private": true,
"homepage": "https://chatark.netlify.app/",
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
Copy link
Collaborator

Choose a reason for hiding this comment

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

its dev dependency, in general its not that important what section it's in but sometime tools use this distinction to optimise end package size

@@ -0,0 +1,15 @@
{
Copy link
Collaborator

Choose a reason for hiding this comment

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

its important to keep app metadata updated

@@ -0,0 +1,10 @@
/* eslint-disable no-undef */
Copy link
Collaborator

Choose a reason for hiding this comment

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

you should disable eslint rules, but sometimes if 3rd party lib code is broken we have to do that. In such a case one should disable eslint for certain line, not whole file

import { render } from '@testing-library/react';
import App from './pages/App';

test('renders learn react link', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

when writing tests you should always answer this question - is this test helpful? I know this is an example test from react create app, but its a good place to talk about this. In this case this test does not make sense because app.js contained this link in jsx without any conditional logic

@@ -0,0 +1,15 @@
// Signing in
export const SIGN_IN_SUCCESS = 'SIGN_IN_SUCCESS';
export const SIGN_IN_FAIL = 'SIGN_IN_FAIL';
Copy link
Collaborator

Choose a reason for hiding this comment

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

should be SIGN_IN_FAILURE, same everywhere else

<Link
to={{
pathname: `${PROFILE_USER_WITHOUT_ID}${id}`,
state: { from: location.pathname },
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is the purpose of storing origination path in route state? I saw only that you use it to mimic browser back button - there are built in methods for that

}
}, [searchUsers, searchValue]);

useEffect(() => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

you have two use effects that are recalculating based on same searchValue prop. Check https://blog.battlefy.com/how-to-escape-react-hooks-hell-a66c0d142c9e

return false;
}
const membersIds = [
...new Set([...receivers.map((receiver) => receiver.id), userId]),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why set here converted to array, are you trying to commit duplicates in array that way?


if (createdConversation) {
return (
<Redirect
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a bizarre way of doing redirects. You should opt out from putting such a business logic into jsx

type="text"
value={searchValue}
onChange={(e) => {
handleSearchChange(e);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't understand this separation here

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.

2 participants