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(HomePage): Create Home Page #18

Merged
merged 83 commits into from
Aug 7, 2024
Merged

Feat(HomePage): Create Home Page #18

merged 83 commits into from
Aug 7, 2024

Conversation

Kara-Zor-El
Copy link
Contributor

@Kara-Zor-El Kara-Zor-El commented Jul 17, 2024

Link to Preview: https://club-website-c1tjlgepg-karas-projects-e1ba5d81.vercel.app
image

Needed Additions

Additional notes:

  • I have not made this work on mobile yet. I figure I'll do so later and instead make sure it looks good on just desktop for now.
  • Latest News / Blogs section doesn't have content fetching
  • We will wait for event page in later pr
  • Event section not included (and won't be until the events page is merged due to borrowing components)

Copy link
Member

@spotandjake spotandjake left a comment

Choose a reason for hiding this comment

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

I know your still working just some feedback on current implementation. Feel free todo things differently if you would like, just some notes on how we can make thigns a bit more templated and re-usable for later.

components/SectionHeader.tsx Outdated Show resolved Hide resolved
components/SectionHeader.tsx Outdated Show resolved Hide resolved
config.d.ts Outdated Show resolved Hide resolved
components/AboutUs.tsx Outdated Show resolved Hide resolved
tailwind.config.ts Outdated Show resolved Hide resolved
@Kara-Zor-El Kara-Zor-El changed the title Create Home Page Feat(HomePage): Create Home Page Jul 21, 2024
@Kara-Zor-El Kara-Zor-El marked this pull request as ready for review July 23, 2024 05:27
@Kara-Zor-El Kara-Zor-El marked this pull request as draft July 23, 2024 05:27
@Kara-Zor-El Kara-Zor-El marked this pull request as ready for review July 23, 2024 17:49
@Kara-Zor-El Kara-Zor-El requested a review from spotandjake July 26, 2024 04:43
Copy link
Member

@spotandjake spotandjake left a comment

Choose a reason for hiding this comment

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

Things mostly look great, I left a few comments just about best practice going forward and the advantages which we can talk about furthur at a later date, a few things are just adding comments, and then a few are just small style changes. Everything mostly looks great, great work Kara.

components/Button.tsx Outdated Show resolved Hide resolved
components/Button.tsx Outdated Show resolved Hide resolved
components/Button.tsx Show resolved Hide resolved
components/Button.tsx Outdated Show resolved Hide resolved
config.d.ts Show resolved Hide resolved
styles/layouts/LatestNews.module.scss Outdated Show resolved Hide resolved
styles/layouts/LatestNews.module.scss Outdated Show resolved Hide resolved
styles/layouts/SectionHeader.module.scss Outdated Show resolved Hide resolved
styles/layouts/SectionHeader.module.scss Show resolved Hide resolved
styles/layouts/TextSection.module.scss Outdated Show resolved Hide resolved
@Kara-Zor-El
Copy link
Contributor Author

Closes #6

@Kara-Zor-El Kara-Zor-El linked an issue Aug 6, 2024 that may be closed by this pull request
Copy link
Member

@spotandjake spotandjake left a comment

Choose a reason for hiding this comment

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

Alright a few final nits but once those are fixed, you have my approval I don't think I need to rereview unless you want me to. Great work on the config driven homepage.

}) => {
const classes = `${className} ${type} ${styles.button}`;
const content = label || children;
if (props.image) {
Copy link
Member

Choose a reason for hiding this comment

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

one refactor here which will make things better for maintence make this:

const content = <>
  {(props.image == undefined ? <></> : <div className={styles.imageWrapper}>
        <Image src={props.image.src} alt={props.image.altText} fill={true} />
      </div>)}
      {props.label == undefined ??<></> : (<span className={styles.buttonText}>{props.label}</span>)}
</>

}) => {
const classes = `${className} ${type} ${styles.button}`;
const content = label || children;
if (props.image) {
return (
Copy link
Member

Choose a reason for hiding this comment

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

Then we can get rid of the route this.

)}
</Link>
);
}

return href ? (
Copy link
Member

Choose a reason for hiding this comment

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

and we can just pass the content in down here :) which means one point of maintence.

config.d.ts Outdated
email: string;
tagline: string;
footer: Footer;
HomeSection: HomeSection;
Copy link
Member

Choose a reason for hiding this comment

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

why is there a homeSection and a homeSections? and why is the capitalization different for this one?

const formatDate = (date: Date): string => {
const day = date.getDate();

const getDaySuffix = (day: number): string => {
Copy link
Member

Choose a reason for hiding this comment

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

is there no toLocale that outputs this right? Maybe check out the moment time library from npm it might have what we want. This approach isn't the best for localization imo, which is why i think a time library might be better.

If you can't find something suitable we can keep this logic so maybe only spend like 15 mins looking into moment or the default localization api's

(typeof TextSectionStyle)[keyof typeof TextSectionStyle];

interface SectionProps {
sectionConfig: typeof HomeSection;
Copy link
Member

Choose a reason for hiding this comment

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

Hmms, You might need to make a types.ts and import the types in config.d.ts from there, I don't like how you have to say typeof HomeSection here im pretty sure it means something different. Can you just verify this is a strict typecheck, and if not make that change.

index: number;
}

const getStyle = (index: number) => {
Copy link
Member

Choose a reason for hiding this comment

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

this looks great.

const { sectionStyle, location, newsSectionStyle, textSectionStyle } =
getStyle(index);

let content: React.ReactNode;
Copy link
Member

Choose a reason for hiding this comment

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

can we break this out into a getContent function, this would avoid the mutability, which is a good practice and honestly makes the code a lot better. also can we use a switch statement instead of if statements.

// Internal Components
import NavBar from '../components/NavBar';
import EventBanner from '../components/EventBanner';
import HeroBanner from '../components/HeroBanner';
import Footer from '../components/Footer';
import Section from '../layouts/Section';
Copy link
Member

Choose a reason for hiding this comment

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

I think we should rename this to HomeSection jus tso we dont run into any naming issues between our section and the html version.

- Refactor code in button
- Remove unnecessary section
- Better exports
- Use Moment.js for timezone
- change name of Section to HomeSection
- unnecessary keyof typeof stuff removed
@Kara-Zor-El Kara-Zor-El merged commit 78ce949 into main Aug 7, 2024
1 check passed
@Kara-Zor-El Kara-Zor-El deleted the KaraZorEl-HomePage branch August 7, 2024 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HomePage
3 participants