diff --git a/app/assets/icons/magnifying-large.svg b/app/assets/icons/magnifying-large.svg new file mode 100644 index 00000000..54dcef61 --- /dev/null +++ b/app/assets/icons/magnifying-large.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/app/components/Nav/Mobile/index.tsx b/app/components/Nav/Mobile/index.tsx index 03823cb0..0ac95d1a 100644 --- a/app/components/Nav/Mobile/index.tsx +++ b/app/components/Nav/Mobile/index.tsx @@ -6,19 +6,24 @@ import {XLarge} from '~/components/icons-generated' import {CarrotLarge} from '~/components/icons-generated' import OpenBookIcon from '~/components/icons-generated/OpenBook' import BotIcon from '~/components/icons-generated/Bot' +import MagnifyingLarge from '~/components/icons-generated/MagnifyingLarge' import {NavProps} from '~/components/Nav' import Button from '~/components/Button' import '../nav.css' import './navMobile.css' -import {sortFuncs} from '~/routes/tags.$' -import {questionUrl, tagsUrl, tagUrl} from '~/routesMapper' -import {TOCItem} from '~/routes/questions.toc' +import ArticlesDropdown from '~/components/ArticlesDropdown' +import Search from '~/components/search' export const MobileNav = ({toc, categories}: NavProps) => { const [showMenu, setShowMenu] = React.useState(false) + const [showSearch, setShowSearch] = React.useState(false) const [showArticles, setShowArticles] = React.useState(false) const toggleMenu = () => { - setShowMenu(!showMenu) + setShowMenu(false) setShowArticles(false) + setShowSearch(false) + } + const toggleSearch = () => { + setShowSearch(!showSearch) } console.log('toc', toc) return ( @@ -26,14 +31,29 @@ export const MobileNav = ({toc, categories}: NavProps) => { {!showArticles && ( <> {showMenu && (
@@ -42,13 +62,13 @@ export const MobileNav = ({toc, categories}: NavProps) => { className="secondary full-width space-between" icon={} > -

+

Articles

+
)} diff --git a/app/components/Nav/Mobile/navMobile.css b/app/components/Nav/Mobile/navMobile.css index 5066a5c3..56ff21e9 100644 --- a/app/components/Nav/Mobile/navMobile.css +++ b/app/components/Nav/Mobile/navMobile.css @@ -4,7 +4,7 @@ } .top-nav { justify-content: space-between; - padding: var(--spacing-20) var(--spacing-24); + padding: var(--spacing-16); } .top-logo { padding: 0; @@ -24,7 +24,6 @@ } .mobile-menu > .button { border-radius: 0; - font-size: 16px; } .mobile-menu > .button:first-child { border-bottom: 0; @@ -36,24 +35,51 @@ display: flex; justify-content: space-between; align-items: center; - padding: var(--spacing-24); + padding: var(--spacing-16); border-bottom: 1px solid var(--colors-cool-grey-200); } .back-icon { cursor: pointer; transform: rotate(180deg); } - .articles-entry { - display: block; - margin-bottom: var(--spacing-16); - } .articles-mobile { padding: var(--spacing-24); } - .margin-bottom { - margin-bottom: var(--spacing-24); + .articles-dropdown-container { + visibility: visible !important; + flex-direction: column; + border: 0; + box-shadow: none; + position: static !important; + padding: 0 !important; + width: 100% !important; + } + .search-icon { + margin-right: var(--spacing-16); + } + .search-content > svg:nth-of-type(2) { + visibility: hidden; + } + .mobile-searchbar { + display: flex; + flex-direction: row-reverse; + flex-wrap: nowrap; + align-content: center; + justify-content: flex-start; + align-items: flex-start; + } + .mobile-searchbar > svg { + margin-top: var(--spacing-12); + margin-left: var(--spacing-16); + } + .mobile-searchbar > * .search-box.expandable:focus-within, + .mobile-searchbar > * .search-box.expandable { + width: 100%; } - .top-margin { - margin-top: var(--spacing-40); + .container-search-results { + height: 50vh !important; + width: 100% !important; + position: inherit !important; + margin-top: var(--spacing-8); } } diff --git a/app/components/icons-generated/MagnifyingLarge.tsx b/app/components/icons-generated/MagnifyingLarge.tsx new file mode 100644 index 00000000..6016a7a9 --- /dev/null +++ b/app/components/icons-generated/MagnifyingLarge.tsx @@ -0,0 +1,12 @@ +import type {SVGProps} from 'react' +const SvgMagnifyingLarge = (props: SVGProps) => ( + + + +) +export default SvgMagnifyingLarge diff --git a/app/components/icons-generated/index.ts b/app/components/icons-generated/index.ts index 564e02c8..4a0ee9e3 100644 --- a/app/components/icons-generated/index.ts +++ b/app/components/icons-generated/index.ts @@ -27,6 +27,7 @@ export {default as Like} from './Like' export {default as Link} from './Link' export {default as ListLarge} from './ListLarge' export {default as MagnifyingGlass} from './MagnifyingGlass' +export {default as MagnifyingLarge} from './MagnifyingLarge' export {default as Magnifying} from './Magnifying' export {default as OpenBook} from './OpenBook' export {default as Paper} from './Paper' diff --git a/app/newRoot.css b/app/newRoot.css index 294515e4..fed4531d 100644 --- a/app/newRoot.css +++ b/app/newRoot.css @@ -32,7 +32,6 @@ --spacing-8: 8px; --spacing-12: 12px; --spacing-16: 16px; - --spacing-20: 20px; --spacing-24: 24px; --spacing-32: 32px; --spacing-40: 40px;