s3browser-frontend/src/index.tsx

48 lines
1.0 KiB
TypeScript
Raw Normal View History

2021-07-26 12:54:22 +00:00
import React from "react"
import ReactDOM from "react-dom"
import "./index.scss"
import App from "./App"
import { ApolloClient, ApolloProvider, InMemoryCache } from "@apollo/client"
2021-08-10 09:21:18 +00:00
import "react-contexify/dist/ReactContexify.css"
2021-07-26 12:54:22 +00:00
const client = new ApolloClient({
2021-08-27 19:17:10 +00:00
uri: "/api/graphql",
2021-09-09 11:56:23 +00:00
cache: new InMemoryCache({
typePolicies:{
Query: {
fields: {
files: {
merge(existing, incoming){
return incoming
}
},
directorys:{
merge(existing, incoming){
return incoming
}
}
}
}
}
})
2021-07-26 12:54:22 +00:00
})
// Disable drag and drop behaviour on document
function disable(event: DragEvent) {
event.preventDefault()
event.stopPropagation()
}
document.addEventListener("dragenter",disable)
document.addEventListener("dragleave",disable)
document.addEventListener("dragover",disable)
document.addEventListener("drop",disable)
2021-07-26 12:54:22 +00:00
ReactDOM.render(
<React.StrictMode>
<ApolloProvider client={client}>
<App />
</ApolloProvider>
</React.StrictMode>,
document.getElementById("root")
)