diff --git a/src/components/Community/Connectors/ConnectorList.tsx b/src/components/Community/Connectors/ConnectorList.tsx index 3e74a995..d13ecf79 100644 --- a/src/components/Community/Connectors/ConnectorList.tsx +++ b/src/components/Community/Connectors/ConnectorList.tsx @@ -7,7 +7,7 @@ const ConnectorList = () => { const history = useHistory(); useEffect(() => { - fetch('https://raw.githubusercontent.com/saviynt/developer-portal/main/static/community/connector/connectorList.json', { cache: "no-cache" }) + fetch('/community/connector/connectorList.json', { cache: "no-cache" }) .then(response => { if (!response.ok) { throw new Error('Network response was not ok'); diff --git a/src/components/Showcase/ShowcaseCard.tsx b/src/components/Showcase/ShowcaseCard.tsx index d5849bfa..4632f2a4 100644 --- a/src/components/Showcase/ShowcaseCard.tsx +++ b/src/components/Showcase/ShowcaseCard.tsx @@ -1,12 +1,22 @@ // ShowcaseCard.tsx import React from 'react'; -import { ShowcaseItem } from './ShowcaseItems'; interface ShowcaseCardProps { item: ShowcaseItem; } +export interface ShowcaseItem { + title: string; + description: string; + imageUrl: string; + link: string; + tags: string[]; + readmeLink: string; + githubLink: string; + resourceLink: string; +} + const ShowcaseCard: React.FC = ({ item }) => { return ( diff --git a/src/components/Showcase/ShowcaseCards.tsx b/src/components/Showcase/ShowcaseCards.tsx index 1cd19492..902018e2 100644 --- a/src/components/Showcase/ShowcaseCards.tsx +++ b/src/components/Showcase/ShowcaseCards.tsx @@ -1,21 +1,46 @@ -// ShowcaseCards.tsx +import React, { useState, useEffect } from 'react'; +import ShowcaseCard,{ ShowcaseItem } from './ShowcaseCard'; -import React from 'react'; -import ShowcaseCard from './ShowcaseCard'; -import { showcaseItems } from './ShowcaseItems'; const ShowcaseCards: React.FC = () => { - return ( -
-
- {showcaseItems.map((item, index) => ( -
- -
- ))} -
-
- ); + const [items, setItems] = useState([]); + const [isLoading, setLoading] = useState(true); + + // Fetch the JSON data when the component mounts + useEffect(() => { + fetch('/community/showcase/showcaseList.json') // Adjust the path as necessary + .then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); + }) + .then(data => { + setItems(data); + setLoading(false); + }) + .catch(error => { + console.error('Error loading the showcase items:', error); + setLoading(false); + }); + }, []); + + // Optionally handle loading state + if (isLoading) { + return
Loading...
; + } + + return ( +
+
+ {items.map((item, index) => ( +
+ +
+ ))} +
+
+ ); }; export default ShowcaseCards; diff --git a/src/components/Showcase/ShowcaseItems.tsx b/src/components/Showcase/ShowcaseItems.tsx deleted file mode 100644 index ef45b86d..00000000 --- a/src/components/Showcase/ShowcaseItems.tsx +++ /dev/null @@ -1,63 +0,0 @@ -// src/components/ShowcaseItems.tsx -import React, { useState, useEffect } from 'react'; - - -export interface ShowcaseItem { - title: string; - description: string; - imageUrl: string; - link: string; - tags: string[]; - readmeLink: string; - githubLink: string; - resourceLink: string; - } - - // export const showcaseItems = (): ShowcaseItem[] => { - // const [items, setItems] = useState([]); - - // useEffect(() => { - // fetch('/showcaseItems.json') - // .then((response) => response.json()) - // .then((data: ShowcaseItem[]) => { - // setItems(data); - // }) - // .catch((error) => { - // console.error('Error fetching showcase items:', error); - // }); - // }, []); - - // return items; - // }; - - export const showcaseItems: ShowcaseItem[] = [ - { - title: "Saviynt JSON Wizard", - description: "Configure Saviynt REST Connector with the power of AI", - imageUrl: "https://seeklogo.com/images/C/chatgpt-logo-02AFA704B5-seeklogo.com.png", - link: "https://chat.openai.com/g/g-4ynYxKenQ-saviynt-json-wizard", - tags: ['favorite', 'chat-gpt', 'connector'], - }, - { - title: "Beta Solution", - description: "An all-encompassing solution designed to tackle industry-specific challenges, offering seamless integration and unparalleled efficiency.", - imageUrl: "https://raw.githubusercontent.com/saviynt/developer-portal/main/static/img/community.png", - link: "https://example.com/project-beta", - tags: ['integrations'], - }, - { - title: "Gamma Initiative", - description: "A community-driven initiative that fosters collaboration and knowledge sharing, creating a vibrant ecosystem around our platform.", - imageUrl: "https://raw.githubusercontent.com/saviynt/developer-portal/main/static/img/community.png", - link: "https://example.com/project-gamma", - tags: ['templates'], - }, - { - title: "Delta Project", - description: "A community-driven initiative that fosters collaboration and knowledge sharing, creating a vibrant ecosystem around our platform.", - imageUrl: "https://raw.githubusercontent.com/saviynt/developer-portal/main/static/img/community.png", - link: "https://example.com/project-gamma", - tags: ['templates'], - }, - // Add more items as needed. - ]; \ No newline at end of file