Skip to content
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
merged 40 commits into from
Jul 17, 2024
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 Jul 10, 2024
1bea75b
chore(NavBar): Change NavBar to use Button's
Kara-Zor-El Jul 10, 2024
85f90ee
chore(formatting): format button and navbar component
Kara-Zor-El Jul 11, 2024
a2d516f
Fix(Button): Add nextjs link component
Kara-Zor-El Jul 13, 2024
64a984a
Fix(Button): Add nextjs link component
Kara-Zor-El Jul 13, 2024
6656672
Fix(Button): Add prefetching to link
Kara-Zor-El Jul 13, 2024
8b920f1
Fix(Button): Remove unnecessary props
Kara-Zor-El Jul 13, 2024
98b1cba
Fix(Button): Remove depricated prefetch
Kara-Zor-El Jul 13, 2024
4bd57e8
Fix(Button): Create multiple prop options
Kara-Zor-El Jul 14, 2024
72bc771
Fix(Button): Add Button Styles
Kara-Zor-El Jul 16, 2024
934bd77
feat(HeroBanner): Add images and svgs required for HeroBanner
Kara-Zor-El Jun 13, 2024
56e2002
feat(HeroBanner): Add config for HeroBanner
Kara-Zor-El Jun 13, 2024
c84dc82
feat(HeroBanner): Add HeroBanner code
Kara-Zor-El Jun 13, 2024
45d3714
feat(HomePage): Add HeroBanner to HomePage
Kara-Zor-El Jun 13, 2024
0415a37
Fix(HeroBanner): restyle HeroBanner
Kara-Zor-El Jul 16, 2024
704ed95
Fix(HeroBanner): Formatting
Kara-Zor-El Jul 16, 2024
068156b
Fix(HomePage): Do some more work on the header
Kara-Zor-El Jul 16, 2024
e2eac43
Fix(Button): Change Svg Color
Kara-Zor-El Jul 16, 2024
81c1d76
Fix(Button): Change to use Enum
Kara-Zor-El Jul 16, 2024
17f42ee
Feat(Image): Add image export for future use
Kara-Zor-El Jul 16, 2024
cdc83c1
Fix(HeroBanner): remove unnessary tailwind
Kara-Zor-El Jul 16, 2024
c7bceb8
Fix(HeroBanner): Remove unnecessary double check
Kara-Zor-El Jul 16, 2024
0cf36aa
Fix(HerBanner): Hr for divider
Kara-Zor-El Jul 16, 2024
563d5e8
Fix(HeroBanner): Fix ugly code
Kara-Zor-El Jul 16, 2024
a59e2fd
Fix(HeroBanner): Add onClick
Kara-Zor-El Jul 16, 2024
e6e98be
Fix(HeroBanner): add .button style
Kara-Zor-El Jul 16, 2024
ad6225a
Fix(HeroBanner): add active style stuff
Kara-Zor-El Jul 16, 2024
fe4ce95
Fix(HeroBanner): pass in alt text
Kara-Zor-El Jul 16, 2024
f79fc22
Fix(HeroBanner): Add comment for info
Kara-Zor-El Jul 16, 2024
1f9d989
Fix(HeroBanner): Add prefetch prop
Kara-Zor-El Jul 16, 2024
858af9a
Fix(HeroBanner): Fix navbar active
Kara-Zor-El Jul 16, 2024
6ad9afc
Fix(HeroBanner): Change div to H1
Kara-Zor-El Jul 16, 2024
9e23782
Fix(HeroBanner): Styling
Kara-Zor-El Jul 16, 2024
856ed65
Fix(HeroBanner): re-add back current page is highlighted
Kara-Zor-El Jul 16, 2024
193a270
Fix(HeroBanner): Fix unnecessary css
Kara-Zor-El Jul 16, 2024
faf5ccb
Fix(HeroBanner): naming semantics change
Kara-Zor-El Jul 16, 2024
757b0f8
Fix(HeroBanner): naming semantics change
Kara-Zor-El Jul 16, 2024
cc93557
Fix(Config): Make cases match
Kara-Zor-El Jul 16, 2024
fd3f0ca
Fix(Build): Make the website able to build using npm run build
Kara-Zor-El Jul 16, 2024
91fa8ab
Fix(HeroBanner): Fix typechecking on config
Kara-Zor-El Jul 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix(Build): Make the website able to build using npm run build
Kara-Zor-El committed Jul 16, 2024
commit fd3f0ca720cae760c1b24af598b9f9af68da3022
16 changes: 10 additions & 6 deletions components/Button.tsx
Original file line number Diff line number Diff line change
@@ -2,12 +2,14 @@ import React from 'react';
import Link from 'next/link';
import styles from '../styles/Button.module.scss';

enum ButtonType {
NAVBAR = styles.navBtn,
NAVBAR_ACTIVE = [styles.navBtn, styles.active].join(' '),
LIGHT = styles.lightBtn,
SOCIAL = styles.socialBtn,
}
const ButtonType = {
NAVBAR: styles.navBtn,
NAVBAR_ACTIVE: [styles.navBtn, styles.active].join(' '),
LIGHT: styles.lightBtn,
SOCIAL: styles.socialBtn,
} as const;

type ButtonType = typeof ButtonType[keyof typeof ButtonType]

interface Props {
onClick?: () => void;
@@ -19,10 +21,12 @@ interface Props {

interface LabelProps extends Props {
label: string;
children?: never;
}

interface ChildrenProps extends Props {
children: React.ReactNode;
label?: never;
}

const Button: React.FC<LabelProps | ChildrenProps> = ({
10 changes: 5 additions & 5 deletions components/EventBanner.tsx
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) {
Copy link
Member

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.

return null;
}

const eventMarkdown = bannerInfo.text;
const eventMarkdown = (bannerInfo as any).text;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above //TODO(#12): Improve yaml typechecking

if (!eventMarkdown) {
return null;
}
26 changes: 26 additions & 0 deletions config.d.ts
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;
}
3 changes: 3 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -5,6 +5,9 @@ const nextConfig = withYaml({
poweredByHeader: false,
reactStrictMode: true,
swcMinify: true,
images: {
unoptimized: true,
},
optimizeFonts: true,
output: 'export',
experimental: {