Skip to content

Commit bab1162

Browse files
authored
Merge pull request #235 from ThatGravyBoat/fix/misc-fixes
Fix: Miscellaneous changes/fixes
2 parents 4b9c6bf + 1c8246b commit bab1162

File tree

7 files changed

+18
-22
lines changed

7 files changed

+18
-22
lines changed
Lines changed: 3 additions & 4 deletions
Loading

apps/frontend/src/ui/components/game/PlayerHead.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type PlayerHeadProps = JSX.IntrinsicElements['img'] & {
88
};
99

1010
function crafatar(uuid: string) {
11-
return `https://crafatar.com/avatars/${uuid}?size=48`;
11+
return `https://crafatar.com/avatars/${uuid}?size=48&overlay`;
1212
}
1313

1414
function PlayerHead(props: PlayerHeadProps) {

apps/frontend/src/ui/components/overlay/Modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export type ModalProps = {
127127

128128
function Modal(props: ModalProps) {
129129
return (
130-
<div class="min-w-xs flex flex-col gap-y-2 border border-white/5 rounded-lg bg-page p-4 text-center" ref={mergeRefs(props.ref)}>
130+
<div class="min-w-md flex flex-col gap-y-2 border border-white/5 rounded-lg bg-page p-4 text-center" ref={mergeRefs(props.ref)}>
131131
{props.children}
132132
</div>
133133
);

apps/frontend/src/ui/components/overlay/Popup.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export type PopupProps = Omit<Parameters<typeof Portal>[0], 'children'> & Parent
1919
function Popup(props: PopupProps) {
2020
let popupRef!: HTMLDivElement;
2121

22-
function onMouseDown(e: MouseEvent) {
22+
function onClick(e: MouseEvent) {
2323
e.stopPropagation();
2424
if (!popupRef || !props.visible())
2525
return;
@@ -31,9 +31,9 @@ function Popup(props: PopupProps) {
3131

3232
createEffect(() => {
3333
if (props.visible())
34-
document.addEventListener('mousedown', onMouseDown);
34+
document.addEventListener('click', onClick);
3535
else
36-
document.removeEventListener('mousedown', onMouseDown);
36+
document.removeEventListener('click', onClick);
3737
});
3838

3939
return (

apps/frontend/src/ui/hooks/useNotifications.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,6 @@ export function NotificationProvider(props: ParentProps) {
1818
let unlisten: UnlistenFn | undefined;
1919

2020
onMount(() => {
21-
document.addEventListener('keypress', (e) => {
22-
if (e.key === 'n')
23-
setNotifications(notifications => ({
24-
...notifications,
25-
[Math.random().toString()]: {
26-
title: 'Test',
27-
message: 'This is a test notification',
28-
},
29-
}));
30-
});
31-
3221
events.ingressPayload.listen((e) => {
3322
setNotifications(notifications => ({
3423
...notifications,

apps/frontend/src/ui/pages/cluster/ClusterLogs.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ import useCommand, { tryResult } from '~ui/hooks/useCommand';
99
import useSettings from '~ui/hooks/useSettings';
1010
import { join } from 'pathe';
1111
import { createEffect, createSignal, For, Show, untrack } from 'solid-js';
12+
import useNotifications from "~ui/hooks/useNotifications.tsx";
1213

1314
function ClusterLogs() {
1415
const [cluster] = useClusterContext();
1516
const [logs] = useCommand(() => bridge.commands.getClusterLogs(cluster()!.uuid));
1617
const { settings } = useSettings();
18+
const notifications = useNotifications();
1719

1820
const [activeLogFile, setActiveLogFile] = createSignal<string | null>(null);
1921
const [logContent, setLogContent] = createSignal<string | null>(null);
@@ -46,7 +48,11 @@ function ClusterLogs() {
4648
return;
4749

4850
const id = await tryResult(() => bridge.commands.uploadLog(cluster()!.uuid, log));
49-
open(`https://mclo.gs/${id}`);
51+
52+
open(`https://mclo.gs/${id}`).then(() => notifications.set("logs", {
53+
title: "Log Uploaded",
54+
message: "Opening in your browser."
55+
}));
5056
}
5157

5258
const missingLogs = () => logs() === undefined || logs()?.length === 0 || false;

packages/client/src/utils/markdown.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@ export const configuredXss: FilterXSS = new FilterXSS({
1515
kbd: ['id'],
1616
input: ['checked', 'disabled', 'type'],
1717
iframe: ['width', 'height', 'allowfullscreen', 'frameborder', 'start', 'end'],
18-
img: [...(whiteList.img || []), 'usemap', 'style'],
18+
img: [...(whiteList.img || []), 'usemap', 'style', 'align'],
1919
map: ['name'],
2020
area: [...(whiteList.a || []), 'coords'],
2121
a: [...(whiteList.a || []), 'rel'],
2222
td: [...(whiteList.td || []), 'style'],
2323
th: [...(whiteList.th || []), 'style'],
2424
picture: [],
2525
source: ['media', 'sizes', 'src', 'srcset', 'type'],
26+
p: [...(whiteList.p || []), 'align'],
27+
div: [...(whiteList.p || []), 'align'],
2628

2729
// Other
2830
center: [],

0 commit comments

Comments
 (0)