generated from the-collab-lab/smart-shopping-list
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from the-collab-lab/ja-style-manage-list
Style Manage List Page and Add Toast Alerts
- Loading branch information
Showing
10 changed files
with
226 additions
and
170 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
import { AlertDialog, Button, Flex } from '@radix-ui/themes'; | ||
import { SignInButton } from '../api/useAuth'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
import { faTrashCan } from '@fortawesome/free-regular-svg-icons'; | ||
import '../custom-styles.css'; | ||
|
||
export function SignInAlert({ action, description }) { | ||
return ( | ||
<AlertDialog.Root> | ||
<AlertDialog.Trigger> | ||
<Button className="custom-button">{action}</Button> | ||
</AlertDialog.Trigger> | ||
<AlertDialog.Content maxWidth="450px"> | ||
<AlertDialog.Title>Sign In</AlertDialog.Title> | ||
<AlertDialog.Description size="2"> | ||
In order to {description}, you must sign in first. | ||
</AlertDialog.Description> | ||
|
||
<Flex gap="3" mt="4" justify="end"> | ||
<AlertDialog.Cancel> | ||
<Button variant="soft" color="gray"> | ||
Cancel | ||
</Button> | ||
</AlertDialog.Cancel> | ||
<AlertDialog.Action> | ||
<SignInButton /> | ||
</AlertDialog.Action> | ||
</Flex> | ||
</AlertDialog.Content> | ||
</AlertDialog.Root> | ||
); | ||
} | ||
|
||
export function DeleteItemConfirm({ onDelete, name }) { | ||
return ( | ||
<AlertDialog.Root> | ||
<AlertDialog.Trigger> | ||
<button className="delete-btn" aria-label={`Delete ${name}`}> | ||
<FontAwesomeIcon className="delete-icon" icon={faTrashCan} /> | ||
</button> | ||
</AlertDialog.Trigger> | ||
<AlertDialog.Content maxWidth="450px"> | ||
<AlertDialog.Title>Confirm Delete</AlertDialog.Title> | ||
<AlertDialog.Description size="2"> | ||
Are you sure you want to delete this item from the list? | ||
</AlertDialog.Description> | ||
|
||
<Flex gap="3" mt="4" justify="end"> | ||
<AlertDialog.Cancel> | ||
<Button variant="soft" color="gray"> | ||
Cancel | ||
</Button> | ||
</AlertDialog.Cancel> | ||
<AlertDialog.Action> | ||
<Button | ||
className="custom-delete-button" | ||
variant="solid" | ||
aria-label={`Delete ${name}`} | ||
onClick={onDelete} | ||
> | ||
Delete | ||
</Button> | ||
</AlertDialog.Action> | ||
</Flex> | ||
</AlertDialog.Content> | ||
</AlertDialog.Root> | ||
); | ||
} | ||
|
||
export function DeleteListConfirm({ name, onDelete }) { | ||
return ( | ||
<AlertDialog.Root> | ||
<AlertDialog.Trigger> | ||
<button aria-label={`Delete ${name}`}> | ||
<FontAwesomeIcon icon={faTrashCan} /> | ||
</button> | ||
</AlertDialog.Trigger> | ||
<AlertDialog.Content maxWidth="450px"> | ||
<AlertDialog.Title>Confirm Delete</AlertDialog.Title> | ||
<AlertDialog.Description size="2"> | ||
Are you sure you want to delete the {name} list? This action cannot be | ||
undone and all items in this list will be deleted. | ||
</AlertDialog.Description> | ||
|
||
<Flex gap="3" mt="4" justify="end"> | ||
<AlertDialog.Cancel> | ||
<Button variant="soft" color="gray"> | ||
Cancel | ||
</Button> | ||
</AlertDialog.Cancel> | ||
<AlertDialog.Action> | ||
<Button | ||
className="custom-delete-button" | ||
variant="solid" | ||
aria-label={`Delete ${name}`} | ||
onClick={onDelete} | ||
> | ||
Delete | ||
</Button> | ||
</AlertDialog.Action> | ||
</Flex> | ||
</AlertDialog.Content> | ||
</AlertDialog.Root> | ||
); | ||
} |
Oops, something went wrong.