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: add initiatives page #107

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

feat: add initiatives page #107

wants to merge 13 commits into from

Conversation

georgimld
Copy link
Contributor

@georgimld georgimld commented Oct 15, 2024

Todos:

  • add page for initiatives
  • chose a design -> used a ProjectCard similar to landing page
  • infinite scrolling
  • filtering based on search term -> graph ql query to look for the search string in all project properties
  • improve design -> avoided layout shifts, shift around the size of the cards and the descriptions
  • MobileNewsFeedFilter refactoring -> created a combined component MobileFilterDrawer, used for the initiatives page and the news page
  • Skeleton Refactoring -> create new Skeleton for ProjectCards
  • useEffect in filtering refactoring -> removed the useEffect from ProjectFilter.tsx

To check:

  • innitiatives page (check infinite scrolling, filtering, wide screen & mobile views)
  • check that the proejctCard looks good on the landing page (mobile & wide screen), i modified the card quite a bit
  • check the filtering also on the mobine view of the news page (updated some components)
  • check for layout shifts (except the known issue Layout shift of VisibleContributors in ProjectCards #115)

Closes #56

@georgimld georgimld self-assigned this Oct 15, 2024
@georgimld georgimld changed the title feat: add first draft of initiatives page feat: add initiatives page Oct 15, 2024
@pecirep pecirep mentioned this pull request Oct 29, 2024
@georgimld georgimld marked this pull request as ready for review October 30, 2024 14:54
app/app/projects/page.tsx Outdated Show resolved Hide resolved
app/components/common/project/ProjectCard.tsx Outdated Show resolved Hide resolved
app/components/common/skeletons/CardSkeleton.tsx Outdated Show resolved Hide resolved
app/components/common/MobileFilterDrawer.tsx Show resolved Hide resolved
app/components/common/MobileFilterDrawer.tsx Show resolved Hide resolved
app/components/common/MobileFilterDrawer.tsx Show resolved Hide resolved
Copy link
Collaborator

@pecirep pecirep left a comment

Choose a reason for hiding this comment

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

The page content is not padded equally from the left and right side of the screen. This can probably be fixed by applying flex spacing styles on the container.

Copy link
Collaborator

@pecirep pecirep left a comment

Choose a reason for hiding this comment

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

The Project Card skeleton doesn't match the Project Cards in layout, being wider and using different margins and corner radii. It doesn't cause a significant layout shift because the height is the same, but it would still be a less noticable transition when typing in searches if the positions of the elements inside matched.

This is the main reason I had all the skeleton components inside the ProjectCard. It did require checking loading state in a lot of places but it allowed me to match the style exactly without hassle and duplicating css. I think you are still correct in asking me to change that, but IMO we should approach the cards differently. If we have a more generic card component with well defined styles that we populate with slots, we can reuse it for both the project card and the project skeleton card without copy-pasting CSS and still only check loading state in one place.

Copy link
Collaborator

@pecirep pecirep left a comment

Choose a reason for hiding this comment

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

I've noticed a lot of components using pixel margins, paddings and sizes and I think we should try to avoid that going forward and use EM and REM instead. https://www.w3schools.com/cssref/css_units.php
There's a few places where I have already done this for this PR and I can submit them either here on a separate branch, whichever you prefer

Copy link
Collaborator

@pecirep pecirep left a comment

Choose a reason for hiding this comment

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

These changes seem to break the project carousel on the landing page in the mobile view, it's missing the gaps between the cards.

setHasMore(result.length >= pageSize);
} catch (error) {
errorMessage({ message: 'Error refetching projects. Please check your connection and try again.' });
console.error('Error refetching projects:', error);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

replace this with logger.error

const projects = response.projects?.data.map(mapToBasicProject) ?? [];
return projects;
} catch (err) {
console.info(err);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

replace this with logger.error()

Copy link
Contributor Author

@georgimld georgimld left a comment

Choose a reason for hiding this comment

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

Make sure to also fix the linting prpoblems, so the lint and build pass

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.

Implement separate page for initiatives
2 participants