-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
home sidebar revamp + quick actions base
- Loading branch information
Showing
10 changed files
with
266 additions
and
111 deletions.
There are no files selected for viewing
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,52 @@ | ||
import {ModalTemplate, useModal} from "../ui/Modal"; | ||
import {createSignal} from "solid-js"; | ||
import {getApi} from "../../api/Api"; | ||
import Icon from "../icons/Icon"; | ||
import Trash from "../icons/svg/Trash"; | ||
import {Message} from "../../types/message"; | ||
import {MessagePreview} from "../messaging/Chat"; | ||
|
||
type Props = { | ||
message: Message, | ||
} | ||
|
||
export default function ConfirmMessageDeleteModal(props: Props) { | ||
const api = getApi()! | ||
const {hideModal} = useModal() | ||
|
||
const [isDeleting, setIsDeleting] = createSignal<boolean>(false) | ||
|
||
return ( | ||
<ModalTemplate title="Delete Message"> | ||
<p class="text-fg/70 text-sm mt-4 text-center"> | ||
Are you sure you want to delete this message? | ||
</p> | ||
<div class="rounded-xl overflow-y-auto max-h-[50lvh] bg-bg-3/50 mt-2 py-2"> | ||
<MessagePreview message={props.message} noHoverEffects /> | ||
</div> | ||
<form | ||
class="flex flex-wrap justify-end mt-4 gap-x-4" | ||
onSubmit={async (event) => { | ||
event.preventDefault() | ||
setIsDeleting(true) | ||
try { | ||
await api.deleteMessage(props.message.channel_id, props.message.id) | ||
} catch (err) { | ||
setIsDeleting(false) | ||
throw err | ||
} | ||
setIsDeleting(false) | ||
hideModal() | ||
}} | ||
> | ||
<button type="button" class="btn border-none btn-ghost" onClick={hideModal}> | ||
Cancel | ||
</button> | ||
<button type="submit" class="btn btn-danger border-none" disabled={isDeleting()}> | ||
<Icon icon={Trash} class="fill-fg w-4 h-4 mr-2" /> | ||
Delete Message | ||
</button> | ||
</form> | ||
</ModalTemplate> | ||
) | ||
} |
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,10 @@ | ||
import {JSX} from "solid-js"; | ||
|
||
export default function EllipsisVertical(props: JSX.SvgSVGAttributes<SVGSVGElement>) { | ||
return ( | ||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 512" {...props}> | ||
{/*Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.*/} | ||
<path d="M64 360a56 56 0 1 0 0 112 56 56 0 1 0 0-112zm0-160a56 56 0 1 0 0 112 56 56 0 1 0 0-112zM120 96A56 56 0 1 0 8 96a56 56 0 1 0 112 0z"/> | ||
</svg> | ||
) | ||
} |
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,10 @@ | ||
import {JSX} from "solid-js"; | ||
|
||
export default function Reply(props: JSX.SvgSVGAttributes<SVGSVGElement>) { | ||
return ( | ||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" {...props}> | ||
{/*Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.*/} | ||
<path d="M205 34.8c11.5 5.1 19 16.6 19 29.2l0 64 112 0c97.2 0 176 78.8 176 176c0 113.3-81.5 163.9-100.2 174.1c-2.5 1.4-5.3 1.9-8.1 1.9c-10.9 0-19.7-8.9-19.7-19.7c0-7.5 4.3-14.4 9.8-19.5c9.4-8.8 22.2-26.4 22.2-56.7c0-53-43-96-96-96l-96 0 0 64c0 12.6-7.4 24.1-19 29.2s-25 3-34.4-5.4l-160-144C3.9 225.7 0 217.1 0 208s3.9-17.7 10.6-23.8l160-144c9.4-8.5 22.9-10.6 34.4-5.4z"/> | ||
</svg> | ||
) | ||
} |
Oops, something went wrong.