Compare commits

..

No commits in common. "cecebda39bbc913b5bbe2f3cf4bbf17acd0f1f42" and "b133a9b9a779f9a21d0b4a021502c1b5ffe7b726" have entirely different histories.

4 changed files with 4 additions and 20 deletions

View file

@ -1,11 +1,12 @@
import type { mastodon } from "masto"; import type { mastodon } from "masto";
import { Show, type Component } from "solid-js"; import { type Component } from "solid-js";
import tootStyle from "./toot.module.css"; import tootStyle from "./toot.module.css";
import { formatRelative } from "date-fns"; import { formatRelative } from "date-fns";
import Img from "../material/Img"; import Img from "../material/Img";
import { Body2 } from "../material/typography"; import { Body2 } from "../material/typography";
import { css } from "solid-styled";
import { appliedCustomEmoji } from "../masto/toot"; import { appliedCustomEmoji } from "../masto/toot";
import { TootPreviewCard } from "./RegularToot"; import cardStyle from "../material/cards.module.css";
type CompactTootProps = { type CompactTootProps = {
status: mastodon.v1.Status; status: mastodon.v1.Status;
@ -47,9 +48,6 @@ const CompactToot: Component<CompactTootProps> = (props) => {
}} }}
class={[tootStyle.compactTootContent].join(" ")} class={[tootStyle.compactTootContent].join(" ")}
></div> ></div>
<Show when={toot().card}>
<TootPreviewCard src={toot().card!} alwaysCompact />
</Show>
</section> </section>
); );
}; };

View file

@ -282,12 +282,6 @@ const Home: ParentComponent = (props) => {
if (items.length > idx) { if (items.length > idx) {
items.item(idx).scrollIntoView({ block: "start", behavior: "smooth" }); items.item(idx).scrollIntoView({ block: "start", behavior: "smooth" });
} }
if (isTabFocus(idx)) {
items.item(idx).scrollTo({
top: 0,
behavior: "smooth",
});
}
}; };
const openFullScreenToot = ( const openFullScreenToot = (

View file

@ -197,17 +197,10 @@ function TootAuthorGroup(props: { status: mastodon.v1.Status; now: Date }) {
); );
} }
export function TootPreviewCard(props: { function TootPreviewCard(props: { src: mastodon.v1.PreviewCard }) {
src: mastodon.v1.PreviewCard;
alwaysCompact?: boolean;
}) {
let root: HTMLAnchorElement; let root: HTMLAnchorElement;
createEffect(() => { createEffect(() => {
if (props.alwaysCompact) {
root.classList.add(tootStyle.compact);
return;
}
if (!props.src.width) return; if (!props.src.width) return;
const width = root.getBoundingClientRect().width; const width = root.getBoundingClientRect().width;
if (width > props.src.width) { if (width > props.src.width) {

View file

@ -147,7 +147,6 @@
grid-template-columns: minmax(10%, 30%) 1fr; grid-template-columns: minmax(10%, 30%) 1fr;
padding-left: 16px; padding-left: 16px;
padding-right: 16px; padding-right: 16px;
padding-top: 8px;
>img:first-child { >img:first-child {
grid-row: 1 / 3; grid-row: 1 / 3;