-
Notifications
You must be signed in to change notification settings - Fork 1
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
Put container, E&A style, etc. #33
Open
hanbyul-here
wants to merge
9
commits into
main
Choose a base branch
from
layout
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d8627f5
Add outdated yarnlock
hanbyul-here b579006
Add container for pages
hanbyul-here 9f2d5a0
Separate useElementHeight hook, move transformation to mdx parsing
hanbyul-here caee745
Use metadasta when only metadata is needed
hanbyul-here 44ca703
Tweak link color
hanbyul-here 7dd8e64
Delete unnecessary file
hanbyul-here 7d639be
Adjust comment
hanbyul-here 0e8d6c5
Remove unnecessary styles
hanbyul-here ca47d76
Add about page route
hanbyul-here 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 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,19 +1,18 @@ | ||
import React from 'react'; | ||
import { getDatasets } from 'app/content/utils/mdx'; | ||
import { getTransformedDatasetMetadata } from 'app/content/utils/mdx'; | ||
import { Suspense } from 'react'; | ||
import Catalog from './catalog'; | ||
import { transformData } from '@helpers/data'; | ||
|
||
export default function Page() { | ||
const posts: any[] = getDatasets(); // @TODO: Revist type here, should use data types from veda-ui | ||
const transformed = transformData(posts); | ||
const transformed = getTransformedDatasetMetadata(); | ||
|
||
return ( | ||
<section> | ||
<h1 className='font-semibold text-2xl mb-8 tracking-tighter'>Datasets</h1> | ||
<Suspense fallback={<>Loading...</>}> | ||
<Catalog datasets={transformed} /> | ||
</Suspense> | ||
</section> | ||
<div className='grid-container'> | ||
<section> | ||
<Suspense fallback={<>Loading...</>}> | ||
<Catalog datasets={transformed} /> | ||
</Suspense> | ||
</section> | ||
</div> | ||
); | ||
} |
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,28 +1,16 @@ | ||
import React, { Suspense } from 'react'; | ||
import { getDatasets } from 'app/content/utils/mdx'; | ||
import { getTransformedDatasetMetadata } from 'app/content/utils/mdx'; | ||
import ExplorationAnalysis from './exploration'; | ||
import { PageHero } from 'app/lib'; | ||
|
||
export default function Page() { | ||
const datasets: any[] = getDatasets(); | ||
const datasets: any[] = getTransformedDatasetMetadata(); | ||
return ( | ||
<section> | ||
<div | ||
// The below styles adjust the E&A page to match what we have on earthdata.nasa.gov | ||
// Ideally, we would replace some of the custom styles with the USWDS grid and util classes | ||
// but since we do not have USWDS yet in the template instance, this is a quick workaround | ||
// to make the page look closer to the current E&A page. | ||
style={{ | ||
height: 'calc(100vh - 64px)', | ||
position: 'absolute', | ||
width: '100%', | ||
}} | ||
> | ||
<Suspense fallback={<>Loading...</>}> | ||
<PageHero title='Exploration' isHidden /> | ||
<ExplorationAnalysis datasets={datasets} /> | ||
</Suspense> | ||
</div> | ||
<Suspense fallback={<>Loading...</>}> | ||
<PageHero title='Exploration' isHidden /> | ||
<ExplorationAnalysis datasets={datasets} /> | ||
</Suspense> | ||
</section> | ||
); | ||
} |
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
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 |
---|---|---|
|
@@ -2,3 +2,7 @@ | |
@forward 'uswds'; | ||
|
||
@use 'uswds-core' as *; | ||
|
||
.veda__hug-reset-container { | ||
grid-column: 1 / -1; | ||
} |
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,38 @@ | ||
import { useState, useEffect } from 'react'; | ||
|
||
const DEFAULT_HEIGHT = 100; | ||
|
||
export default function useElementHeight({ | ||
queryToSelect, | ||
}: { | ||
queryToSelect: string; | ||
}): number | null { | ||
const [headerHeight, setHeaderHeight] = useState<number | null>( | ||
DEFAULT_HEIGHT, | ||
); | ||
|
||
useEffect(() => { | ||
const matchingElement = document.querySelector<HTMLElement>(queryToSelect); | ||
if (matchingElement) { | ||
const updateHeaderHeight = () => { | ||
setHeaderHeight(matchingElement.offsetHeight); | ||
}; | ||
// Initial height check | ||
updateHeaderHeight(); | ||
// Add a resize observer to update height on resize | ||
const resizeObserver = new ResizeObserver(() => { | ||
updateHeaderHeight(); | ||
}); | ||
resizeObserver.observe(matchingElement); | ||
|
||
return () => { | ||
resizeObserver.disconnect(); | ||
}; | ||
} else { | ||
console.warn(`No matching element for ${queryToSelect} found.`); | ||
} | ||
// Runs once on mount | ||
}, []); | ||
|
||
return headerHeight; | ||
} |
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
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 might need to override the default max width configuration for the
grid-container
, if we want to match what we have in the Earthdata instance / designs (full width container)?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.
I thought the template instance goal is more to provide the structure that any other instance can override those values - like grid-container can be whichever width that people want but the template instance's job is to offer a structure that the defined width will be applied.