-
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
feat(HeroBanner): add HeroBanner component and add to HomePage #10
Merged
+665
−24
Merged
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
e9c1914
Feat(Components): Create button component
Kara-Zor-El 1bea75b
chore(NavBar): Change NavBar to use Button's
Kara-Zor-El 85f90ee
chore(formatting): format button and navbar component
Kara-Zor-El a2d516f
Fix(Button): Add nextjs link component
Kara-Zor-El 64a984a
Fix(Button): Add nextjs link component
Kara-Zor-El 6656672
Fix(Button): Add prefetching to link
Kara-Zor-El 8b920f1
Fix(Button): Remove unnecessary props
Kara-Zor-El 98b1cba
Fix(Button): Remove depricated prefetch
Kara-Zor-El 4bd57e8
Fix(Button): Create multiple prop options
Kara-Zor-El 72bc771
Fix(Button): Add Button Styles
Kara-Zor-El 934bd77
feat(HeroBanner): Add images and svgs required for HeroBanner
Kara-Zor-El 56e2002
feat(HeroBanner): Add config for HeroBanner
Kara-Zor-El c84dc82
feat(HeroBanner): Add HeroBanner code
Kara-Zor-El 45d3714
feat(HomePage): Add HeroBanner to HomePage
Kara-Zor-El 0415a37
Fix(HeroBanner): restyle HeroBanner
Kara-Zor-El 704ed95
Fix(HeroBanner): Formatting
Kara-Zor-El 068156b
Fix(HomePage): Do some more work on the header
Kara-Zor-El e2eac43
Fix(Button): Change Svg Color
Kara-Zor-El 81c1d76
Fix(Button): Change to use Enum
Kara-Zor-El 17f42ee
Feat(Image): Add image export for future use
Kara-Zor-El cdc83c1
Fix(HeroBanner): remove unnessary tailwind
Kara-Zor-El c7bceb8
Fix(HeroBanner): Remove unnecessary double check
Kara-Zor-El 0cf36aa
Fix(HerBanner): Hr for divider
Kara-Zor-El 563d5e8
Fix(HeroBanner): Fix ugly code
Kara-Zor-El a59e2fd
Fix(HeroBanner): Add onClick
Kara-Zor-El e6e98be
Fix(HeroBanner): add .button style
Kara-Zor-El ad6225a
Fix(HeroBanner): add active style stuff
Kara-Zor-El fe4ce95
Fix(HeroBanner): pass in alt text
Kara-Zor-El f79fc22
Fix(HeroBanner): Add comment for info
Kara-Zor-El 1f9d989
Fix(HeroBanner): Add prefetch prop
Kara-Zor-El 858af9a
Fix(HeroBanner): Fix navbar active
Kara-Zor-El 6ad9afc
Fix(HeroBanner): Change div to H1
Kara-Zor-El 9e23782
Fix(HeroBanner): Styling
Kara-Zor-El 856ed65
Fix(HeroBanner): re-add back current page is highlighted
Kara-Zor-El 193a270
Fix(HeroBanner): Fix unnecessary css
Kara-Zor-El faf5ccb
Fix(HeroBanner): naming semantics change
Kara-Zor-El 757b0f8
Fix(HeroBanner): naming semantics change
Kara-Zor-El cc93557
Fix(Config): Make cases match
Kara-Zor-El fd3f0ca
Fix(Build): Make the website able to build using npm run build
Kara-Zor-El 91fa8ab
Fix(HeroBanner): Fix typechecking on config
Kara-Zor-El 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
Fix(Build): Make the website able to build using npm run build
commit fd3f0ca720cae760c1b24af598b9f9af68da3022
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
// CSS | ||
import styles from '../styles/components/EventBanner.module.scss'; | ||
// Config | ||
import * as config from '../config.yaml'; | ||
import config from '../config.yaml'; | ||
import ReactMarkdown from 'react-markdown'; | ||
|
||
interface Props { | ||
color?: string; | ||
contextKey?: string; | ||
contextKey?: keyof typeof config; | ||
} | ||
|
||
export default function EventBanner({ | ||
color = 'event-banner', | ||
contextKey = 'bannerInfo', | ||
}: Props) { | ||
const bannerInfo = config[contextKey] || []; | ||
const bannerInfo = config[contextKey]; | ||
|
||
if (bannerInfo.length === 0 || bannerInfo?.hidden) { | ||
if (!bannerInfo || (Array.isArray(bannerInfo) && bannerInfo.length === 0) || (bannerInfo as any)?.hidden) { | ||
return null; | ||
} | ||
|
||
const eventMarkdown = bannerInfo.text; | ||
const eventMarkdown = (bannerInfo as any).text; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||
if (!eventMarkdown) { | ||
return null; | ||
} | ||
|
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,26 @@ | ||
declare module '*.yaml' { | ||
interface PageInfo { | ||
pageName: string; | ||
pageLink: string; | ||
displayInNav: boolean; | ||
} | ||
|
||
interface BannerInfo { | ||
text: string; | ||
} | ||
|
||
interface HeroIcon { | ||
altText: string; | ||
link: string; | ||
path: string; | ||
} | ||
|
||
interface Config { | ||
pageInfo: PageInfo[]; | ||
bannerInfo: BannerInfo; | ||
heroIcons: HeroIcon[]; | ||
} | ||
|
||
const value: Config; | ||
export = value; | ||
} |
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
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.
The
as any
is not the way todo this can you add a todo linking to this issue like//TODO(#12): Improve yaml typechecking
.