Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions client/src/components/BuddyMatcher.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { PiPlugsLight } from 'react-icons/pi';
import { connectWithId, socket } from 'src/lib/socketConnection';

import Anonymous from 'components/Anonymous';
import ReconnectBanner from 'components/ReconnectBanner';
import { useAuth } from 'src/context/AuthContext';
import { useChat } from 'src/context/ChatContext';
import { useNavigate, Link } from 'react-router-dom';
Expand Down Expand Up @@ -258,23 +259,8 @@ const BuddyMatcher = () => {
)}
</div>
) : disconnected ? (
<div className="flex flex-col w-full justify-center items-center h-full bg-primary">
<PiPlugsLight className="text-secondary text-8xl" />
<p className="text-lg text-center text-white">Sorry, it seems you&apos;re not connected</p>
<div className="flex flex-col sm:flex-row gap-1 sm:gap-4 text-[1.5em] mt-4 font-medium items-center">
<button
onClick={handleReconnect}
className={
'hover:no-underline hover:text-black text-black w-[8em] h-[2.3em] rounded-[30px] bg-[#FF9F1C] flex flex-col items-center justify-center'
}
>
Try again
</button>
<Link to="/" className="underline text-white hover:text-white text-lg">
Return Home
</Link>
</div>
</div>
<ReconnectBanner handleReconnect={handleReconnect}/>
//Changes made here with moviing reconnector to another component.
) : (
<Anonymous
onChatClosed={startNewSearch}
Expand Down
27 changes: 27 additions & 0 deletions client/src/components/ReconnectBanner.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from 'react';
import { PiPlugsLight } from 'react-icons/pi';
import { Link } from 'react-router-dom';

const ReconnectBanner = ({ handleReconnect }) => {
return (
<div className="flex flex-col w-full justify-center items-center h-full bg-primary">
<PiPlugsLight className="text-secondary text-8xl" />
<p className="text-lg text-center text-white">Sorry, it seems you&apos;re not connected</p>
<div className="flex flex-col sm:flex-row gap-1 sm:gap-4 text-[1.5em] mt-4 font-medium items-center">
<button
onClick={handleReconnect}
className={
'hover:no-underline hover:text-black text-black w-[8em] h-[2.3em] rounded-[30px] bg-[#FF9F1C] flex flex-col items-center justify-center'
}
>
Try again
</button>
<Link to="/" className="underline text-white hover:text-white text-lg">
Return Home
</Link>
</div>
</div>
);
};

export default ReconnectBanner;
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading