diff --git a/src/material/AppTopBar.css b/src/material/AppTopBar.css new file mode 100644 index 0000000..27169b7 --- /dev/null +++ b/src/material/AppTopBar.css @@ -0,0 +1,5 @@ +.AppTopBar { + & > .toolbar { + padding-top: var(--safe-area-inset-top, 0px); + } +} diff --git a/src/material/AppTopBar.tsx b/src/material/AppTopBar.tsx new file mode 100644 index 0000000..dca5852 --- /dev/null +++ b/src/material/AppTopBar.tsx @@ -0,0 +1,31 @@ +import { AppBar, Toolbar } from "@suid/material"; +import { splitProps, type JSX, type ParentComponent } from "solid-js"; +import "./AppTopBar.css"; +import { useWindowSize } from "@solid-primitives/resize-observer"; + +const AppTopBar: ParentComponent<{ + class?: string; + style?: JSX.HTMLAttributes["style"]; +}> = (oprops) => { + const [props, rest] = splitProps(oprops, ["children", "class"]); + const windowSize = useWindowSize(); + + return ( + + windowSize.height ? "dense" : "regular"} + class="toolbar" + sx={{ paddingTop: "var(--safe-area-inset-top, 0px)" }} + > + {props.children} + + + ); +}; + +export default AppTopBar; diff --git a/src/timelines/TootBottomSheet.tsx b/src/timelines/TootBottomSheet.tsx index 065a754..eecc8fc 100644 --- a/src/timelines/TootBottomSheet.tsx +++ b/src/timelines/TootBottomSheet.tsx @@ -29,6 +29,10 @@ import TootList from "./TootList"; import "./TootBottomSheet.css"; import { useNavigator } from "~platform/StackedRouter"; import BackButton from "~platform/BackButton"; +import ItemSelectionProvider, { + createSingluarItemSelection, +} from "./toots/ItemSelectionProvider"; +import AppTopBar from "~material/AppTopBar"; let cachedEntry: [string, mastodon.v1.Status] | undefined; @@ -44,13 +48,11 @@ function getCache(acct: string, id: string) { const TootBottomSheet: Component = (props) => { const params = useParams<{ acct: string; id: string }>(); - const location = useLocation<{ - tootReply?: boolean; - }>(); - const { pop, push } = useNavigator(); + const { push } = useNavigator(); const time = createTimeSource(); const acctText = () => decodeURIComponent(params.acct); const session = useSessionForAcctStr(acctText); + const [, selectionState] = createSingluarItemSelection(); const [remoteToot, { mutate: setRemoteToot }] = createResource( () => [session().client, params.id] as const, @@ -247,25 +249,18 @@ const TootBottomSheet: Component = (props) => { return ( - - - - <span innerHTML={tootDisplayName() ?? "Someone"}></span> - <span>'s toot</span> - - - + + + <span innerHTML={tootDisplayName() ?? "Someone"}></span> + <span>'s toot</span> + + } class="TootBottomSheet" > @@ -322,11 +317,13 @@ const TootBottomSheet: Component = (props) => { - + + + diff --git a/src/timelines/toots/TootContent.tsx b/src/timelines/toots/TootContent.tsx index 2960794..956ff45 100644 --- a/src/timelines/toots/TootContent.tsx +++ b/src/timelines/toots/TootContent.tsx @@ -17,7 +17,7 @@ function preventDefault(event: Event) { event.preventDefault(); } -export type TootContentProps = JSX.HTMLAttributes & { +export type TootContentProps = JSX.HTMLAttributes & { source?: string; emojis?: mastodon.v1.CustomEmoji[]; mentions: mastodon.v1.StatusMention[]; @@ -58,7 +58,7 @@ const TootContent: Component = (oprops) => { }; return ( -
{ createRenderEffect(() => { const finder = clientFinder(); @@ -104,7 +104,7 @@ const TootContent: Component = (oprops) => { } >
- + ); };