generated from eea/volto-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
41f0b74
commit e72fef3
Showing
13 changed files
with
152 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function LandingPageApp(props) { | ||
return <div>Landing page</div>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react'; | ||
|
||
import registry from '@eeacms/search/registry'; | ||
import BasicSearchApp from './BasicSearchApp'; | ||
import { SearchBox } from '@eeacms/search/components'; | ||
|
||
const SearchInputView = (props) => { | ||
const { mode = 'view', appConfig, ...searchContext } = props; | ||
return ( | ||
<SearchBox | ||
searchContext={searchContext} | ||
isLandingPage={false} | ||
autocompleteMinimumCharacters={3} | ||
autocompleteResults={appConfig.autocomplete.results} | ||
autocompleteSuggestions={appConfig.autocomplete.suggestions} | ||
shouldClearFilters={false} | ||
useSearchPhrases={appConfig.useSearchPhrases} | ||
inputView={ | ||
appConfig.searchBoxInputComponent | ||
? registry.resolve[appConfig.searchBoxInputComponent].component | ||
: undefined | ||
} | ||
view={ | ||
appConfig.searchBoxComponent | ||
? registry.resolve[appConfig.searchBoxComponent].component | ||
: undefined | ||
} | ||
mode={mode} | ||
/> | ||
); | ||
}; | ||
|
||
export default function SearchApp(props) { | ||
return <BasicSearchApp {...props} searchViewComponent={SearchInputView} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from 'react'; | ||
import { BodyClass } from '@plone/volto/helpers'; | ||
import { SearchApp } from '@eeacms/search'; | ||
|
||
const overlayStyle = { | ||
position: 'absolute', | ||
width: '100%', | ||
height: '100%', | ||
zIndex: '100', | ||
}; | ||
|
||
function FullView(props) { | ||
const { appName, mode } = props; | ||
|
||
// TODO: (about bodyclass) this is a hack, please solve it properly | ||
|
||
return ( | ||
<BodyClass className={`${appName}-view searchlib-page`}> | ||
<div className="searchlib-block"> | ||
{mode !== 'view' && ( | ||
<div className="overlay" style={overlayStyle}></div> | ||
)} | ||
<SearchApp {...props} /> | ||
</div> | ||
</BodyClass> | ||
); | ||
} | ||
|
||
export default FullView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react'; | ||
|
||
function LandingPageView(props) { | ||
return null; | ||
} | ||
|
||
export default LandingPageView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { SearchInputApp } from '@eeacms/search'; | ||
import React from 'react'; | ||
|
||
function SearchInputView(props) { | ||
return <SearchInputApp {...props} />; | ||
} | ||
|
||
export default SearchInputView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export FullView from './FullView'; | ||
export LandingPageView from './LandingPageView'; | ||
export SearchInputView from './SearchInputView'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters