-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: Maya Raman <[email protected]> Co-authored-by: Matt Meigs <[email protected]> Co-authored-by: anabellabuckvar <[email protected]>
- Loading branch information
1 parent
1c94ff2
commit 7d84d5f
Showing
31 changed files
with
1,574 additions
and
882 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const { siteMetadata } = require('../../src/utils/site-metadata'); | ||
|
||
const breadcrumbType = `Breadcrumb`; | ||
|
||
const createBreadcrumbNodes = async ({ db, createNode, createNodeId, createContentDigest }) => { | ||
const { database, project } = siteMetadata; | ||
let breadcrumbData; | ||
try { | ||
breadcrumbData = await db.fetchBreadcrumbs(database, project); | ||
} catch (e) { | ||
console.error(`Error while fetching breadcrumb data from Atlas: ${e}`); | ||
} | ||
const [breadcrumbs, propertyUrl] = breadcrumbData | ||
? [breadcrumbData.breadcrumbs, breadcrumbData.propertyUrl] | ||
: [null, '']; | ||
|
||
return createNode({ | ||
children: [], | ||
id: createNodeId(`Breadcrumbs-${project}`), | ||
internal: { | ||
contentDigest: createContentDigest(breadcrumbs), | ||
type: breadcrumbType, | ||
}, | ||
breadcrumbs: breadcrumbs, | ||
propertyUrl: propertyUrl, | ||
}); | ||
}; | ||
|
||
module.exports = { | ||
createBreadcrumbNodes, | ||
breadcrumbType, | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { Menu, MenuItem } from '@leafygreen-ui/menu'; | ||
import IconButton from '@leafygreen-ui/icon-button'; | ||
import Icon from '@leafygreen-ui/icon'; | ||
import { formatText } from '../../utils/format-text'; | ||
|
||
const CollapsedBreadcrumbs = ({ crumbs }) => { | ||
return ( | ||
<React.Fragment> | ||
<Menu | ||
align="bottom" | ||
justify="start" | ||
trigger={ | ||
<IconButton aria-label="Show all breadcrumbs"> | ||
<Icon glyph="Ellipsis" /> | ||
</IconButton> | ||
} | ||
> | ||
{crumbs.map((crumb, index) => ( | ||
<MenuItem key={index} href={crumb.url}> | ||
{formatText(crumb.title)} | ||
</MenuItem> | ||
))} | ||
</Menu> | ||
</React.Fragment> | ||
); | ||
}; | ||
|
||
const crumbObjectShape = { | ||
title: PropTypes.string.isRequired, | ||
url: PropTypes.string.isRequired, | ||
}; | ||
|
||
CollapsedBreadcrumbs.propTypes = { | ||
crumbs: PropTypes.arrayOf(PropTypes.shape(crumbObjectShape)).isRequired, | ||
}; | ||
|
||
export default CollapsedBreadcrumbs; |
Oops, something went wrong.