Skip to content

Commit

Permalink
Improve overflow behavior on header and footer
Browse files Browse the repository at this point in the history
  • Loading branch information
bcomnes committed Jan 1, 2023
1 parent 9250f28 commit acaf964
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 7 deletions.
4 changes: 2 additions & 2 deletions web/account/username/username-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ export const usernameEdit = Component(({ user, onSave, onCancelEdit }) => {
<form ref="${formRef}" class="bc-account-username-edit-form" id="bc-account-username-edit-form" onsubmit=${handleSave}>
<fieldset ?disabled=${disabled}>
<legend class="bc-account-username-edit-legend">Edit username</legend>
<div>
<div>
<label class='block'>
username:
<input class='block' type="text" name="username" value="${user.username}"/>
<input class='block' pattern="^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$" minlength="1" maxlength="50" type="text" name="username" value="${user.username}"/>
</label>
</div>
<div class="bc-account-username-edit-submit-line">
Expand Down
15 changes: 15 additions & 0 deletions web/components/header/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
padding-right: max(var(--body-padding), env(safe-area-inset-right));
padding-top: max(var(--body-padding), env(safe-area-inset-top));
padding-bottom: var(--body-padding);
overflow-x: scroll;
overflow-y: hidden;
white-space:nowrap;
scrollbar-width: none;
}

.bc-header-nav::-webkit-scrollbar {
display: none;
}

.bc-logo {
Expand All @@ -22,6 +30,13 @@

.bc-header-start {
align-items: baseline;
overflow: hidden;
min-width: 100px;
}

.bc-header-start a {
overflow: hidden;
text-overflow: ellipsis;
}

.bc-header-end {
Expand Down
4 changes: 2 additions & 2 deletions web/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ export const header = Component(() => {
<div class="bc-header-start">
<span class="bc-logo round">
<span>🥖 </span>
${user ? null : html`<a href="/">Breadcrum</a>`}
${!user ? html`<a href="/">Breadcrum</a>` : null}
</span>
${user ? html`<span><a href='/account'>${user.username}</a></span>` : null}
${user ? html`<a href='/account'>${user.username}</a>` : null}
</div>
<div class="bc-header-end">
${!user
Expand Down
18 changes: 17 additions & 1 deletion web/document.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,28 @@

.bc-footer {
padding-top: var(--body-padding);
padding-bottom: max(var(--body-padding), env(safe-area-inset-bottom));
padding-left: max(var(--body-padding), env(safe-area-inset-left));
padding-right: max(var(--body-padding), env(safe-area-inset-right));
padding-bottom: max(var(--body-padding), env(safe-area-inset-bottom));
display: flex;
justify-content: center;
gap: 1em;
font-size: var(--small-font-size);
border-top: dotted 1px var(--accent-midground);
overflow-x: scroll;
overflow-y: hidden;
white-space:nowrap;
scrollbar-width: none;
}

.bc-footer::-webkit-scrollbar {
display: none;
}


/* fairly arbitrary. Just make sure the content justification */
@media screen and (max-width: 500px) {
.bc-footer {
justify-content: start;
}
}
4 changes: 2 additions & 2 deletions web/hooks/useUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export function useUser ({
} = {}) {
const state = useLSP()

const [loading, setLoading] = useState(true)
const [error, setError] = useState(true)
const [loading, setLoading] = useState(false)
const [error, setError] = useState(null)

useEffect(() => {
setLoading(true)
Expand Down

0 comments on commit acaf964

Please sign in to comment.