Skip to content

Commit

Permalink
QA requests
Browse files Browse the repository at this point in the history
  • Loading branch information
buddy-web3 committed Mar 7, 2024
1 parent 3942184 commit 36f6dbd
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
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;
}
.margin-top-40 {
margin-top: var(--spacing-40);
}

0 comments on commit 36f6dbd

Please sign in to comment.