Make sheet have header and body section

This commit is contained in:
Lim Chee Aun 2022-12-25 18:01:01 +08:00
parent 0276820185
commit cf4fbc8553
6 changed files with 325 additions and 295 deletions

View file

@ -583,22 +583,36 @@ button.carousel-dot[disabled].active {
} }
.sheet { .sheet {
align-self: flex-end; align-self: flex-end;
display: flex;
flex-direction: column;
max-height: 90vh; max-height: 90vh;
max-height: 90dvh; max-height: 90dvh;
overflow: auto; overflow: hidden;
overflow-x: hidden;
background-color: var(--bg-color); background-color: var(--bg-color);
width: 100%; width: 100%;
max-width: calc(40em - 50px - 16px); max-width: calc(40em - 50px - 16px);
border-radius: 16px 16px 0 0; border-radius: 16px 16px 0 0;
padding: 16px;
padding-left: max(16px, env(safe-area-inset-left));
padding-right: max(16px, env(safe-area-inset-right));
padding-bottom: max(16px, env(safe-area-inset-bottom));
box-shadow: 0 -1px 32px var(--divider-color); box-shadow: 0 -1px 32px var(--divider-color);
animation: slide-up 0.2s var(--timing-function); animation: slide-up 0.2s var(--timing-function);
border: 1px solid var(--outline-color); border: 1px solid var(--outline-color);
}
.sheet header {
padding: 16px 16px 8px;
padding-left: max(16px, env(safe-area-inset-left));
padding-right: max(16px, env(safe-area-inset-right));
}
.sheet main {
overflow: auto;
overflow-x: hidden;
overscroll-behavior: contain; overscroll-behavior: contain;
padding: 16px 16px;
padding-left: max(16px, env(safe-area-inset-left));
padding-right: max(16px, env(safe-area-inset-right));
padding-bottom: max(16px, env(safe-area-inset-bottom));
mask-image: linear-gradient(to bottom, transparent 0%, black 10px);
}
.sheet header + main {
padding-top: 0;
} }
/* TAG */ /* TAG */

View file

@ -12,7 +12,7 @@
font-size: 95%; font-size: 95%;
line-height: 1.4; line-height: 1.4;
} }
#account-container .note:not(:has(p)) { #account-container .note:not(:has(p)):not(:empty) {
/* Some notes don't have <p> tags, so we need to add some padding */ /* Some notes don't have <p> tags, so we need to add some padding */
padding: 1em 0; padding: 1em 0;
} }

View file

@ -108,6 +108,7 @@ function Account({ account }) {
<Avatar size="xxxl" /> <Avatar size="xxxl" />
</header> </header>
<main>
<div class="note"> <div class="note">
<p> </p> <p> </p>
<p> </p> <p> </p>
@ -117,6 +118,7 @@ function Account({ account }) {
<span> Following</span> <span> Following</span>
<span> Followers</span> <span> Followers</span>
</p> </p>
</main>
</> </>
) : ( ) : (
<> <>
@ -124,6 +126,7 @@ function Account({ account }) {
<Avatar url={avatar} size="xxxl" /> <Avatar url={avatar} size="xxxl" />
<NameText account={info} showAcct external /> <NameText account={info} showAcct external />
</header> </header>
<main>
<div <div
class="note" class="note"
dangerouslySetInnerHTML={{ dangerouslySetInnerHTML={{
@ -154,7 +157,8 @@ function Account({ account }) {
)} )}
<p class="stats"> <p class="stats">
<span> <span>
<b title={statusesCount}>{shortenNumber(statusesCount)}</b> Posts <b title={statusesCount}>{shortenNumber(statusesCount)}</b>{' '}
Posts
</span> </span>
<span> <span>
<b title={followingCount}>{shortenNumber(followingCount)}</b>{' '} <b title={followingCount}>{shortenNumber(followingCount)}</b>{' '}
@ -214,6 +218,7 @@ function Account({ account }) {
</button> </button>
)} )}
</p> </p>
</main>
</> </>
)} )}
</div> </div>

View file

@ -712,6 +712,11 @@ a.card:hover {
min-height: 50dvh; min-height: 50dvh;
} }
#edit-history h2 {
margin: 0;
padding: 0;
}
#edit-history :is(ol, ol li) { #edit-history :is(ol, ol li) {
list-style: none; list-style: none;
margin: 0; margin: 0;

View file

@ -1134,6 +1134,7 @@ function EditedAtModal({ statusID, onClose = () => {} }) {
return ( return (
<div id="edit-history" class="sheet"> <div id="edit-history" class="sheet">
<header>
{/* <button type="button" class="close-button plain large" onClick={onClose}> {/* <button type="button" class="close-button plain large" onClick={onClose}>
<Icon icon="x" alt="Close" /> <Icon icon="x" alt="Close" />
</button> */} </button> */}
@ -1144,6 +1145,8 @@ function EditedAtModal({ statusID, onClose = () => {} }) {
<Loader abrupt /> Loading&hellip; <Loader abrupt /> Loading&hellip;
</p> </p>
)} )}
</header>
<main>
{editHistory.length > 0 && ( {editHistory.length > 0 && (
<ol> <ol>
{editHistory.map((status) => { {editHistory.map((status) => {
@ -1174,6 +1177,7 @@ function EditedAtModal({ statusID, onClose = () => {} }) {
})} })}
</ol> </ol>
)} )}
</main>
</div> </div>
); );
} }

View file

@ -24,6 +24,7 @@ function Settings({ onClose }) {
return ( return (
<div id="settings-container" class="sheet"> <div id="settings-container" class="sheet">
<main>
{/* <button type="button" class="close-button plain large" onClick={onClose}> {/* <button type="button" class="close-button plain large" onClick={onClose}>
<Icon icon="x" alt="Close" /> <Icon icon="x" alt="Close" />
</button> */} </button> */}
@ -204,6 +205,7 @@ function Settings({ onClose }) {
)} )}
</p> </p>
)} )}
</main>
</div> </div>
); );
} }