TootBottomSheet: test scrollable
This commit is contained in:
		
							parent
							
								
									34dd95e959
								
							
						
					
					
						commit
						8066f699bd
					
				
					 2 changed files with 74 additions and 57 deletions
				
			
		
							
								
								
									
										18
									
								
								src/timelines/TootBottomSheet.css
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								src/timelines/TootBottomSheet.css
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,18 @@
 | 
			
		|||
.TootBottomSheet {
 | 
			
		||||
  overflow: hidden;
 | 
			
		||||
 | 
			
		||||
  .Scrollable {
 | 
			
		||||
    padding-bottom: var(--safe-area-inset-bottom, 0);
 | 
			
		||||
    overflow-y: auto;
 | 
			
		||||
    overscroll-behavior-y: contain;
 | 
			
		||||
    max-height: calc(100vh - var(--scaffold-topbar-height, 0px));
 | 
			
		||||
    max-height: calc(100dvh - var(--scaffold-topbar-height, 0px));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  .progress-line {
 | 
			
		||||
    display: flex;
 | 
			
		||||
    justify-content: center;
 | 
			
		||||
    margin-top: 12px;
 | 
			
		||||
    margin-bottom: 12px;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -11,9 +11,7 @@ import {
 | 
			
		|||
import Scaffold from "../material/Scaffold";
 | 
			
		||||
import { AppBar, CircularProgress, IconButton, Toolbar } from "@suid/material";
 | 
			
		||||
import { Title } from "../material/typography";
 | 
			
		||||
import {
 | 
			
		||||
  Close as CloseIcon,
 | 
			
		||||
} from "@suid/icons-material";
 | 
			
		||||
import { Close as CloseIcon } from "@suid/icons-material";
 | 
			
		||||
import { useSessionForAcctStr } from "../masto/clients";
 | 
			
		||||
import { resolveCustomEmoji } from "../masto/toot";
 | 
			
		||||
import RegularToot, { findElementActionable } from "./RegularToot";
 | 
			
		||||
| 
						 | 
				
			
			@ -26,6 +24,7 @@ import TootComposer from "./TootComposer";
 | 
			
		|||
import { useDocumentTitle } from "../utils";
 | 
			
		||||
import { createTimelineControlsForArray } from "../masto/timelines";
 | 
			
		||||
import TootList from "./TootList";
 | 
			
		||||
import "./TootBottomSheet.css";
 | 
			
		||||
 | 
			
		||||
let cachedEntry: [string, mastodon.v1.Status] | undefined;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -245,64 +244,64 @@ const TootBottomSheet: Component = (props) => {
 | 
			
		|||
          </Toolbar>
 | 
			
		||||
        </AppBar>
 | 
			
		||||
      }
 | 
			
		||||
      class="TootBottomSheet"
 | 
			
		||||
    >
 | 
			
		||||
      <TimeSourceProvider value={time}>
 | 
			
		||||
        <TootList
 | 
			
		||||
          threads={ancestors.list}
 | 
			
		||||
          onUnknownThread={ancestors.getPath}
 | 
			
		||||
          onChangeToot={ancestors.set}
 | 
			
		||||
        />
 | 
			
		||||
 | 
			
		||||
        <article>
 | 
			
		||||
          <Show when={toot()}>
 | 
			
		||||
            <RegularToot
 | 
			
		||||
              id={`toot-${toot()!.id}`}
 | 
			
		||||
              class={cards.card}
 | 
			
		||||
              style={{
 | 
			
		||||
                "scroll-margin-top":
 | 
			
		||||
                  "calc(var(--scaffold-topbar-height) + 20px)",
 | 
			
		||||
              }}
 | 
			
		||||
              status={toot()!}
 | 
			
		||||
              actionable={!!actSession()}
 | 
			
		||||
              evaluated={true}
 | 
			
		||||
              onBookmark={onBookmark}
 | 
			
		||||
              onRetoot={onBoost}
 | 
			
		||||
              onFavourite={onFav}
 | 
			
		||||
              onClick={handleMainTootClick}
 | 
			
		||||
            ></RegularToot>
 | 
			
		||||
          </Show>
 | 
			
		||||
        </article>
 | 
			
		||||
 | 
			
		||||
        <Show when={session()!.account}>
 | 
			
		||||
          <TootComposer
 | 
			
		||||
            mentions={defaultMentions()}
 | 
			
		||||
            profile={session().account!}
 | 
			
		||||
            replyToDisplayName={toot()?.account?.displayName || ""}
 | 
			
		||||
            client={session().client}
 | 
			
		||||
            onSent={() => refetchContext()}
 | 
			
		||||
            inReplyToId={remoteToot()?.reblog?.id ?? remoteToot()?.id}
 | 
			
		||||
      <div
 | 
			
		||||
        class="Scrollable"
 | 
			
		||||
      >
 | 
			
		||||
        <TimeSourceProvider value={time}>
 | 
			
		||||
          <TootList
 | 
			
		||||
            threads={ancestors.list}
 | 
			
		||||
            onUnknownThread={ancestors.getPath}
 | 
			
		||||
            onChangeToot={ancestors.set}
 | 
			
		||||
          />
 | 
			
		||||
        </Show>
 | 
			
		||||
 | 
			
		||||
        <Show when={tootContextErrorUncaught.loading}>
 | 
			
		||||
          <div
 | 
			
		||||
            style={{
 | 
			
		||||
              display: "flex",
 | 
			
		||||
              "justify-content": "center",
 | 
			
		||||
              "margin-block": "12px",
 | 
			
		||||
            }}
 | 
			
		||||
          >
 | 
			
		||||
            <CircularProgress style="width: 1.5em; height: 1.5em;" />
 | 
			
		||||
          </div>
 | 
			
		||||
        </Show>
 | 
			
		||||
          <article>
 | 
			
		||||
            <Show when={toot()}>
 | 
			
		||||
              <RegularToot
 | 
			
		||||
                id={`toot-${toot()!.id}`}
 | 
			
		||||
                class={cards.card}
 | 
			
		||||
                style={{
 | 
			
		||||
                  "scroll-margin-top":
 | 
			
		||||
                    "calc(var(--scaffold-topbar-height) + 20px)",
 | 
			
		||||
                }}
 | 
			
		||||
                status={toot()!}
 | 
			
		||||
                actionable={!!actSession()}
 | 
			
		||||
                evaluated={true}
 | 
			
		||||
                onBookmark={onBookmark}
 | 
			
		||||
                onRetoot={onBoost}
 | 
			
		||||
                onFavourite={onFav}
 | 
			
		||||
                onClick={handleMainTootClick}
 | 
			
		||||
              ></RegularToot>
 | 
			
		||||
            </Show>
 | 
			
		||||
          </article>
 | 
			
		||||
 | 
			
		||||
        <TootList
 | 
			
		||||
          threads={descendants.list}
 | 
			
		||||
          onUnknownThread={descendants.getPath}
 | 
			
		||||
          onChangeToot={descendants.set}
 | 
			
		||||
        />
 | 
			
		||||
      </TimeSourceProvider>
 | 
			
		||||
      <div style={{ height: "var(--safe-area-inset-bottom, 0)" }}></div>
 | 
			
		||||
          <Show when={session()!.account}>
 | 
			
		||||
            <TootComposer
 | 
			
		||||
              mentions={defaultMentions()}
 | 
			
		||||
              profile={session().account!}
 | 
			
		||||
              replyToDisplayName={toot()?.account?.displayName || ""}
 | 
			
		||||
              client={session().client}
 | 
			
		||||
              onSent={() => refetchContext()}
 | 
			
		||||
              inReplyToId={remoteToot()?.reblog?.id ?? remoteToot()?.id}
 | 
			
		||||
            />
 | 
			
		||||
          </Show>
 | 
			
		||||
 | 
			
		||||
          <Show when={tootContextErrorUncaught.loading}>
 | 
			
		||||
            <div
 | 
			
		||||
              class="progress-line"
 | 
			
		||||
            >
 | 
			
		||||
              <CircularProgress style="width: 1.5em; height: 1.5em;" />
 | 
			
		||||
            </div>
 | 
			
		||||
          </Show>
 | 
			
		||||
 | 
			
		||||
          <TootList
 | 
			
		||||
            threads={descendants.list}
 | 
			
		||||
            onUnknownThread={descendants.getPath}
 | 
			
		||||
            onChangeToot={descendants.set}
 | 
			
		||||
          />
 | 
			
		||||
        </TimeSourceProvider>
 | 
			
		||||
      </div>
 | 
			
		||||
    </Scaffold>
 | 
			
		||||
  );
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue