1611671940
A Chat bubble component for building Chat App in ReactJS.
npm install --save react-chat-bubble
If you are using ES6 modules, if not, you are encouraged to use import
and export
instead.
Example:
import ChatBubble from 'react-chat-bubble';
class App extends Component {
render() {
<ChatBubble messages = {this.state.messages} />
}
}
export default App;
The message object passed as prop should be of following format:
this.state.messages =
[{
"type" : 0,
"image": "cat.jpg",
"text": "Hello! Good Morning!"
}, {
"type": 1,
"image": "dog.jpg",
"text": "Hello! Good Afternoon!"
}];
type = 0 for sender AND 1 for receiver
image = url of contact image
text = message from the user
> More style customization
> Delivered and seen status
Author: sabinbajracharya
Source Code: https://github.com/sabinbajracharya/react-chat-bubble
#react #reactjs #javascript
1555901576
In this article we are going to focus on building a basic sidebar, and the main chat window inside our chat shell. See below.
Chat shell with a fixed width sidebar and expanded chat window
This is the second article in this series. You can check out the previous article for setting up the shell OR you can just check out the chat-shell branch from the following repository.
https://github.com/lyraddigital/flexbox-chat-app.git
Open up the chat.html file. You should have the following HTML.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Chat App</title>
<link rel="stylesheet" type="text/css" media="screen" href="css/chat.css" />
</head>
<body>
<div id="chat-container">
</div>
</body>
</html>
Now inside of the chat-container div add the following HTML.
<div id="side-bar">
</div>
<div id="chat-window">
</div>
Now let’s also add the following CSS under the #chat-container selector in the chat.css file.
#side-bar {
background: #0048AA;
border-radius: 10px 0 0 10px;
}
#chat-window {
background: #999;
border-radius: 0 10px 10px 0;
}
Now reload the page. You should see the following:-
So what happened? Where is our sidebar and where is our chat window? I expected to see a blue side bar and a grey chat window, but it’s no where to be found. Well it’s all good. This is because we have no content inside of either element, so it can be 0 pixels wide.
Sizing Flex Items
So now that we know that our items are 0 pixels wide, let’s attempt to size them. We’ll attempt to try this first using explicit widths.
Add the following width property to the #side-bar rule, then reload the page.
width: 275px;
Hmm. Same result. It’s still a blank shell. Oh wait I have to make sure the height is 100% too. So we better do that too. Once again add the following property to the #side-bar rule, then reload the page.
height: 100%;
So now we have our sidebar that has grown to be exactly 275 pixels wide, and is 100% high. So that’s it. We’re done right? Wrong. Let me ask you a question. How big is the chat window? Let’s test that by adding some text to it. Try this yourself just add some text. You should see something similar to this.
So as you can see the chat window is only as big as the text that’s inside of it, and it is not next to the side bar. And this makes sense because up until now the chat shell is not a flex container, and just a regular block level element.
So let’s make our chat shell a flex container. Set the following display property for the #chat-window selector. Then reload the page.
display: flex;
So as you can see by the above illustration, we can see it’s now next to the side bar, and not below it. But as you can see currently it’s only as wide as the text that’s inside of it.
But we want it to take up the remaining space of the chat shell. Well we know how to do this, as we did it in the previous article. Set the flex-grow property to 1 on the #chat-window selector. Basically copy and paste the property below and reload the page.
flex-grow: 1;
So now we have the chat window taking up the remaining space of the chat shell. Next, let’s remove the background property, and also remove all text inside the chat-window div if any still exists. You should now see the result below.
But are we done? Technically yes, but before we move on, let’s improve things a little bit.
Understanding the default alignment
If you remember, before we had defined our chat shell to be a flex container, we had to make sure we set the height of the side bar to be 100%. Otherwise it was 0 pixels high, and as a result nothing was displayed. With that said, try removing the height property from the #side-bar selector and see what happens when you reload the page. Yes that’s right, it still works. The height of the sidebar is still 100% high.
So what happened here? Why do we no longer have to worry about setting the height to 100%? Well this is one of the cool things Flexbox gives you for free. By default every flex item will stretch vertically to fill in the entire height of the flex container. We can in fact change this behaviour, and we will see how this is done in a future article.
Setting the size of the side bar properly
So another feature of Flexbox is being able to set the size of a flex item by using the flex-basis property. The flex-basis property allows you to specify an initial size of a flex item, before any growing or shrinking takes place. We’ll understand more about this in an upcoming article.
For now I just want you to understand one important thing. And that is using width to specify the size of the sidebar is not a good idea. Let’s see why.
Say that potentially, if the screen is mobile we want the side bar to now appear across the top of the chat shell, acting like a top bar instead. We can do this by changing the direction flex items can flex inside a flex container. For example, add the following CSS to the #chat-container selector. Then reload the page.
flex-direction: column;
So as you can see we are back to a blank shell. So firstly let’s understand what we actually did here. By setting the flex-direction property to column, we changed the direction of how the flex items flex. By default flex items will flex from left to right. However when we set flex-direction to column, it changes this behaviour forcing flex items to flex from top to bottom instead. On top of this, when the direction of flex changes, the sizing and alignment of flex items changes as well.
When flexing from left to right, we get a height of 100% for free as already mentioned, and then we made sure the side bar was set to be 275 pixels wide, by setting the width property.
However now that we a flexing from top to bottom, the width of the flex item by default would be 100% wide, and you would need to specify the height instead. So try this. Add the following property to the #side-bar selector to set the height of the side bar. Then reload the page.
height: 275px;
Now we are seeing the side bar again, as we gave it a fixed height too. But we still have that fixed width. That’s not what we wanted. We want the side bar (ie our new top bar) here to now be 100% wide. Comment out the width for a moment and reload the page again.
So now we were able to move our side bar so it appears on top instead, acting like a top bar. Which as previously mentioned might be suited for mobile device widths. But to do this we had to swap the value of width to be the value of height. Wouldn’t it be great if this size was preserved regardless of which direction our items are flexing.
Try this, remove all widths and height properties from the #side-bar selector and write the following instead. Then reload the page.
flex-basis: 275px;
As you can see we get the same result. Now remove the flex-direction property from the #chat-container selector. Then once again reload the page.
Once again we are back to our final output. But now we also have the flexibility to easily change the side bar to be a top bar if we need to, by just changing the direction items can flow. Regardless of the direction of flex, the size of our side bar / top bar is preserved.
Conclusion
Ok so once again we didn’t build much, but we did cover a lot of concepts about Flexbox around sizing.
#css #programming #webdev
1612606870
Build a Real Time chat application that can integrated into your social handles. Add more life to your website or support portal with a real time chat solutions for mobile apps that shows online presence indicators, typing status, timestamp, multimedia sharing and much more. Users can also log into the live chat app using their social media logins sparing them from the need to remember usernames and passwords. For more information call us at +18444455767 or email us at hello@sisgain.com or Visit: https://sisgain.com/instant-real-time-chat-solutions-mobile-apps
#real time chat solutions for mobile apps #real time chat app development solutions #live chat software for mobile #live chat software solutions #real time chat app development #real time chat applications in java script
1617110327
ByteCipher is one of the leading React JS app development Companies. We offer innovative, efficient and high performing app solutions. As a ReactJS web development company, ByteCipher is providing services for customized web app development, front end app development services, astonishing react to JS UI/UX development and designing solutions, reactJS app support and maintenance services, etc.
#reactjs development company usa #reactjs web development company #reactjs development company in india #reactjs development company india #reactjs development india
1576484092
Emails are almost extinct. The need to stay glued to your office desk is no more a necessity to stay connected with teams. Chat applications are here and are changing the way teams collaborate and communicate with each other with increased mobility.
Chats have gone a long way from being reserved only for socializing purposes to hosting important team discussions and meetings where ideas are born and rolled out. Team chat apps built for iOS and Android devices are the new collaborative tools that business people thrive on.
Chat apps solutions are seeing technical teams in technology companies, be it startups or an enterprise-grade companies as early adopters as they have started realizing the benefits of flexible and frictionless communication that these chat solutions power.
1. Ad-hoc Conversations
Apart from bringing employees together chat apps pave way for grouping teams for ad-hoc conversations where technical people can discuss over tasks, brainstorm and come up with ideas.
2. Epicenter of Tasks
Through an array of integrations that chat applications offer, teams, especially those involved in product development, can centralize their accounts on other collaborative platforms like GitHub, Jira into the chat application itself creating an ecosystem that caters to all collaboration purposes.
3. Record Keeping and Easy Search
Key developments that happen over a verbal discussion need to be noted down else chances are more likely for losing a crucial breakthrough achieved over a brainstorming session. Team collaboration chat apps record every improvement and contents that dates back to any time can be fully searched.
4. Switch Over Devices Based on Convenience
Multi device compatibility ensures that your employees are connected with teams no matter what devices they are using. If on-the-go connectivity is your preference, get things done on smartphone. If convenience matters the most, switch over to your desktop and continue from where you left.
5. Multiple Communication Medium
Text messages, voice calls, video calls, VOIP calls, direct messages, group chats on iOS and Android extend the modes and medium through which you can get to communicate with your peers, teams and entire organization for that matter.
6. Everything Else that Count
Adding to these, features like file sharing (multiple file types), video conferencing, opinion generation through polls, task delegation, followups, update, personalized notification settings, reminders, to-do list creation and much more can be done through real-time team chat applications.
However, the limitations of team collaboration chat apps end here only if you think so. With every other team, apart from development teams, like those that operational level, management level, marketing level etc can also get to reap the benefits of chat apps. Read on to know the
Why restrict the benefit of real-time instant messaging chat app to only technology teams into development and designing. Every other team in your office or organization can get a fair share of its advantages.
Here are some of the instances where chat apps can be useful for other teams.
Human Resource team can build employee engagement programs. HRs can get fast response from employees, build a powerful relationship with them, conduct opinion poll for decision making. The hardly-used suggestion box in office premises can be replaced by a chat app for a more effective and instant feedback.
An organization’s system administration team can stay connected with employees on the go and be there on time to resolve issues. Moreover, notifications on breakdowns and other technical issues can help in saving the downtime. Alerts and reminders on instant messaging applications can contribute towards proactive care.
For marketing professionals and sales executives, chat apps on multiple platforms like iOS, Android can reduce series of mail threads into chat logs that are easily searchable. Live video calls and voice calls can help them build better client relationship and both pre and post sales support can get more livelier and personalized with chat apps.
At operational level, chat apps can connect an organization’s representative with many third party vendors to keep up on timely delivery, maintenance, bill payments and more.
Group or Team collaboration applications are the new age communication tools that can contribute for successful communication between employees of an organization in multiple angles. From initiating an idea to getting works done, real time chat apps have started helping organization at many instances which are tough to handle when done conventionally.
If you are into an organization but still have not got a chat app on board, it is high time that your build a chat app on iOS and Android.
#Team Collaboration Chat Apps #real time chat apps #build a chat app #real-time instant messaging chat app #Chat apps solutions
1623674389
Hire ReactJS app developers for end-to-end services starting from development to customization with AppClues Infotech.
Are you looking for the best company in USA that provides high-quality ReactJS app development services? Having expertise in building robust and real-time mobile apps using React Native Library.
We can fully support your specific business idea with outstanding tech skills and deliver a perfect mobile app on time.
Our ReactJS App Development Services
• Custom ReactJS Development
• ReactJS Consulting
• React UX/UI development and design
• App modernization using React
• React Native mobile development
• Dedicated React development team
• Application migration to React
For more info:
Website: https://www.appcluesinfotech.com/
Email: info@appcluesinfotech.com
Call: +1-978-309-9910
#top reactjs app development company in usa #hire best reactjs app developers #best reactjs app development services #custom reactjs app development agency #how to develop reactjs app #cost to build reactjs application