Skip to content

Conversation

GlizzyHacker
Copy link
Contributor

Created chat field to fit the figma design to the best of my abilites. I reused colours from the login page.

To see how it looks replace chat page with this:

import { Chat } from '../types/chat';
import { SentBy } from '../types/message';

const chat: Chat = {
  id: 2,
  messages: [
    {
      message: 'question',
      id: 1,
      createdAt: new Date(),
      index: 0,
      sentBy: SentBy.USER,
    },
    {
      message: 'answer',
      id: 2,
      createdAt: new Date(),
      index: 1,
      sentBy: SentBy.BOT,
    },
    {
      message:
        'long question  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.',
      id: 3,
      createdAt: new Date(),
      index: 2,
      sentBy: SentBy.USER,
    },
    {
      message:
        'long answer Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
      id: 4,
      createdAt: new Date(),
      index: 3,
      sentBy: SentBy.BOT,
    },
    {
      message: 'This should be later',
      id: 5,
      createdAt: new Date(),
      index: 5,
      sentBy: SentBy.BOT,
    },
    {
      message: 'This should be earlier',
      id: 6,
      createdAt: new Date(),
      index: 4,
      sentBy: SentBy.USER,
    },
    {
      message: 'More text to test for overflow',
      id: 7,
      createdAt: new Date(),
      index: 6,
      sentBy: SentBy.USER,
    },
    {
      message: ''.padStart(9999, 'text '),
      id: 8,
      createdAt: new Date(),
      index: 7,
      sentBy: SentBy.BOT,
    },
  ],
  createdAt: new Date(),
  updatedAt: new Date(),
};

export default function ChatPage() {
  return (
    <div className='flex items-center justify-center h-screen w-1/2 bg-gray-800'>
      <ChatField chat={chat} />
    </div>
  );
}

@GlizzyHacker GlizzyHacker linked an issue Aug 31, 2025 that may be closed by this pull request
@GlizzyHacker
Copy link
Contributor Author

Created this as a draft because i still have to connect it to the backend

@GlizzyHacker GlizzyHacker marked this pull request as ready for review September 5, 2025 09:32
@GlizzyHacker GlizzyHacker requested a review from balog-b September 5, 2025 09:32
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.

Chat Field

1 participant