Skip to content

Commit

Permalink
add warning
Browse files Browse the repository at this point in the history
  • Loading branch information
KMKoushik committed Aug 29, 2024
1 parent 70bef02 commit da5f90c
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 38 deletions.
47 changes: 28 additions & 19 deletions src/components/AddExpense/SelectUserOrGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,25 +74,34 @@ export const SelectUserOrGroup: React.FC = () => {

return (
<div className="mt-1 ">
<div className="flex gap-4">
<Button
className="mt-4 w-full text-cyan-500 hover:text-cyan-500"
variant="outline"
disabled={!isEmail.success}
onClick={() => onAddEmailClick(false)}
>
<SendIcon className="mr-2 h-4 w-4" />
Send invite to user
</Button>
<Button
className="mt-4 w-full text-cyan-500 hover:text-cyan-500"
variant="outline"
disabled={!isEmail.success}
onClick={() => onAddEmailClick(true)}
>
<UserPlusIcon className="mr-2 h-4 w-4" />
Add to Split Pro
</Button>
<div>
<div>
<div className="mt-1 text-orange-600">
{isEmail.success
? "Warning: Don't use send invite if it's invalid email. use add to Split Pro instead. Your account will be blocked if this feature is misused"
: null}
</div>
</div>
<div className="flex gap-4">
<Button
className="mt-4 w-full text-cyan-500 hover:text-cyan-500"
variant="outline"
disabled={!isEmail.success}
onClick={() => onAddEmailClick(false)}
>
<SendIcon className="mr-2 h-4 w-4" />
Send invite to user
</Button>
<Button
className="mt-4 w-full text-cyan-500 hover:text-cyan-500"
variant="outline"
disabled={!isEmail.success}
onClick={() => onAddEmailClick(true)}
>
<UserPlusIcon className="mr-2 h-4 w-4" />
Add to Split Pro
</Button>
</div>
</div>
<div className="mt-2">
{filteredFriends?.length ? (
Expand Down
44 changes: 25 additions & 19 deletions src/components/group/AddMembers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,25 +118,31 @@ const AddMembers: React.FC<{
{!isEmail.success ? (
<p className="mt-4 text-red-500">Enter valid email</p>
) : (
<div className="flex gap-4">
<Button
className="mt-4 w-full text-cyan-500"
variant="outline"
disabled={!isEmail.success}
onClick={() => onAddEmailClick(false)}
>
<SendIcon className="mr-2 h-4 w-4" />
{isEmail.success ? 'Send invite to user' : 'Enter valid email'}
</Button>
<Button
className="mt-4 w-full text-cyan-500"
variant="outline"
disabled={!isEmail.success}
onClick={() => onAddEmailClick(true)}
>
<UserPlusIcon className="mr-2 h-4 w-4" />
{isEmail.success ? 'Add to Split Pro' : 'Enter valid email'}
</Button>
<div>
<div className="mt-1 text-orange-600">
Warning: Don&apos;t use send invite if it&apos;s invalid email. use add to Split Pro
instead. Your account will be blocked if this feature is misused
</div>
<div className="flex gap-4">
<Button
className="mt-4 w-full text-cyan-500"
variant="outline"
disabled={!isEmail.success}
onClick={() => onAddEmailClick(false)}
>
<SendIcon className="mr-2 h-4 w-4" />
{isEmail.success ? 'Send invite to user' : 'Enter valid email'}
</Button>
<Button
className="mt-4 w-full text-cyan-500"
variant="outline"
disabled={!isEmail.success}
onClick={() => onAddEmailClick(true)}
>
<UserPlusIcon className="mr-2 h-4 w-4" />
{isEmail.success ? 'Add to Split Pro' : 'Enter valid email'}
</Button>
</div>
</div>
)}
<div className="mt-4 flex flex-col gap-4">
Expand Down

0 comments on commit da5f90c

Please sign in to comment.