I am currently working on a chatbot project using React and Material UI. I have encountered an issue with the Grid component in my application. My goal is to align the bot messages to the left side of the screen, while positioning the user messages on the right side. Unfortunately, my attempts to achieve this alignment have been unsuccessful.
I have experimented with the alignItems prop on the Grid component and have also tried using the CSS properties float='right'
and float='left'
. Despite these efforts, I have not been able to achieve the desired layout.
If you would like to take a look at a minimal reproducible example, I have provided a link to a code sandbox below. Any assistance or guidance on resolving this issue would be greatly appreciated.
https://codesandbox.io/s/react-chat-cuvfm?file=/src/App.js
Current Output: https://i.sstatic.net/LBbwU.png
Intended Output: Ideally, all the blue bubbles should be positioned at the right end of the screen