forked from open-metadata/OpenMetadata
-
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.
* updated the connectors list on the homepage * added padding to the tabs selection container * open-metadata#193: Refactored side nav bar for how to guides page (open-metadata#196) * refactored side nav bar to for how to guides page to show selected section items only * Icon name improvements --------- Co-authored-by: Sachin Chaurasiya <[email protected]>
- Loading branch information
1 parent
398e441
commit 17a9e1f
Showing
21 changed files
with
475 additions
and
376 deletions.
There are no files selected for viewing
546 changes: 301 additions & 245 deletions
546
components/ConnectorsInfo/ConnectorsInfo.constants.ts
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 |
---|---|---|
@@ -1,23 +1,70 @@ | ||
import React from "react"; | ||
import { connectorsArr } from "./ConnectorsInfo.constants"; | ||
import styles from "./ConnectorsInfo.module.css"; | ||
import classNames from "classnames"; | ||
import { sortBy } from "lodash"; | ||
import Link from "next/link"; | ||
import { useState } from "react"; | ||
import { CONNECTORS } from "./ConnectorsInfo.constants"; | ||
import styles from "./ConnectorsInfo.module.css"; | ||
|
||
interface ConnectorCategory { | ||
connector: string; | ||
services: { | ||
url: string; | ||
icon: string; | ||
name: string; | ||
}[]; | ||
} | ||
|
||
CONNECTORS.unshift({ | ||
connector: "All connectors", | ||
services: CONNECTORS.reduce((prev, curr) => { | ||
return sortBy( | ||
[...prev, ...curr.services], | ||
[(connector) => connector.name.toLowerCase()] | ||
); | ||
}, [] as ConnectorCategory["services"]), | ||
}); | ||
|
||
export default function ConnectorsInfo() { | ||
const [selectedTab, setSelectedTab] = useState<ConnectorCategory>( | ||
CONNECTORS[0] | ||
); | ||
|
||
return ( | ||
<div className={styles.Container}> | ||
{connectorsArr.map((connector) => ( | ||
<Link href={connector.url} key={connector.name}> | ||
<div className={styles.ConnectorItem} key={connector.name}> | ||
<img | ||
className={styles.ConnectorImg} | ||
src={connector.icon} | ||
alt={connector.name} | ||
/> | ||
<p>{connector.name}</p> | ||
<div className={styles.TabsContainer}> | ||
{CONNECTORS.map((connectorCategory) => ( | ||
<div | ||
className={classNames( | ||
styles.TabItem, | ||
connectorCategory.connector === selectedTab.connector | ||
? styles.SelectedTab | ||
: "" | ||
)} | ||
key={connectorCategory.connector} | ||
onClick={() => setSelectedTab(connectorCategory)} | ||
> | ||
{connectorCategory.connector} | ||
</div> | ||
</Link> | ||
))} | ||
))} | ||
</div> | ||
<div className={styles.ConnectorsContainer}> | ||
<div className={styles.ConnectorsGridContainer}> | ||
{selectedTab.services.map((connector) => ( | ||
<Link | ||
className={styles.ConnectorItem} | ||
href={connector.url} | ||
key={connector.name} | ||
> | ||
<img | ||
className={styles.ConnectorImg} | ||
src={connector.icon} | ||
alt={connector.name} | ||
/> | ||
<p>{connector.name}</p> | ||
</Link> | ||
))} | ||
</div> | ||
</div> | ||
</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
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,6 @@ | ||
import { MenuItem } from "../../interface/common.interface"; | ||
|
||
export interface ListItemProps { | ||
item: MenuItem; | ||
fontWeight?: number; | ||
} |
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 @@ | ||
export const HOW_TO_GUIDES_MENU_ITEM_KEY = "how-to-guides"; |
Oops, something went wrong.