Skip to content

Commit

Permalink
React.PureComponent used to key components (Message, etc.)
Browse files Browse the repository at this point in the history
  • Loading branch information
abdurrahmanekr committed Dec 4, 2020
1 parent 141b624 commit d9cc331
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-chat-elements",
"version": "10.12.0",
"version": "10.13.0",
"description": "Reactjs chat components",
"author": "Avare Kodcu <abdurrahmaneker58@gmail.com>",
"main": "dist/main.js",
Expand Down
4 changes: 2 additions & 2 deletions src/Avatar/Avatar.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { Component } from 'react';
import React from 'react';
import './Avatar.css';

const classNames = require('classnames');

const loadedAvatars = [];

export class Avatar extends Component {
export class Avatar extends React.PureComponent {
constructor(props) {
super(props);

Expand Down
4 changes: 2 additions & 2 deletions src/FileMessage/FileMessage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component } from 'react';
import React from 'react';
import './FileMessage.css';

import FaCloudDownload from 'react-icons/lib/fa/cloud-download';
Expand All @@ -8,7 +8,7 @@ import FaFile from 'react-icons/lib/fa/file';
const ProgressBar = require('react-progress-bar.js');
const Circle = ProgressBar.Circle;

export class FileMessage extends Component {
export class FileMessage extends React.PureComponent {

onClick(e) {
if (!this.props.data.status)
Expand Down
4 changes: 2 additions & 2 deletions src/LocationMessage/LocationMessage.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { Component } from 'react';
import React from 'react';
import './LocationMessage.css';

const classNames = require('classnames');

const STATIC_URL = 'https://maps.googleapis.com/maps/api/staticmap?markers=color:MARKER_COLOR|LATITUDE,LONGITUDE&zoom=ZOOM&size=270x200&scale=2&key=KEY';
const MAP_URL = 'https://www.google.com/maps/search/?api=1&query=LATITUDE,LONGITUDE&zoom=ZOOM';

export class LocationMessage extends Component {
export class LocationMessage extends React.PureComponent {
constructor(props) {
super(props);

Expand Down
4 changes: 2 additions & 2 deletions src/MeetingMessage/MeetingMessage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component } from 'react';
import React from 'react';
import './MeetingMessage.css';

import FaCalendar from 'react-icons/lib/fa/calendar';
Expand All @@ -17,7 +17,7 @@ import Dropdown from '../Dropdown/Dropdown';

import classNames from 'classnames';

export class MeetingMessage extends Component {
export class MeetingMessage extends React.PureComponent {
constructor(props) {
super(props);

Expand Down
4 changes: 2 additions & 2 deletions src/MessageBox/MessageBox.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component } from 'react';
import React from 'react';
import './MessageBox.css';

import PhotoMessage from '../PhotoMessage/PhotoMessage';
Expand All @@ -25,7 +25,7 @@ import {

import classNames from 'classnames';

export class MessageBox extends Component {
export class MessageBox extends React.PureComponent {
UNSAFE_componentWillReceiveProps(nextProps) {
if (nextProps.focus !== this.props.focus && nextProps.focus === true) {
if (this.refs['message']) {
Expand Down
4 changes: 2 additions & 2 deletions src/PhotoMessage/PhotoMessage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component } from 'react';
import React from 'react';

import './PhotoMessage.css';

Expand All @@ -8,7 +8,7 @@ import FaError from 'react-icons/lib/fa/exclamation-triangle';
const ProgressBar = require('react-progress-bar.js');
const Circle = ProgressBar.Circle;

export class PhotoMessage extends Component {
export class PhotoMessage extends React.PureComponent {
render() {
var progressOptions = {
strokeWidth: 2.3,
Expand Down
4 changes: 2 additions & 2 deletions src/SpotifyMessage/SpotifyMessage.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { Component } from 'react';
import React from 'react';
import './SpotifyMessage.css';

const classNames = require('classnames');

export class SpotifyMessage extends Component {
export class SpotifyMessage extends React.PureComponent {
toUrl() {
var formBody = [];
var data = {
Expand Down
4 changes: 2 additions & 2 deletions src/SystemMessage/SystemMessage.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { Component } from 'react';
import React from 'react';
import './SystemMessage.css';

const classNames = require('classnames');

export class SystemMessage extends Component {
export class SystemMessage extends React.PureComponent {
render() {
return (
<div className={classNames("rce-container-smsg", this.props.className)}>
Expand Down

0 comments on commit d9cc331

Please sign in to comment.