-
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.
feat(UI-1288): zoom and height.app oauth integrations
- Loading branch information
Showing
15 changed files
with
198 additions
and
3 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
41 changes: 41 additions & 0 deletions
41
src/components/organisms/connections/integrations/height/add.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,41 @@ | ||
import React, { useEffect } from "react"; | ||
|
||
import { useTranslation } from "react-i18next"; | ||
|
||
import { Integrations } from "@src/enums/components"; | ||
import { useConnectionForm } from "@src/hooks"; | ||
import { oauthSchema } from "@validations"; | ||
|
||
import { Button } from "@components/atoms"; | ||
|
||
export const HeightIntegrationAddForm = ({ | ||
connectionId, | ||
triggerParentFormSubmit, | ||
}: { | ||
connectionId?: string; | ||
triggerParentFormSubmit: () => void; | ||
}) => { | ||
const { t } = useTranslation("integrations"); | ||
|
||
const { handleOAuth } = useConnectionForm(oauthSchema, "create"); | ||
|
||
useEffect(() => { | ||
if (connectionId) { | ||
handleOAuth(connectionId, Integrations.height); | ||
} | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [connectionId]); | ||
|
||
return ( | ||
<form className="mt-6 flex flex-col gap-6" onSubmit={triggerParentFormSubmit}> | ||
<Button | ||
aria-label={t("buttons.startOAuthFlow")} | ||
className="ml-auto w-fit border-black bg-white px-3 font-medium hover:bg-gray-950 hover:text-white" | ||
type="submit" | ||
variant="outline" | ||
> | ||
{t("buttons.startOAuthFlow")} | ||
</Button> | ||
</form> | ||
); | ||
}; |
32 changes: 32 additions & 0 deletions
32
src/components/organisms/connections/integrations/height/edit.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,32 @@ | ||
import React from "react"; | ||
|
||
import { useTranslation } from "react-i18next"; | ||
import { useParams } from "react-router-dom"; | ||
|
||
import { Integrations } from "@src/enums/components"; | ||
import { useConnectionForm } from "@src/hooks"; | ||
import { oauthSchema } from "@validations"; | ||
|
||
import { Button } from "@components/atoms"; | ||
|
||
export const HeightIntegrationEditForm = () => { | ||
const { t } = useTranslation("integrations"); | ||
const { connectionId } = useParams(); | ||
const { handleOAuth, handleSubmit } = useConnectionForm(oauthSchema, "edit"); | ||
|
||
return ( | ||
<form | ||
className="mt-6 flex flex-col gap-6" | ||
onSubmit={handleSubmit(async () => await handleOAuth(connectionId!, Integrations.height))} | ||
> | ||
<Button | ||
aria-label={t("buttons.startOAuthFlow")} | ||
className="ml-auto w-fit border-black bg-white px-3 font-medium hover:bg-gray-950 hover:text-white" | ||
type="submit" | ||
variant="outline" | ||
> | ||
{t("buttons.startOAuthFlow")} | ||
</Button> | ||
</form> | ||
); | ||
}; |
2 changes: 2 additions & 0 deletions
2
src/components/organisms/connections/integrations/height/index.ts
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,2 @@ | ||
export { HeightIntegrationAddForm } from "@components/organisms/connections/integrations/height/add"; | ||
export { HeightIntegrationEditForm } from "@components/organisms/connections/integrations/height/edit"; |
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
41 changes: 41 additions & 0 deletions
41
src/components/organisms/connections/integrations/zoom/add.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,41 @@ | ||
import React, { useEffect } from "react"; | ||
|
||
import { useTranslation } from "react-i18next"; | ||
|
||
import { Integrations } from "@src/enums/components"; | ||
import { useConnectionForm } from "@src/hooks"; | ||
import { oauthSchema } from "@validations"; | ||
|
||
import { Button } from "@components/atoms"; | ||
|
||
export const ZoomIntegrationAddForm = ({ | ||
connectionId, | ||
triggerParentFormSubmit, | ||
}: { | ||
connectionId?: string; | ||
triggerParentFormSubmit: () => void; | ||
}) => { | ||
const { t } = useTranslation("integrations"); | ||
|
||
const { handleOAuth } = useConnectionForm(oauthSchema, "create"); | ||
|
||
useEffect(() => { | ||
if (connectionId) { | ||
handleOAuth(connectionId, Integrations.zoom); | ||
} | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [connectionId]); | ||
|
||
return ( | ||
<form className="mt-6 flex flex-col gap-6" onSubmit={triggerParentFormSubmit}> | ||
<Button | ||
aria-label={t("buttons.startOAuthFlow")} | ||
className="ml-auto w-fit border-black bg-white px-3 font-medium hover:bg-gray-950 hover:text-white" | ||
type="submit" | ||
variant="outline" | ||
> | ||
{t("buttons.startOAuthFlow")} | ||
</Button> | ||
</form> | ||
); | ||
}; |
32 changes: 32 additions & 0 deletions
32
src/components/organisms/connections/integrations/zoom/edit.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,32 @@ | ||
import React from "react"; | ||
|
||
import { useTranslation } from "react-i18next"; | ||
import { useParams } from "react-router-dom"; | ||
|
||
import { Integrations } from "@src/enums/components"; | ||
import { useConnectionForm } from "@src/hooks"; | ||
import { oauthSchema } from "@validations"; | ||
|
||
import { Button } from "@components/atoms"; | ||
|
||
export const ZoomIntegrationEditForm = () => { | ||
const { t } = useTranslation("integrations"); | ||
const { connectionId } = useParams(); | ||
const { handleOAuth, handleSubmit } = useConnectionForm(oauthSchema, "edit"); | ||
|
||
return ( | ||
<form | ||
className="mt-6 flex flex-col gap-6" | ||
onSubmit={handleSubmit(async () => await handleOAuth(connectionId!, Integrations.zoom))} | ||
> | ||
<Button | ||
aria-label={t("buttons.startOAuthFlow")} | ||
className="ml-auto w-fit border-black bg-white px-3 font-medium hover:bg-gray-950 hover:text-white" | ||
type="submit" | ||
variant="outline" | ||
> | ||
{t("buttons.startOAuthFlow")} | ||
</Button> | ||
</form> | ||
); | ||
}; |
2 changes: 2 additions & 0 deletions
2
src/components/organisms/connections/integrations/zoom/index.ts
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,2 @@ | ||
export { ZoomIntegrationAddForm } from "@components/organisms/connections/integrations/zoom/add"; | ||
export { ZoomIntegrationEditForm } from "@components/organisms/connections/integrations/zoom/edit"; |
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