Skip to content

Commit 2400105

Browse files
committed
issue #971 - Remove "Folders" from mobile sidebar header since folders are not yet implemented & issue 970 - Move verse reference display to compact scroll header on mobile
1 parent 71cc8bb commit 2400105

File tree

3 files changed

+78
-68
lines changed

3 files changed

+78
-68
lines changed

packages/seed-bible/app/components/sideBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1619,7 +1619,7 @@ function SideBar({ panelsNumber }) {
16191619
<>
16201620
<div className="mobile-sidebar-overlay">
16211621
<div className="mobile-sidebar-header">
1622-
<h2>Tabs & Folders</h2>
1622+
<h2>Tabs</h2>
16231623
<div className="mobile-header-actions">
16241624
{/* <span
16251625
className="mobile-header-icon"

packages/seed-bible/app/components/thePage.tsx

Lines changed: 76 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,17 +1784,19 @@ function ThePage({
17841784
globalThis.closePopupSettings();
17851785
const el = e.currentTarget;
17861786
const currentScrollTop = el.scrollTop;
1787-
if (currentScrollTop <= 0) {
1788-
document.body.classList.remove("scroll-hide-bars");
1789-
} else if (
1790-
currentScrollTop > lastScrollTopRef.current &&
1791-
currentScrollTop > 50
1792-
) {
1793-
document.body.classList.add("scroll-hide-bars");
1794-
} else if (currentScrollTop < lastScrollTopRef.current) {
1795-
document.body.classList.remove("scroll-hide-bars");
1787+
if (globalThis.IsMobileNow && globalThis.IsMobileNow()) {
1788+
if (currentScrollTop <= 0) {
1789+
document.body.classList.remove("scroll-hide-bars");
1790+
} else if (
1791+
currentScrollTop > lastScrollTopRef.current &&
1792+
currentScrollTop > 50
1793+
) {
1794+
document.body.classList.add("scroll-hide-bars");
1795+
} else if (currentScrollTop < lastScrollTopRef.current) {
1796+
document.body.classList.remove("scroll-hide-bars");
1797+
}
1798+
lastScrollTopRef.current = currentScrollTop;
17961799
}
1797-
lastScrollTopRef.current = currentScrollTop;
17981800
}}
17991801
style={{
18001802
flex: "0 0 33.333%",
@@ -2044,6 +2046,47 @@ function ThePage({
20442046
display: none;
20452047
}
20462048
}
2049+
2050+
/* Compact scroll header - shows book/chapter when main header is hidden */
2051+
.mobile-compact-scroll-header {
2052+
display: none;
2053+
position: fixed;
2054+
top: 0;
2055+
left: 0;
2056+
right: 0;
2057+
text-align: center;
2058+
padding: 8px 16px;
2059+
background: var(--pageBackground);
2060+
z-index: 99;
2061+
font-size: 14px;
2062+
font-weight: 600;
2063+
color: var(--text1);
2064+
opacity: 0;
2065+
pointer-events: none;
2066+
transition: opacity 0.3s ease;
2067+
}
2068+
2069+
body.scroll-hide-bars .mobile-compact-scroll-header {
2070+
opacity: 1;
2071+
}
2072+
2073+
@media (max-width: 768px) {
2074+
.mobile-compact-scroll-header {
2075+
display: block;
2076+
}
2077+
}
2078+
2079+
.compact-header-divider {
2080+
margin: 0 6px;
2081+
color: #666;
2082+
font-weight: 400;
2083+
}
2084+
2085+
.compact-header-translation {
2086+
font-weight: 400;
2087+
font-size: 12px;
2088+
color: #999;
2089+
}
20472090
`}
20482091
</style>
20492092
{data && tab && !tabEntered ? (
@@ -2360,6 +2403,29 @@ function ThePage({
23602403
</div>
23612404
)}
23622405

2406+
{/* Compact scroll header - shows book/chapter info when scrolled down on mobile */}
2407+
{globalThis.IsMobileNow && globalThis.IsMobileNow() && data && (
2408+
<div className="mobile-compact-scroll-header">
2409+
{showVerseToolbar && clickedVerses.length > 0 ? (
2410+
<>
2411+
{`Selected: ${data?.book} ${data?.chapter}:${[...clickedVerses].sort((a, b) => a - b).join(",")}`}
2412+
<span className="compact-header-divider">|</span>
2413+
<span className="compact-header-translation">
2414+
{data?.shortName || ""}
2415+
</span>
2416+
</>
2417+
) : (
2418+
<>
2419+
{`${data?.book} ${data?.chapter}`}
2420+
<span className="compact-header-divider">|</span>
2421+
<span className="compact-header-translation">
2422+
{data?.shortName || ""}
2423+
</span>
2424+
</>
2425+
)}
2426+
</div>
2427+
)}
2428+
23632429
{/* Footnote Modal rendered outside the carousel so position:fixed works relative to the viewport */}
23642430
{showFootnoteModal && activeFootnote && (
23652431
<div

packages/seed-bible/app/components/verseToolbar.tsx

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -106,28 +106,6 @@ export function VerseToolbar({
106106
};
107107
}, [isPickingColor, tempColor]);
108108

109-
const getVerseReference = () => {
110-
if (clickedVerses.length === 0) return "";
111-
const sorted = [...clickedVerses].sort((a, b) => a - b);
112-
113-
const groups = [];
114-
let start = sorted[0];
115-
let end = sorted[0];
116-
117-
for (let i = 1; i < sorted.length; i++) {
118-
if (sorted[i] === end + 1) {
119-
end = sorted[i];
120-
} else {
121-
groups.push(start === end ? `${start}` : `${start}-${end}`);
122-
start = sorted[i];
123-
end = sorted[i];
124-
}
125-
}
126-
groups.push(start === end ? `${start}` : `${start}-${end}`);
127-
128-
return `${book} ${chapter}:${groups.join(",")}`;
129-
};
130-
131109
const containerStyle = {
132110
position: "relative",
133111
bottom: "20px",
@@ -156,21 +134,6 @@ export function VerseToolbar({
156134
maxWidth: "90dvw",
157135
};
158136

159-
const verseRefStyle = {
160-
fontSize: "14px",
161-
fontWeight: "600",
162-
letterSpacing: "0.5px",
163-
textTransform: "uppercase",
164-
padding: "8px 16px",
165-
borderRadius: "8px",
166-
color: "var(--text1)",
167-
backgroundColor: "var(--panelBackground)",
168-
// border: "1px solid #e5e5e5",
169-
// boxShadow: "0 2px 8px rgba(0, 0, 0, 0.1)",
170-
width: "fit-content",
171-
// margin: "0 auto 8px auto",
172-
};
173-
174137
const dividerStyle = {
175138
width: "1px",
176139
height: "24px",
@@ -328,26 +291,7 @@ export function VerseToolbar({
328291
pointer-events:${globalThis.IsMobileNow() && showVerseToolbar ? "none !important" : ""}
329292
}
330293
`}</style>
331-
{globalThis.IsMobileNow() && selectionSettings.showSelectedItems && (
332-
<>
333-
{
334-
null /*<div className="verse-ref">
335-
<img src="https://res.cloudinary.com/dfbtwwa8p/image/upload/v1764875876/Rectangle_11_yzpmpm.svg" />
336-
</div>*/
337-
}
338-
<span
339-
className="verse-ref"
340-
style={{
341-
...verseRefStyle,
342-
padding: "8px 36px",
343-
borderRadius: "2px",
344-
backgroundColor: "var(--pageBackground)",
345-
}}
346-
>
347-
{getVerseReference()}
348-
</span>
349-
</>
350-
)}
294+
{/* verse-ref moved to compact scroll header in thePage.tsx */}
351295
<div className="verse-toolbar" style={containerStyle}>
352296
<style>
353297
{`

0 commit comments

Comments
 (0)