Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ const CatalogGrid = ({ frontmatter }) => {
const { isDark } = useStyledDarkMode();

useEffect(() => {
const CLOUD_FETCH_DESIGN = `https://cloud.layer5.io/api/catalog/content/pattern?technology=${
technology[technology.length - 1]
}&page=0&pagesize=${designSize}&search=&order=&metrics=true`;
const CLOUD_FETCH_DESIGN = `https://cloud.layer5.io/api/catalog/content/pattern?technology=${technology[technology.length - 1]
Comment thread
saurabhraghuvanshii marked this conversation as resolved.
Outdated
}&page=0&pagesize=${designSize}&search=&order=&metrics=true`;
const fetchData = async () => {
try {
// const token = getCookieValue("provider_token");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,25 @@ export const ComponentsWrapper = styled.div`
padding: 3rem 2rem 5rem 2rem;
justify-content: center;
}

.componentlink {
Comment thread
saurabhraghuvanshii marked this conversation as resolved.
Outdated
text-decoration: none;
flex: 30%;
max-width: 350px;
width: 100%;
transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
border-radius: 0.85rem;

&:hover {
transform: translateY(-3px);

.maincontainer {
box-shadow: 0 4px 15px rgba(0, 211, 169, 0.2);
border: 1px solid ${(props) => props.theme.primaryColor};
}
}
}

.maincontainer {
display: flex;
align-items: center;
Expand All @@ -37,8 +56,8 @@ export const ComponentsWrapper = styled.div`
padding: 0.5rem 1rem;
border-radius: 0.85rem;
width: 100%;
flex: 30%;
max-width: 350px;
border: 1px solid transparent;
transition: all 0.2s ease-in-out;
}

.items {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ const ComponentsGrid = ({ frontmatter }) => {
return { name, colorIcon };
});
const [validComponents, setValidComponents] = useState([]);

// Extract model name from integration title for Kanvas URL
const modelName = frontmatter.title.toLowerCase().replace(/\s+/g, "-");
Comment thread
saurabhraghuvanshii marked this conversation as resolved.
Outdated

useEffect(() => {
const fetchData = async () => {
const promises = components.map(async (item) => {
Expand All @@ -34,6 +38,11 @@ const ComponentsGrid = ({ frontmatter }) => {
fetchData();
}, []);

// Generate Cloud URL for component - opens cloud.layer5.io with model context
const getCloudUrl = (componentName) => {
return `https://cloud.layer5.io/catalog?model=${encodeURIComponent(modelName)}&component=${encodeURIComponent(componentName)}`;
};

return (
<ComponentsWrapper>
<section className="heading">
Expand All @@ -44,14 +53,20 @@ const ComponentsGrid = ({ frontmatter }) => {

<section className="componentsSection">
{validComponents.map((item) => (
<div key={item.id} className="maincontainer">
<div className="componentimg">
<img src={item.colorIcon.publicURL} alt={item.name} />
<a
key={item.name}
href={getCloudUrl(item.name)}
target="_blank"
rel="noopener noreferrer"
className="componentlink"
>
<div className="maincontainer">
<div className="componentimg">
<img src={item.colorIcon.publicURL} alt={item.name} />
</div>
<p className="items">{item.name.replaceAll("-", " ")}</p>
</div>
<p className="items">{item.name.replaceAll("-", " ")}</p>
{/* <div className="textcontent">
</div> */}
</div>
</a>
))}
</section>
</ComponentsWrapper>
Expand Down