From 38ab93372685ba2fe7bd727e443966d5490a7c7a Mon Sep 17 00:00:00 2001 From: Shehan Date: Tue, 4 May 2021 11:11:24 +0530 Subject: [PATCH] remove old code --- docerina-ui/src/component/moduleindex.js | 42 +--------- docerina-ui/src/component/packageindex.js | 93 ----------------------- 2 files changed, 4 insertions(+), 131 deletions(-) delete mode 100644 docerina-ui/src/component/packageindex.js diff --git a/docerina-ui/src/component/moduleindex.js b/docerina-ui/src/component/moduleindex.js index 7d9b7bc02..85c280f35 100644 --- a/docerina-ui/src/component/moduleindex.js +++ b/docerina-ui/src/component/moduleindex.js @@ -34,13 +34,13 @@ const ModuleIndex = (props) => { } }); - return (
- {props.releaseVersion != null &&

Distribution: {props.releaseVersion}

} + {props.releaseVersion != "" &&

Distribution: {props.releaseVersion}

} -

Language Libraries

+ {props.langLibs.length > 0 && + <>

Language Libraries

{props.langLibs.map((item) => ( @@ -50,7 +50,7 @@ const ModuleIndex = (props) => { ))} -
+ }

Modules

@@ -63,40 +63,6 @@ const ModuleIndex = (props) => { ))}
- {props.builtinTypes != null && props.builtinTypes.length > 0 && <>

Builtin Types

- - - {props.builtinTypes.map(item => ( - - - - - ))} - -
- {item.name} - -
-

{getFirstLine(item.description)}

-
-
} - {props.keywords != null && props.keywords.length > 0 && <>

Keywords

- - - {props.keywords.map(item => ( - - - - - ))} - -
- {item.name} - -
-

{getFirstLine(item.description)}

-
-
}
); diff --git a/docerina-ui/src/component/packageindex.js b/docerina-ui/src/component/packageindex.js deleted file mode 100644 index b59151733..000000000 --- a/docerina-ui/src/component/packageindex.js +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React, { useEffect } from "react"; -import { Link, appType } from '../Router' -import Layout from "./packagelayout"; -import Markdown from "./markdown" -import { getFirstLine, scrollAndHighlight } from "./helper" - -const PackageIndex = (props) => { - - useEffect(() => { - if (appType == "react" && props.history.location.hash != "") { - scrollAndHighlight(props.history.location.hash); - } else if (appType == "next" && location.hash != "") { - scrollAndHighlight(location.hash); - } else { - window.scrollTo(0, 0); - } - }); - - return ( -
- - {props.releaseVersion != null &&

Distribution: {props.releaseVersion}

} - -

Packages

- - - {props.packages.map((item) => ( - - - - - - ))} - -
{item.name}

{item.version}

- {props.builtinTypes != null && props.builtinTypes.length > 0 && <>

Builtin Types

- - - {props.builtinTypes.map(item => ( - - - - - ))} - -
- {item.name} - -
-

{getFirstLine(item.description)}

-
-
} - {props.keywords != null && props.keywords.length > 0 && <>

Keywords

- - - {props.keywords.map(item => ( - - - - - ))} - -
- {item.name} - -
-

{getFirstLine(item.description)}

-
-
} -
-
- ); -} - -export default PackageIndex;