Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QA requests #501

Merged
merged 2 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions app/components/ArticlesDropdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {sortFuncs} from '~/routes/tags.$'
import {questionUrl, tagsUrl, tagUrl} from '~/routesMapper'
import Button from '~/components/Button'
import './dropdown.css'
import useIsMobile from '~/hooks/isMobile'

export type ArticlesDropdownProps = {
toc: TOCItem[]
Expand All @@ -20,7 +21,7 @@ export const ArticlesDropdown = ({toc, categories}: ArticlesDropdownProps) => {
const [shown, setShown] = useState(false)
const hide = () => setShown(true)
useEffect(() => setShown(false), [shown])

const mobile = useIsMobile()
const Link = ({to, text, className}: {to: string; text: string; className?: string}) => (
<div className={'articles-dropdown-entry ' + (className || '')}>
<LinkElem to={to} onClick={hide}>
Expand Down Expand Up @@ -51,8 +52,16 @@ export const ArticlesDropdown = ({toc, categories}: ArticlesDropdownProps) => {
return shown ? null : (
<div className="articles-dropdown-container bordered col-8">
<div>
<ArticlesSection category={INTRODUCTORY} toc={toc} className="padding-bottom-32" />
<ArticlesSection category={ADVANCED} toc={toc} />
<ArticlesSection
category={INTRODUCTORY}
toc={toc}
className={mobile ? 'padding-bottom-40' : 'padding-bottom-32'}
/>
<ArticlesSection
category={ADVANCED}
toc={toc}
className={mobile ? 'padding-bottom-40' : ''}
/>
</div>

<div>
Expand All @@ -66,7 +75,10 @@ export const ArticlesDropdown = ({toc, categories}: ArticlesDropdownProps) => {
<Link key={tag.rowId} className="teal-500" to={tagUrl(tag)} text={tag.name} />
))}

<Button action={tagsUrl()} className="secondary">
<Button
action={tagsUrl()}
className={['secondary', mobile ? 'margin-top-40' : ''].join(' ')}
>
<span onClick={hide}> Browse all categories</span>
</Button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/components/Nav/Mobile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const MobileNav = ({toc, categories}: NavProps) => {
setShowSearch(!showSearch)
}
return (
<header className="top-header">
<header className={['top-header', showArticles || showMenu ? 'expanded' : ''].join(' ')}>
{!showArticles && (
<>
<nav className="top-nav">
Expand Down
9 changes: 9 additions & 0 deletions app/components/Nav/Mobile/navMobile.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
}
.mobile-menu > .button {
border-radius: 0;
padding: var(--spacing-80) var(--spacing-16);
}
.mobile-menu > .button:first-child {
border-bottom: 0;
Expand Down Expand Up @@ -87,4 +88,12 @@
.mobile-searchbar > div {
width: 100%;
}
.expanded {
position: fixed;
z-index: 100;
height: 100vh;
width: 100vw;
background: var(--colors-cool-grey-100);
overflow: scroll;
}
}
7 changes: 7 additions & 0 deletions app/newRoot.css
Original file line number Diff line number Diff line change
Expand Up @@ -529,3 +529,10 @@ ol {
flex-direction: column;
}
} /* end mobile */
p,
button {
font-family: Poppins;
buddy-web3 marked this conversation as resolved.
Show resolved Hide resolved
}
.margin-top-40 {
buddy-web3 marked this conversation as resolved.
Show resolved Hide resolved
margin-top: var(--spacing-40);
}
Loading