-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Thomas Hallgren <thomas@tada.se>
- Loading branch information
Showing
16 changed files
with
120 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,10 @@ | |
/.cache/ | ||
/public/ | ||
|
||
# Docusaurus | ||
/.docusaurus/ | ||
/build/ | ||
|
||
# gatsby-plugin-extract-schema | ||
/schema.graphql | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React, { useState, useEffect } from 'react' | ||
|
||
function ClientOnly({ children, ...delegated }) { | ||
const [hasMounted, setHasMounted] = useState(false); | ||
|
||
useEffect(() => { | ||
setHasMounted(true); | ||
}, []); | ||
if (!hasMounted) { | ||
return (<div>Loading...</div>); | ||
} | ||
return ( | ||
<div {...delegated}> | ||
{children} | ||
</div> | ||
); | ||
} | ||
|
||
export default ClientOnly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import * as React from "react"; | ||
import styled from "@mui/material/styles/styled"; | ||
|
||
const GoogleSearch = styled('div')(() => ({ | ||
table: { | ||
padding: 0, | ||
margin: 0, | ||
border: 0, | ||
}, | ||
tr: { | ||
color: "var(--ifm-navbar-color)", | ||
border: 0, | ||
}, | ||
td: { | ||
padding: 0, | ||
margin: 0, | ||
border: 0, | ||
lineHeight: 1.2, | ||
}, | ||
'.gsc-control-cse': { | ||
padding: 0, | ||
margin: 0, | ||
}, | ||
'.gsc': { | ||
backgroundColor: "var(--ifm-navbar-background-color)", | ||
borderColor: "var(--ifm-navbar-background-color)", | ||
'&-control': { | ||
'&-cse': { | ||
backgroundColor: "var(--ifm-navbar-background-color)", | ||
borderColor: "var(--ifm-navbar-background-color)", | ||
overflow: 'hidden', | ||
} | ||
}, | ||
'&-input': { | ||
backgroundColor: "var(--ifm-navbar-background-color)", | ||
'.gsib_a': { | ||
padding: '5px 1px 5px 8px', | ||
}, | ||
'&-box': { | ||
borderRadius: '8px', | ||
overflow: 'hidden', | ||
} | ||
}, | ||
'&-search-button': { | ||
margin: '0 0', | ||
'&-v2': { | ||
padding: '7px 7px', | ||
borderRadius: '50%', | ||
}, | ||
}, | ||
} | ||
})); | ||
|
||
// Search must be combined with a script tag in head that points to the | ||
// Google search engine declaration. Our is added in ./Root/index.tsx | ||
// | ||
// See https://programmablesearchengine.google.com/ for more info. | ||
function Search() { | ||
return ( | ||
<GoogleSearch><div className="gcse-search"/></GoogleSearch> | ||
) | ||
} | ||
export default Search; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,13 @@ | ||
import React, {JSX} from 'react'; | ||
import {ThemeProvider} from "@mui/material/styles"; | ||
import {customTheme} from "./custom-themes"; | ||
import Head from "@docusaurus/Head"; | ||
|
||
function Root({children}): JSX.Element { | ||
return ( | ||
<> | ||
<Head> | ||
<script defer src="https://cse.google.com/cse.js?cx=c1eaf17d1db4e4ac8"/> | ||
</Head> | ||
<ThemeProvider theme={customTheme()}> | ||
{children} | ||
</ThemeProvider> | ||
</> | ||
); | ||
return ( | ||
<ThemeProvider theme={customTheme()}> | ||
{children} | ||
</ThemeProvider> | ||
); | ||
} | ||
|
||
export default Root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,15 @@ | ||
import styled from "@mui/material/styles/styled"; | ||
import BrowserOnly from "@docusaurus/BrowserOnly"; | ||
import * as React from "react"; | ||
import {useEffect} from "react"; | ||
import Search from '@site/src/components/Search' | ||
|
||
const GoogleSearch = styled('div')(() => ({ | ||
table: { | ||
padding: 0, | ||
margin: 0, | ||
border: 0, | ||
}, | ||
tr: { | ||
color: "var(--ifm-navbar-color)", | ||
border: 0, | ||
}, | ||
td: { | ||
padding: 0, | ||
margin: 0, | ||
border: 0, | ||
lineHeight: 1.2, | ||
}, | ||
'.gsc-control-cse': { | ||
padding: 0, | ||
margin: 0, | ||
}, | ||
'.gsc': { | ||
backgroundColor: "var(--ifm-navbar-background-color)", | ||
borderColor: "var(--ifm-navbar-background-color)", | ||
'&-control': { | ||
'&-cse': { | ||
backgroundColor: "var(--ifm-navbar-background-color)", | ||
borderColor: "var(--ifm-navbar-background-color)", | ||
overflow: 'hidden', | ||
} | ||
}, | ||
'&-input': { | ||
backgroundColor: "var(--ifm-navbar-background-color)", | ||
'.gsib_a': { | ||
padding: '5px 1px 5px 8px', | ||
}, | ||
'&-box': { | ||
borderRadius: '8px', | ||
overflow: 'hidden', | ||
} | ||
}, | ||
'&-search-button': { | ||
margin: '0 0', | ||
'&-v2': { | ||
padding: '7px 7px', | ||
borderRadius: '50%', | ||
}, | ||
}, | ||
} | ||
})); | ||
|
||
// SearchBar must be combined with a script tag in head that points to the | ||
// Google search engine declaration. Our is added in ./Root/index.tsx | ||
// | ||
// See https://programmablesearchengine.google.com/ for more info. | ||
export default function SearchBar() { | ||
return <BrowserOnly> | ||
{() => ( | ||
<GoogleSearch> | ||
<div className="gcse-search"></div> | ||
</GoogleSearch> | ||
)} | ||
</BrowserOnly> | ||
useEffect(() => { | ||
const script = document.createElement("script"); | ||
document.head.append(script); | ||
script.src = "https://cse.google.com/cse.js?cx=c1eaf17d1db4e4ac8"; | ||
}, []); | ||
|
||
return ( | ||
<Search/> | ||
); | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"docsSidebar": [ | ||
{ | ||
"type": "autogenerated", | ||
"dirName": "." | ||
} | ||
] | ||
} |