-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from newfold-labs/fix_visiblity
fire local storage events when changing visibility
- Loading branch information
Showing
8 changed files
with
204 additions
and
21,783 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<?php return array('dependencies' => array('lodash', 'react', 'wp-api-fetch', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => 'f8ef71c8f4b8ded14664'); | ||
<?php return array('dependencies' => array('lodash', 'react', 'wp-api-fetch', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => '8fb0e0925d501ddd708d'); |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,46 @@ | ||
import { useEffect, useState } from "@wordpress/element"; | ||
import algoliasearch from "algoliasearch"; | ||
import { Configure, Index, InstantSearch } from "react-instantsearch-hooks-web"; | ||
import SearchResults from "./SearchResults"; | ||
import { CapabilityAPI, LocalStorageUtils } from "../utils"; | ||
|
||
const HelpCenterSidebar = (props) => { | ||
// Set up the instant search results | ||
const searchClient = algoliasearch( | ||
"AVE0JWZU92", | ||
"eef54890add97ea2583ff1e417ff86ea" | ||
); | ||
|
||
const [helpEnabled, setHelpEnabled] = useState(false); | ||
const getHelpStatus = async () => { | ||
try { | ||
const response = await CapabilityAPI.getHelpCenterCapability(); | ||
setHelpEnabled(response); | ||
} catch (exception) { | ||
setHelpEnabled(false); | ||
} | ||
}; | ||
useEffect(() => { | ||
getHelpStatus(); | ||
}, []); | ||
|
||
if (!helpEnabled) { | ||
return <></>; | ||
} | ||
|
||
return ( | ||
<div className="nfd-help-center"> | ||
<InstantSearch | ||
searchClient={searchClient} | ||
indexName="nfd_help_searchable_posts" | ||
> | ||
<Index indexName="nfd_help_searchable_posts"> | ||
<Configure hitsPerPage={3} getRankingInfo={true} /> | ||
<SearchResults refresh={props.refresh} /> | ||
</Index> | ||
</InstantSearch> | ||
</div> | ||
); | ||
}; | ||
|
||
export default HelpCenterSidebar; |
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