Consolidate published content layouts and fix comments
This commit is contained in:
parent
d529b043c6
commit
c38275e2f2
19 changed files with 637 additions and 721 deletions
|
|
@ -12,7 +12,7 @@
|
|||
>
|
||||
<div class="mx-auto flex min-h-screen max-w-3xl flex-col items-center justify-center text-center tracking-tight">
|
||||
<div class="text-bm-500 dark:text-bm-400">
|
||||
<svg width="3rem" height="3rem" class="fill-current" viewBox="0 0 512 512">
|
||||
<svg style={{ width: "3rem", height: "3rem", fill: "currentColor" }} viewBox="0 0 512 512">
|
||||
<path
|
||||
d="M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"
|
||||
></path>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
---
|
||||
import type { Lang } from "../content/config";
|
||||
import { t } from "../i18n";
|
||||
import { t, type Lang } from "../i18n";
|
||||
|
||||
type Props = {
|
||||
lang: Lang;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
---
|
||||
import type { Lang } from "../content/config";
|
||||
import { t } from "../i18n";
|
||||
import { t, type Lang } from "../i18n";
|
||||
|
||||
type Props = {
|
||||
lang: Lang;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
import type { CopyrightedCharacters, Lang } from "../content/config";
|
||||
import { t } from "../i18n";
|
||||
import type { CopyrightedCharacters } from "../content/config";
|
||||
import { t, type Lang } from "../i18n";
|
||||
import UserComponent from "./UserComponent.astro";
|
||||
import CopyrightedCharactersItem from "./CopyrightedCharactersItem.astro";
|
||||
import { formatCopyrightedCharacters } from "../utils/format_copyrighted_characters";
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
import type { Lang } from "../content/config";
|
||||
import type { Lang } from "../i18n";
|
||||
|
||||
type Props = {
|
||||
lang: Lang;
|
||||
|
|
@ -42,9 +42,8 @@ const { link, instance, user, postId } = Astro.props;
|
|||
|
||||
<template id="template-button-loading">
|
||||
<svg
|
||||
width="1.25rem"
|
||||
height="1.25rem"
|
||||
class="-mt-1 mr-1 inline animate-spin"
|
||||
style={{ width: "1.25rem", height: "1.25rem", display: "inline" }}
|
||||
class="-mt-1 mr-1 animate-spin"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
aria-hidden
|
||||
|
|
@ -78,7 +77,7 @@ const { link, instance, user, postId } = Astro.props;
|
|||
<div class="ml-1 flex flex-row pb-2 pt-1">
|
||||
<div class="flex" aria-label="Favorites">
|
||||
<span data-favorites></span>
|
||||
<svg width="1.25rem" class="ml-2 fill-current" viewBox="0 0 576 512" aria-hidden>
|
||||
<svg style={{ width: "1.25rem", fill: "currentColor" }} class="ml-2" viewBox="0 0 576 512" aria-hidden>
|
||||
<path
|
||||
d="M316.9 18C311.6 7 300.4 0 288.1 0s-23.4 7-28.8 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3l128.3-68.5 128.3 68.5c10.8 5.7 23.9 4.9 33.8-2.3s14.9-19.3 12.9-31.3L438.5 329 542.7 225.9c8.6-8.5 11.7-21.2 7.9-32.7s-13.7-19.9-25.7-21.7L381.2 150.3 316.9 18z"
|
||||
></path>
|
||||
|
|
@ -86,7 +85,7 @@ const { link, instance, user, postId } = Astro.props;
|
|||
</div>
|
||||
<div class="ml-4 flex" aria-label="Reblogs">
|
||||
<span data-reblogs></span>
|
||||
<svg width="1.25rem" class="ml-2 fill-current" viewBox="0 0 512 512" aria-hidden>
|
||||
<svg style={{ width: "1.25rem", fill: "currentColor" }} class="ml-2" viewBox="0 0 512 512" aria-hidden>
|
||||
<path
|
||||
d="M0 224c0 17.7 14.3 32 32 32s32-14.3 32-32c0-53 43-96 96-96H320v32c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-9.2-9.2-22.9-11.9-34.9-6.9S320 19.1 320 32V64H160C71.6 64 0 135.6 0 224zm512 64c0-17.7-14.3-32-32-32s-32 14.3-32 32c0 53-43 96-96 96H192V352c0-12.9-7.8-24.6-19.8-29.6s-25.7-2.2-34.9 6.9l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6V448H352c88.4 0 160-71.6 160-160z"
|
||||
></path>
|
||||
|
|
@ -241,10 +240,11 @@ const { link, instance, user, postId } = Astro.props;
|
|||
if (!post.link || !post.instance || !post.user || !post.postId) {
|
||||
return;
|
||||
}
|
||||
const loadCommentsButton = document
|
||||
.querySelector<HTMLElementTagNameMap["template"]>("template#template-button")!
|
||||
.content.cloneNode(true) as HTMLButtonElement;
|
||||
commentSection.querySelector<HTMLElementTagNameMap["div"]>("div#comments")!.replaceChildren(loadCommentsButton);
|
||||
const commentsContainer = commentSection.querySelector<HTMLElementTagNameMap["div"]>("div#comments")!;
|
||||
commentsContainer.replaceChildren(
|
||||
document.querySelector<HTMLElementTagNameMap["template"]>("template#template-button")!.content.cloneNode(true),
|
||||
);
|
||||
const loadCommentsButton = commentsContainer.querySelector("button")!;
|
||||
loadCommentsButton.addEventListener("click", (e) => {
|
||||
e.preventDefault();
|
||||
loadCommentsButton.setAttribute("disabled", "true");
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
---
|
||||
import type { Lang } from "../content/config";
|
||||
import { t } from "../i18n";
|
||||
import { t, type Lang } from "../i18n";
|
||||
|
||||
type Props = {
|
||||
lang: Lang;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
import type { CollectionEntry } from "astro:content";
|
||||
import type { Lang } from "../content/config";
|
||||
import type { Lang } from "../i18n";
|
||||
import { getUsernameForLang } from "../utils/get_username_for_lang";
|
||||
|
||||
type Props = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue