mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-26 19:49:26 +01:00
Issue-#545: Change location of serach button on home page
This commit is contained in:
parent
8b6382c66d
commit
e2c8b8e6c2
@ -3,6 +3,7 @@ import { StaticQuery, graphql } from 'gatsby'
|
|||||||
import { ReactComponent as Logo } from '@oceanprotocol/art/logo/logo.svg'
|
import { ReactComponent as Logo } from '@oceanprotocol/art/logo/logo.svg'
|
||||||
import Content from '../components/Content'
|
import Content from '../components/Content'
|
||||||
import styles from './HeaderHome.module.scss'
|
import styles from './HeaderHome.module.scss'
|
||||||
|
import SearchButton from '../components/Search/SearchButton'
|
||||||
|
|
||||||
const HeaderHome = () => (
|
const HeaderHome = () => (
|
||||||
<StaticQuery
|
<StaticQuery
|
||||||
@ -24,7 +25,14 @@ const HeaderHome = () => (
|
|||||||
<Content>
|
<Content>
|
||||||
<Logo className={styles.headerLogo} />
|
<Logo className={styles.headerLogo} />
|
||||||
<h1 className={styles.headerTitle}>{siteTitle}</h1>
|
<h1 className={styles.headerTitle}>{siteTitle}</h1>
|
||||||
<p className={styles.headerDescription}>{siteDescription}</p>
|
<p className={styles.headerDescription}>
|
||||||
|
<div style={{ display: 'flex', flexDirection: 'column' }}>
|
||||||
|
{siteDescription}
|
||||||
|
<div>
|
||||||
|
<SearchButton />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</p>
|
||||||
</Content>
|
</Content>
|
||||||
</header>
|
</header>
|
||||||
)
|
)
|
||||||
|
@ -108,22 +108,11 @@ const SearchClient = ({ searchableData }) => {
|
|||||||
|
|
||||||
<div
|
<div
|
||||||
id="result-list-conatiner"
|
id="result-list-conatiner"
|
||||||
style={{ overflowY: 'scroll', height: '100%' }}
|
style={{ overflowY: 'auto', height: '100%' }}
|
||||||
className={classes.parent}
|
className={classes.parent}
|
||||||
>
|
>
|
||||||
{searchState.touched ? (
|
{searchState.touched ? (
|
||||||
<div>
|
<div>
|
||||||
{/* <List>
|
|
||||||
{searchState.searchResults.map((element) => (
|
|
||||||
<ListItem
|
|
||||||
style={{ before: { content: null } }}
|
|
||||||
key={element.id}
|
|
||||||
>
|
|
||||||
<Link to={element.slug}>{element.title} </Link>
|
|
||||||
</ListItem>
|
|
||||||
))}
|
|
||||||
|
|
||||||
</List> */}
|
|
||||||
<ResultList searchResults={searchState.searchResults} />
|
<ResultList searchResults={searchState.searchResults} />
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
@ -137,8 +126,6 @@ SearchClient.propTypes = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const ResultList = ({ searchResults }) => {
|
const ResultList = ({ searchResults }) => {
|
||||||
const url = typeof window !== 'undefined' ? window.location.host : ''
|
|
||||||
console.log('url', url)
|
|
||||||
return (
|
return (
|
||||||
<div style={{ maxHeight: '100%' }}>
|
<div style={{ maxHeight: '100%' }}>
|
||||||
<div>Total results found: {searchResults.length} </div>
|
<div>Total results found: {searchResults.length} </div>
|
||||||
|
@ -46,10 +46,15 @@ const SearchComponent = ({ location }) => {
|
|||||||
<Layout location={location}>
|
<Layout location={location}>
|
||||||
<HeaderSection title="Search" />
|
<HeaderSection title="Search" />
|
||||||
<main>
|
<main>
|
||||||
<article style={{ height: '500px' }}>
|
<article style={{ height: '700px' }}>
|
||||||
<div
|
<div
|
||||||
id="search-client-container"
|
id="search-client-container"
|
||||||
style={{ margin: 'auto', width: '50%', height: '100%' }}
|
style={{
|
||||||
|
margin: 'auto',
|
||||||
|
width: '50%',
|
||||||
|
height: '100%',
|
||||||
|
paddingBottom: '50px'
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<SearchClient searchableData={searchableData} />
|
<SearchClient searchableData={searchableData} />
|
||||||
</div>
|
</div>
|
||||||
|
@ -9,7 +9,6 @@ import HeaderHome from '../components/HeaderHome'
|
|||||||
import Repositories from '../components/Repositories'
|
import Repositories from '../components/Repositories'
|
||||||
import { ReactComponent as Arrow } from '../images/arrow.svg'
|
import { ReactComponent as Arrow } from '../images/arrow.svg'
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
import SearchButton from '../components/Search/SearchButton'
|
|
||||||
|
|
||||||
const SectionBox = ({ to, children, ...props }) =>
|
const SectionBox = ({ to, children, ...props }) =>
|
||||||
to ? (
|
to ? (
|
||||||
@ -67,9 +66,6 @@ const IndexPage = ({ data, location }) => (
|
|||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
<div className={styles.searchButton}>
|
|
||||||
<SearchButton />
|
|
||||||
</div>
|
|
||||||
<Repositories />
|
<Repositories />
|
||||||
</Content>
|
</Content>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
Loading…
Reference in New Issue
Block a user