aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/frontend/src/main/components/navigationPaneSearch
diff options
context:
space:
mode:
authorMarcin Aman <marcin.aman@gmail.com>2021-08-12 14:49:26 +0200
committerMarcin Aman <marcin.aman@gmail.com>2021-08-12 14:49:26 +0200
commit79463f06a953de2f2c2ec877f34deaed658b3471 (patch)
tree377dea8c152d5afd01c2a3e979154688e90473c2 /plugins/base/frontend/src/main/components/navigationPaneSearch
parent7cd0164426a6527b9bbb39d441f9bbdf28db45f3 (diff)
downloaddokka-79463f06a953de2f2c2ec877f34deaed658b3471.tar.gz
dokka-79463f06a953de2f2c2ec877f34deaed658b3471.tar.bz2
dokka-79463f06a953de2f2c2ec877f34deaed658b3471.zip
Remove unused components, docs, change icon to new kotlin logo and add hamburger for mobile
Diffstat (limited to 'plugins/base/frontend/src/main/components/navigationPaneSearch')
-rw-r--r--plugins/base/frontend/src/main/components/navigationPaneSearch/clear.svg3
-rw-r--r--plugins/base/frontend/src/main/components/navigationPaneSearch/navigationPaneSearch.scss37
-rw-r--r--plugins/base/frontend/src/main/components/navigationPaneSearch/navigationPaneSearch.tsx71
3 files changed, 0 insertions, 111 deletions
diff --git a/plugins/base/frontend/src/main/components/navigationPaneSearch/clear.svg b/plugins/base/frontend/src/main/components/navigationPaneSearch/clear.svg
deleted file mode 100644
index ad6a2026..00000000
--- a/plugins/base/frontend/src/main/components/navigationPaneSearch/clear.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M11.1374 1.80464L6.94205 5.99996L11.1374 10.1953L10.1947 11.138L5.99935 6.94267L1.80403 11.138L0.861328 10.1953L5.05664 5.99996L0.861328 1.80464L1.80403 0.861938L5.99935 5.05725L10.1947 0.861938L11.1374 1.80464Z" fill="#637282"/>
-</svg>
diff --git a/plugins/base/frontend/src/main/components/navigationPaneSearch/navigationPaneSearch.scss b/plugins/base/frontend/src/main/components/navigationPaneSearch/navigationPaneSearch.scss
deleted file mode 100644
index 1a61e90f..00000000
--- a/plugins/base/frontend/src/main/components/navigationPaneSearch/navigationPaneSearch.scss
+++ /dev/null
@@ -1,37 +0,0 @@
-@import "src/main/scss/index.scss";
-
-$defaultHeight: 40px;
-
-div#paneSearch {
-
- width: 248px;
- margin: 0 auto;
-
- input#navigation-pane-search {
- background: $white;
- border: 1px solid $grey-border;
- box-sizing: border-box;
- border-radius: 4px;
- padding: 8px;
- height: $defaultHeight;
- }
-
- .navigation-pane-search {
- padding-top: 16px;
- width: 100%;
- }
-
- div.paneSearchInputWrapper {
- position: relative;
- span.paneSearchInputClearIcon {
- position: absolute;
- top: calc(50% + 2px); //Just to include a border
- right: 8px;
- cursor: pointer;
- }
- }
-}
-
-.navigation-pane-popup {
- margin-top: 1.2em;
-} \ No newline at end of file
diff --git a/plugins/base/frontend/src/main/components/navigationPaneSearch/navigationPaneSearch.tsx b/plugins/base/frontend/src/main/components/navigationPaneSearch/navigationPaneSearch.tsx
deleted file mode 100644
index 152e7719..00000000
--- a/plugins/base/frontend/src/main/components/navigationPaneSearch/navigationPaneSearch.tsx
+++ /dev/null
@@ -1,71 +0,0 @@
-import React, { useCallback, useState, useEffect } from 'react';
-import {Select, List } from '@jetbrains/ring-ui';
-import { DokkaFuzzyFilterComponent } from '../search/dokkaFuzzyFilter';
-import { IWindow, Option } from '../search/types';
-import './navigationPaneSearch.scss';
-import ClearIcon from 'react-svg-loader!./clear.svg';
-import { relativizeUrlForRequest } from '../utils/requests';
-
-export const NavigationPaneSearch = () => {
- const [navigationList, setNavigationList] = useState<Option[]>([]);
- const [selected, onSelected] = useState<Option | null>(null);
- const [filterValue, setFilterValue] = useState<string>('')
-
- const onChangeSelected = useCallback(
- (element: Option) => {
- window.location.replace(`${(window as IWindow).pathToRoot}${element.location}`)
- onSelected(element);
- },
- [selected]
- );
-
- const onFilter = (filterValue: string) => {
- setFilterValue(filterValue)
- }
-
- const onClearClick = () => {
- setFilterValue('')
- }
-
- const shouldShowPopup = (filterState: string): boolean => {
- return filterState.trim().length !== 0
- }
-
- useEffect(() => {
- fetch(relativizeUrlForRequest('scripts/navigation-pane.json'))
- .then(response => response.json())
- .then((result) => {
- setNavigationList(result.map((record: Option, idx: number) => {
- return {
- ...record,
- key: idx,
- rgItemType: List.ListProps.Type.CUSTOM
- }
- }))
- },
- (error) => {
- console.error('failed to fetch navigationPane data', error)
- setNavigationList([])
- })
- }, [])
-
-
- return <div className={"paneSearchInputWrapper"}>
- <DokkaFuzzyFilterComponent
- id="navigation-pane-search"
- className="navigation-pane-search"
- inputPlaceholder="Title filter"
- clear={true}
- type={Select.Type.INPUT_WITHOUT_CONTROLS}
- filter={{fuzzy:true, value: filterValue}}
- selected={selected}
- data={navigationList}
- popupClassName={"navigation-pane-popup"}
- onSelect={onChangeSelected}
- onFilter={onFilter}
- shouldShowPopup={shouldShowPopup}
- renderOptimization={false}
- />
- <span className={"paneSearchInputClearIcon"} onClick={onClearClick}><ClearIcon /></span>
- </div>
-} \ No newline at end of file