I was searching for a way to reduce the image size so that the homepage would load more quickly and in the process I found a package to crop images. I added it so now we have the ability to crop and select a main image and keep a reduced sized version (300px wide). I set the aspect ratio to be fixed at 5/3 so that the posts on the main page will look more uniform. I think it’s an improvement but let me know what you think! Happy to make changes.
Here is a summary of the other updates I made:
Added check to see if user is logged in before presenting the NewPost component
Raised the posts state to the App.js level so that they aren’t re-fetched when changing routes. (So going to postDetail and clicking back recalls the posts immediately)
Changed the alert positioning in the post collection so that it is always visible.
Updated the schedule component to match the pattern of the edit posts modal Barney made in PostDetail. (There’s a “Waiting” message while the fetch request is pending)
Refactored new post component to include a separate image upload modal view.
Incorporated the react-easy-crop library to allow selecting main images, cropping, and resizing main images
Improved the posts front end display.
Changed date type from string to Date
Added a mainImage field to the posts modal
Added get more posts button to the postsCollection component to do paging.
Sort posts order by date when presenting on the main page.
Let me know if you spot any bugs or anything. I’ll posted a short video demo in slack. Thanks!
Hi all,
I think this is ready to be merged.
I was searching for a way to reduce the image size so that the homepage would load more quickly and in the process I found a package to crop images. I added it so now we have the ability to crop and select a main image and keep a reduced sized version (300px wide). I set the aspect ratio to be fixed at 5/3 so that the posts on the main page will look more uniform. I think it’s an improvement but let me know what you think! Happy to make changes.
Here is a summary of the other updates I made:
Let me know if you spot any bugs or anything. I’ll posted a short video demo in slack. Thanks!