From a30cb170d611fe1bffe87e509398d045858ecaf1 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Mon, 7 Aug 2023 18:14:48 +0100 Subject: [PATCH] Remove friend --- src/components/Befriend.tsx | 131 +++++++++++++++++++- src/components/ReactIcons/AddedUserIcon.tsx | 26 ++++ 2 files changed, 156 insertions(+), 1 deletion(-) create mode 100644 src/components/ReactIcons/AddedUserIcon.tsx diff --git a/src/components/Befriend.tsx b/src/components/Befriend.tsx index 9c959df46..e1ca76315 100644 --- a/src/components/Befriend.tsx +++ b/src/components/Befriend.tsx @@ -9,6 +9,7 @@ import { CheckIcon } from './ReactIcons/CheckIcon'; import { DeleteUserIcon } from './ReactIcons/DeleteUserIcon'; import { useToast } from '../hooks/use-toast'; import { useAuth } from '../hooks/use-auth'; +import { AddedUserIcon } from './ReactIcons/AddedUserIcon'; export type FriendshipStatus = | 'none' @@ -170,7 +171,7 @@ export function Befriend() { {user.status === 'sent' && ( <> - + Request Sent @@ -215,6 +216,134 @@ export function Befriend() { )} )} + + {user.status === 'accepted' && ( + <> + + + You are friends + + + {!isConfirming && ( + + )} + + {isConfirming && ( + + Are you sure?{' '} + {' '} + + + )} + + )} + + {user.status === 'rejected' && ( + <> + + + Request Rejected + + + + Changed your mind?{' '} + + + + )} + + {user.status === 'received' && ( + <> + + + {!isConfirming && ( + + )} + + {isConfirming && ( + + Are you sure?{' '} + {' '} + + + )} + + )} diff --git a/src/components/ReactIcons/AddedUserIcon.tsx b/src/components/ReactIcons/AddedUserIcon.tsx new file mode 100644 index 000000000..d128d7eed --- /dev/null +++ b/src/components/ReactIcons/AddedUserIcon.tsx @@ -0,0 +1,26 @@ +type CheckIconProps = { + additionalClasses?: string; +}; + +export function AddedUserIcon(props: CheckIconProps) { + const { additionalClasses = 'mr-2 w-[20px] h-[20px]' } = props; + + return ( + + + + + + ); +}