diff --git a/packages/web/components/templates/integrations/Webhooks.tsx b/packages/web/components/templates/integrations/Webhooks.tsx index 0a9acd18d..d36ab8a64 100644 --- a/packages/web/components/templates/integrations/Webhooks.tsx +++ b/packages/web/components/templates/integrations/Webhooks.tsx @@ -4,7 +4,7 @@ import Image from 'next/image' import { Box, HStack, SpanBox, VStack } from '../../elements/LayoutPrimitives' import { Button } from '../../elements/Button' -import { Plus } from 'phosphor-react' +import { Link, Plus } from 'phosphor-react' import { useGetWebhooksQuery } from '../../../lib/networking/queries/useGetWebhooksQuery' import { useMemo } from 'react' @@ -16,29 +16,29 @@ const Header = styled(Box, { }) interface Webhook { - id?: string - url: string - eventTypes: string - contentType?: string - method?: string - enabled?: string - createdAt?: Date - updatedAt?: Date - } + id?: string + url: string + eventTypes: string + contentType?: string + method?: string + enabled?: string + createdAt?: Date + updatedAt?: Date +} export function Webhooks(): JSX.Element { - const { webhooks } = useGetWebhooksQuery() const webhooksList = useMemo(() => { - const webhooksList = new Map() - webhooks.forEach((webhook) => - webhooksList.set(webhook.id, { - url: webhook.url, - eventTypes: webhook.eventTypes.join(', '), - method: webhook.method, - contentType: webhook.contentType, - createdAt: webhook.createdAt, + const webhooksList: Array = [] + webhooks.forEach((webhookItem) => + webhooksList.push({ + id: webhookItem.id, + url: webhookItem.url, + eventTypes: webhookItem.eventTypes.join(', '), + method: webhookItem.method, + contentType: webhookItem.contentType, + createdAt: webhookItem.createdAt, }) ) return webhooksList @@ -109,12 +109,42 @@ export function Webhooks(): JSX.Element { - - + border: '1px solid white', + height: '100%', + width: '100%', + }} + > + {webhooksList.map((item) => { + return ( + + + +

{item.method}

+

{item.createdAt}

+
+
+ ) + })}
) diff --git a/packages/web/pages/settings/integrations.tsx b/packages/web/pages/settings/integrations.tsx index 479e11f67..8b2a59e19 100644 --- a/packages/web/pages/settings/integrations.tsx +++ b/packages/web/pages/settings/integrations.tsx @@ -32,6 +32,10 @@ const Subheader = styled(Box, { borderBottom: '1px solid $grayLine', margin: '0 auto', width: '80%', + // Our defined media queries don't work in styled components + '@media (max-width: 575px)': { + width: '100%', + }, }) //interface @@ -114,11 +118,11 @@ export default function Integrations(): JSX.Element { text: 'View Webhooks', icon: , style: 'ctaWhite', - action: () => router.push('/settings/integrations/webhooks'), + action: () => router.push('/settings/webhooks'), }, }, ]) - }, [readwiseConnected, integrations, webhooks]) + }, []) return ( @@ -139,6 +143,9 @@ export default function Integrations(): JSX.Element { width: '80%', margin: '0 auto', height: '500px', + '@smDown': { + width: '100%', + }, }} >
Applications
@@ -157,6 +164,7 @@ export default function Integrations(): JSX.Element { alignItems: 'center', '@smDown': { flexWrap: 'wrap', + borderRadius: 'unset', }, }} > @@ -168,8 +176,10 @@ export default function Integrations(): JSX.Element { /> {item.title}

{item.subText}

- +