diff --git a/sdk/typescript/docs/code-snippets/mixfetchurl.tsx b/sdk/typescript/docs/code-snippets/mixfetchurl.tsx new file mode 100644 index 0000000000..a567ee12c7 --- /dev/null +++ b/sdk/typescript/docs/code-snippets/mixfetchurl.tsx @@ -0,0 +1,47 @@ +import React, { useState } from 'react'; +import TextField from '@mui/material/TextField'; +import Button from '@mui/material/Button'; +import Stack from '@mui/material/Stack'; +import Box from '@mui/material/Box'; + +export const GitHubRepoSearch = () => { + const [repoUrl, setRepoUrl] = useState(''); + + const handleSearch = () => { + if(!repoUrl || repoUrl.length < 1 ) { + return window.alert("Please enter a valid Github URL!") + } + const matchedRepo = repoUrl.match(/https:\/\/github\.com\/(.*)/)[1] + + // Construct the search URL + const searchUrl = `https://github.com/search?q=repo:${matchedRepo} fetch(&type=code`; + + // Redirect the user to the search results page + window.location.href = searchUrl; + }; + + return ( + + + setRepoUrl(e.target.value)} + size="small" + sx={{width: "400px"}} + /> + + + + + ); +} + diff --git a/sdk/typescript/docs/pages/FAQ/integrations.mdx b/sdk/typescript/docs/pages/FAQ/integrations.mdx index c6e3918e40..d949a01880 100644 --- a/sdk/typescript/docs/pages/FAQ/integrations.mdx +++ b/sdk/typescript/docs/pages/FAQ/integrations.mdx @@ -1,3 +1,6 @@ +import Box from '@mui/material/Box'; +import { GitHubRepoSearch } from '../../code-snippets/mixfetchurl'; + # Integrations page ### Existing resources @@ -11,7 +14,13 @@ If you're unsure where to start, the following set of questions should help you __1. Does your app rely on using `fetch` for its network traffic and remote connections?__ -If yes, explore implementing `mixfetch`to route app traffic through the mixnet. + Check whether mixFetch can be used by entering your repository's URL below: + + + +If yes, explore implementing `mixfetch` to route app traffic through the mixnet. + + If not: __2. Is your app developed in TS/JS or Rust?__