-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update theme to 0.2.x #402
Merged
Merged
Changes from 21 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
29023ff
setup for iterative theme update
yathomasi 02a2b95
fix navbar, navbar, hamburger menu
yathomasi 76abb41
add docsearch
yathomasi e45512d
clean up components
yathomasi 4e6ea20
update font
yathomasi 0185fa5
update not found page
yathomasi 8165989
update theme version
yathomasi 0876fca
Merge branch 'master' into update-theme
yathomasi 3443509
fix yarn.lock
yathomasi 5c1cafd
remove preflight config
yathomasi fc1c56c
fixing layout
yathomasi 9b19868
update for seo
yathomasi 15b4690
fix stylings and layout
yathomasi 070a24a
use alert form theme
yathomasi 969509b
update theme package
yathomasi 65c379a
Merge branch 'master' into update-theme
yathomasi 4b8565b
update alert style
yathomasi 13f1b7c
update alert and use content from theme
yathomasi e7e87ad
fix visited anchor
yathomasi cc549aa
add scroll padding top
yathomasi 2adfbb8
fix for use case
yathomasi 75d7047
Merge branch 'master' into update-theme
yathomasi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
72 changes: 72 additions & 0 deletions
72
src/@dvcorg/gatsby-theme-iterative/components/Documentation/Layout/SearchForm/index.tsx
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,72 @@ | ||
import React, { useEffect, useState } from 'react' | ||
import Promise from 'promise-polyfill' | ||
import { loadResource } from '@dvcorg/gatsby-theme-iterative/src/utils/front/resources' | ||
|
||
import * as styles from '@dvcorg/gatsby-theme-iterative/src/components/Documentation/Layout/SearchForm/styles.module.css' | ||
|
||
declare global { | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
interface Window { | ||
docsearch?: (opts: object) => void | ||
} | ||
} | ||
|
||
const apiKey = '3e17d424c7a90fede27b848fb01c0dc2' | ||
const appId = '1O03WAGL0D' | ||
const indexName = 'cml' | ||
|
||
const SearchForm: React.FC = props => { | ||
const [searchAvailable, setSearchAvailable] = useState<boolean>(false) | ||
useEffect(() => { | ||
console.log({ window, docSearch: window?.docsearch }) | ||
if (window) { | ||
if (!window.docsearch) { | ||
Promise.all([ | ||
loadResource( | ||
'https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn/docsearch.min.css' | ||
), | ||
loadResource( | ||
'https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn/docsearch.min.js' | ||
) | ||
]).then(() => { | ||
if (window.docsearch) { | ||
window.docsearch({ | ||
appId, | ||
apiKey, | ||
indexName, | ||
inputSelector: '#doc-search', | ||
debug: false // Set to `true` if you want to inspect the dropdown | ||
}) | ||
setSearchAvailable(true) | ||
} | ||
}) | ||
} else { | ||
window.docsearch({ | ||
appId, | ||
apiKey, | ||
indexName, | ||
inputSelector: '#doc-search', | ||
debug: false // Set to `true` if you want to inspect the dropdown | ||
}) | ||
setSearchAvailable(true) | ||
} | ||
} | ||
}, []) | ||
|
||
return ( | ||
<div className={styles.searchArea}> | ||
<div className={styles.container}> | ||
<input | ||
className={styles.input} | ||
type="text" | ||
id="doc-search" | ||
placeholder="Search docs" | ||
disabled={!searchAvailable} | ||
{...props} | ||
/> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default SearchForm | ||
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
4 changes: 2 additions & 2 deletions
4
...components/organisms/SiteFooter/index.tsx → ...erative/components/LayoutFooter/index.tsx
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
16 changes: 16 additions & 0 deletions
16
src/@dvcorg/gatsby-theme-iterative/components/LayoutHeader/Alert/index.tsx
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,16 @@ | ||
import React from 'react' | ||
import { AlertContent } from '@dvcorg/gatsby-theme-iterative/src/components/LayoutHeader/Alert/content' | ||
|
||
import * as styles from './styles.module.css' | ||
|
||
const Alert: React.FC = () => ( | ||
<div className={styles.alert}> | ||
<div className={styles.text}> | ||
<p> | ||
<AlertContent /> | ||
</p> | ||
</div> | ||
</div> | ||
) | ||
|
||
export default Alert |
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 |
---|---|---|
|
@@ -48,5 +48,9 @@ | |
color: rgba(58 45 76 / 70%); | ||
opacity: 0.7; | ||
} | ||
|
||
&:visited { | ||
color: inherit; | ||
} | ||
} | ||
} |
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
15 changes: 10 additions & 5 deletions
15
...ts/organisms/SiteHeader/styles.module.css → ...components/LayoutHeader/styles.module.css
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
File renamed without changes.
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
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll have to follow up on making this more reusable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we have had this pending for a while
DocsSearch
implementation gatsby-theme-iterative#27