-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start on select on integration (#765)
* Start on select on integration * Test fixes * Further work * Updates to buttons * Stepper redesign * Add integration to setup connection * Lint fix * Test updates
- Loading branch information
Showing
24 changed files
with
539 additions
and
463 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
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
25 changes: 25 additions & 0 deletions
25
grai-frontend/src/components/connections/connectors/ConnectorIcon.tsx
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,25 @@ | ||
import React, { ReactNode } from "react" | ||
|
||
export interface Connector { | ||
icon: string | ReactNode | ||
name: string | ||
} | ||
|
||
type ConnectorIconProps = { | ||
connector: Connector | ||
} | ||
|
||
const ConnectorIcon: React.FC<ConnectorIconProps> = ({ connector }) => { | ||
if (typeof connector.icon === "string") | ||
return ( | ||
<img | ||
src={connector.icon} | ||
alt={`${connector.name} logo`} | ||
style={{ height: 28, width: 28 }} | ||
/> | ||
) | ||
|
||
return <>{connector.icon}</> | ||
} | ||
|
||
export default ConnectorIcon |
23 changes: 8 additions & 15 deletions
23
grai-frontend/src/components/connections/connectors/ConnectorList.tsx
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,30 +1,23 @@ | ||
import React from "react" | ||
import { Typography, Grid } from "@mui/material" | ||
import { Grid } from "@mui/material" | ||
import ConnectorCard, { Connector } from "./ConnectorCard" | ||
|
||
type ConnectorListProps = { | ||
title: string | ||
connectors: Connector[] | ||
onSelect: (connector: Connector) => void | ||
} | ||
|
||
const ConnectorList: React.FC<ConnectorListProps> = ({ | ||
title, | ||
connectors, | ||
onSelect, | ||
}) => ( | ||
<> | ||
<Typography variant="h6" sx={{ mt: 5, mb: 3, textTransform: "capitalize" }}> | ||
{title} | ||
</Typography> | ||
<Grid container spacing={2}> | ||
{connectors.map(connector => ( | ||
<Grid item md={3} key={connector.id}> | ||
<ConnectorCard connector={connector} onSelect={onSelect} /> | ||
</Grid> | ||
))} | ||
</Grid> | ||
</> | ||
<Grid container spacing={2}> | ||
{connectors.map(connector => ( | ||
<Grid item md={3} key={connector.id}> | ||
<ConnectorCard connector={connector} onSelect={onSelect} /> | ||
</Grid> | ||
))} | ||
</Grid> | ||
) | ||
|
||
export default ConnectorList |
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
30 changes: 30 additions & 0 deletions
30
grai-frontend/src/components/connections/create/ConnectorCategoryTabs.tsx
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,30 @@ | ||
import React from "react" | ||
import { Tab, Tabs } from "@mui/material" | ||
|
||
type ConnectorCategoryTabsProps = { | ||
categories: string[] | ||
value: string | null | ||
onChange: (value: string | null) => void | ||
} | ||
|
||
const ConnectorCategoryTabs: React.FC<ConnectorCategoryTabsProps> = ({ | ||
categories, | ||
value, | ||
onChange, | ||
}) => { | ||
return ( | ||
<Tabs value={value} onChange={(_, newValue) => onChange(newValue)}> | ||
<Tab label="All Integrations" value={null} /> | ||
{categories.map(category => ( | ||
<Tab | ||
label={category} | ||
value={category} | ||
key={category} | ||
sx={{ textTransform: "capitalize" }} | ||
/> | ||
))} | ||
</Tabs> | ||
) | ||
} | ||
|
||
export default ConnectorCategoryTabs |
Oops, something went wrong.