|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
import Big from "big.js";
|
|
|
|
|
import { fromUnixTime, intlFormat } from "date-fns";
|
|
|
|
|
import { JSX } from "solid-js";
|
|
|
|
|
|
|
|
|
|
export const sleep = (timeout: number) =>
|
|
|
|
|
new Promise((res) => setTimeout(res, timeout));
|
|
|
|
@ -65,3 +66,20 @@ export const shuffle = (list: any[]) => {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const getHost = () => "https://rappli.ch";
|
|
|
|
|
|
|
|
|
|
export const onClickFocus: JSX.EventHandlerUnion<
|
|
|
|
|
HTMLAnchorElement,
|
|
|
|
|
MouseEvent
|
|
|
|
|
> = (evt) => {
|
|
|
|
|
const el = evt.currentTarget!;
|
|
|
|
|
const id = el.getAttribute("href");
|
|
|
|
|
if (id == null) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const targetEl = document.querySelector<HTMLElement>(id);
|
|
|
|
|
if (targetEl == null) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
targetEl.focus();
|
|
|
|
|
};
|
|
|
|
|