mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-19 02:17:09 +00:00
fix(ui): tighten sticky panes on skill detail and new skill pages
The 80px offset was there to clear the React Query devtools button, which only exists in dev, so released builds showed a large empty band above the file viewer and the SKILL.md preview. The info column on the SKILL.md tab now stays in view as well while a long document scrolls.
This commit is contained in:
@@ -226,10 +226,10 @@ export default function NewSkillPage() {
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{/* The preview stays in view while the form scrolls; the offset clears the fixed account avatar */}
|
||||
<div className="sticky top-20 flex min-w-0 flex-col">
|
||||
{/* The preview stays in view while the form scrolls */}
|
||||
<div className="sticky top-6 flex min-w-0 flex-col">
|
||||
<div className="ss-sec"><h2 className="ss-h2">{t('newSkill.preview.title')}</h2></div>
|
||||
<CodeView content={preview?.content ?? ''} lang="md" className="max-h-[calc(100vh-190px)] min-h-[330px]" />
|
||||
<CodeView content={preview?.content ?? ''} lang="md" className="max-h-[calc(100vh-134px)] min-h-[330px]" />
|
||||
{preview && <p className="mt-2.5 truncate font-mono text-[13px] text-ink-3" title={preview.path}>{preview.path}</p>}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -320,7 +320,9 @@ export default function ResourceDetailPage() {
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex flex-col gap-7">
|
||||
{/* Stays in view while a long SKILL.md scrolls; scrolls on its own when the targets outgrow
|
||||
the viewport. Padded by what it is pulled out by, so the scroll box does not clip shadows */}
|
||||
<div className="sticky top-6 -mb-2 -mr-2 flex max-h-[calc(100vh-3rem)] flex-col gap-7 overflow-y-auto pb-2 pr-2">
|
||||
<MetaBox
|
||||
resource={resource}
|
||||
frontmatter={frontmatter}
|
||||
@@ -621,9 +623,9 @@ function FilesTab({ resource, files, skillMd, tabSearch, components, raw, onRaw
|
||||
{t(sorted.length === 1 ? 'resourceDetail.meta.file' : 'resourceDetail.meta.files', { count: sorted.length })}
|
||||
</p>
|
||||
</div>
|
||||
{/* The viewer stays in view while a long file list scrolls the page. The offsets keep it clear of the
|
||||
fixed account avatar (top right) and the scroll-to-top button (bottom right) */}
|
||||
<div className="sticky top-20 flex h-[calc(100vh-160px)] min-h-[360px] min-w-0 flex-col gap-2.5">
|
||||
{/* The viewer stays in view while a long file list scrolls the page. The height leaves room
|
||||
below for the scroll-to-top button (bottom right) */}
|
||||
<div className="sticky top-6 flex h-[calc(100vh-104px)] min-h-[360px] min-w-0 flex-col gap-2.5">
|
||||
<div className="flex min-h-8 items-center justify-between gap-3">
|
||||
<span className="truncate font-mono text-[13px] font-semibold">{selected}</span>
|
||||
<div className="flex shrink-0 items-center gap-2">
|
||||
|
||||
Reference in New Issue
Block a user