fix: fixing some issues from merging

This commit is contained in:
MTG2000
2022-02-08 17:26:56 +02:00
parent 07043d9e39
commit df79a34120
10 changed files with 54 additions and 72 deletions

View File

@@ -15,8 +15,10 @@ import {
} from "@apollo/client";
const client = new ApolloClient({
//uri: 'https://deploy-preview-2--makers-bolt-fun.netlify.app/.netlify/functions/graphql',
uri: '/.netlify/functions/graphql',
uri: process.env.NODE_ENV === 'development' ?
'https://xenodochial-goldstine-d09942.netlify.app/.netlify/functions/graphql'
:
'/.netlify/functions/graphql',
cache: new InMemoryCache()
});

View File

@@ -1,10 +1,20 @@
import { Link } from "react-router-dom";
export function wrapLink(Component: JSX.Element, href: string | undefined, className?: string) {
export function wrapLink(Component: JSX.Element, href: string | undefined, options: { className?: string, newTab?: boolean } = {}) {
if (!href) return Component;
return <Link to={href} className={className}>
if (options.newTab)
return <a
href={href}
className={options.className}
target="_blank" rel="noopener noreferrer" >
{Component}
</a>
return <Link
to={href}
className={options.className} >
{Component}
</Link>
}