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

Community Activity Dashboard #135

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

Community Activity Dashboard #135

wants to merge 7 commits into from

Conversation

gxjansen
Copy link
Member

@gxjansen gxjansen commented Nov 1, 2024

Showing community activity on our homepage:

  • Recent / Popular forum posts
  • Past / Upcoming events

@gxjansen gxjansen requested a review from fsmeier November 1, 2024 12:23
Copy link

netlify bot commented Nov 1, 2024

Deploy Preview for spryker-community ready!

Name Link
🔨 Latest commit 7465a30
🔍 Latest deploy log https://app.netlify.com/sites/spryker-community/deploys/674432bbe576220009949941
😎 Deploy Preview https://deploy-preview-135--spryker-community.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@gxjansen
Copy link
Member Author

gxjansen commented Nov 1, 2024

I've reimplemented the VanillaForumPosts component using Astro Islands architecture, which provides several key improvements:

  1. True Client-Side Hydration:
  • The component is now a React component that gets hydrated on the client side using client:load
  • This means the forum posts will update dynamically without requiring server-side rendering
  • The rest of the page remains static, following the Islands Architecture pattern
  1. Better State Management:
  • Uses React's useState and useEffect hooks for proper state management
  • Handles loading and error states more effectively
  • Provides a smoother user experience with loading indicators
  1. Component Organization:
  • Split into smaller, more maintainable components (DiscussionCard)
  • Clear separation of concerns between data fetching and presentation
  • TypeScript for better type safety and developer experience
  1. Performance Benefits:
  • Only this component is hydrated with JavaScript, while the rest of the page remains static
  • Data fetching happens on the client side, reducing server load
  • Loading states provide better user feedback
  • The implementation now follows Astro's Islands Architecture pattern, where this interactive component is isolated while the rest of the page remains static HTML, providing the best balance of interactivity and performance.

@gxjansen gxjansen changed the title Component to show vanilla forum posts Community Activity Dashboard Nov 2, 2024
@gxjansen
Copy link
Member Author

gxjansen commented Nov 7, 2024

Todo with VanillaEvents / VanillaForumPosts:

  • remove console.logs, leave console.error
  • extract individual components: EventCard & DiscussionCard
  • no .tsx files, move all to .astro
  • put components in subfolder
  • rename api/forum folder api/vanilla

review files with double extensions (.json.ts .ico.ts), what is the logic here

src/components/VanillaEvents.astro Outdated Show resolved Hide resolved
src/utils/vanillaApi.ts Outdated Show resolved Hide resolved

export const GET: APIRoute = async () => {
try {
const response = await fetch('https://forum.commercequest.space/api/v2/events', {
Copy link
Contributor

Choose a reason for hiding this comment

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

we should directly filter by upcoming events and by previous events

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.

2 participants