mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 10:42:08 +00:00
format: format codebase to prettier schema
This commit is contained in:
@@ -19,7 +19,7 @@ const Security: FunctionComponent = () => {
|
||||
});
|
||||
|
||||
const onSubmit: SubmitHandler<z.infer<typeof UpdatePasswordSchema>> = async (data) => {
|
||||
await sendUpdatePasswordRequest(data)
|
||||
await sendUpdatePasswordRequest(data);
|
||||
|
||||
reset();
|
||||
};
|
||||
|
||||
@@ -67,8 +67,8 @@ const BeerPostCommentsSection: FC<BeerPostCommentsSectionProps> = ({ beerPost })
|
||||
|
||||
{
|
||||
/**
|
||||
* If the comments are loading, show a loading component. Otherwise, show
|
||||
* the comments.
|
||||
* If the comments are loading, show a loading component. Otherwise, show the
|
||||
* comments.
|
||||
*/
|
||||
isLoading ? (
|
||||
<div className="card bg-base-300 pb-6">
|
||||
|
||||
@@ -19,8 +19,8 @@ const BeerRecommendationsSection: FC<{
|
||||
|
||||
const { ref: penultimateBeerPostRef } = useInView({
|
||||
/**
|
||||
* When the last beer post comes into view, call setSize from
|
||||
* useBeerPostsByBrewery to load more beer posts.
|
||||
* When the last beer post comes into view, call setSize from useBeerPostsByBrewery to
|
||||
* load more beer posts.
|
||||
*/
|
||||
onChange: (visible) => {
|
||||
if (!visible || isAtEnd) return;
|
||||
@@ -46,9 +46,8 @@ const BeerRecommendationsSection: FC<{
|
||||
const isPenultimateBeerPost = index === beerPosts.length - 2;
|
||||
|
||||
/**
|
||||
* Attach a ref to the second last beer post in the list.
|
||||
* When it comes into view, the component will call
|
||||
* setSize to load more beer posts.
|
||||
* Attach a ref to the second last beer post in the list. When it comes
|
||||
* into view, the component will call setSize to load more beer posts.
|
||||
*/
|
||||
|
||||
return (
|
||||
@@ -86,8 +85,8 @@ const BeerRecommendationsSection: FC<{
|
||||
|
||||
{
|
||||
/**
|
||||
* If there are more beer posts to load, show a loading component
|
||||
* with a skeleton loader and a loading spinner.
|
||||
* If there are more beer posts to load, show a loading component with a
|
||||
* skeleton loader and a loading spinner.
|
||||
*/
|
||||
!!isLoadingMore && !isAtEnd && (
|
||||
<BeerRecommendationLoadingComponent length={PAGE_SIZE} />
|
||||
|
||||
@@ -22,8 +22,8 @@ const BreweryBeersSection: FC<BreweryCommentsSectionProps> = ({ breweryPost }) =
|
||||
});
|
||||
const { ref: penultimateBeerPostRef } = useInView({
|
||||
/**
|
||||
* When the last beer post comes into view, call setSize from
|
||||
* useBeerPostsByBrewery to load more beer posts.
|
||||
* When the last beer post comes into view, call setSize from useBeerPostsByBrewery to
|
||||
* load more beer posts.
|
||||
*/
|
||||
onChange: (visible) => {
|
||||
if (!visible || isAtEnd) return;
|
||||
@@ -60,9 +60,8 @@ const BreweryBeersSection: FC<BreweryCommentsSectionProps> = ({ breweryPost }) =
|
||||
const isPenultimateBeerPost = index === beerPosts.length - 2;
|
||||
|
||||
/**
|
||||
* Attach a ref to the second last beer post in the list.
|
||||
* When it comes into view, the component will call
|
||||
* setSize to load more beer posts.
|
||||
* Attach a ref to the second last beer post in the list. When it comes
|
||||
* into view, the component will call setSize to load more beer posts.
|
||||
*/
|
||||
|
||||
return (
|
||||
@@ -91,8 +90,8 @@ const BreweryBeersSection: FC<BreweryCommentsSectionProps> = ({ breweryPost }) =
|
||||
|
||||
{
|
||||
/**
|
||||
* If there are more beer posts to load, show a loading component
|
||||
* with a skeleton loader and a loading spinner.
|
||||
* If there are more beer posts to load, show a loading component with a
|
||||
* skeleton loader and a loading spinner.
|
||||
*/
|
||||
!!isLoadingMore && !isAtEnd && (
|
||||
<BeerRecommendationLoadingComponent length={PAGE_SIZE} />
|
||||
|
||||
@@ -68,9 +68,8 @@ const CommentsComponent: FC<CommentsComponentProps> = ({
|
||||
const isLastComment = index === comments.length - 1;
|
||||
|
||||
/**
|
||||
* Attach a ref to the last comment in the list. When it comes
|
||||
* into view, the component will call setSize to load more
|
||||
* comments.
|
||||
* Attach a ref to the last comment in the list. When it comes into view, the
|
||||
* component will call setSize to load more comments.
|
||||
*/
|
||||
return (
|
||||
<div
|
||||
@@ -89,17 +88,16 @@ const CommentsComponent: FC<CommentsComponentProps> = ({
|
||||
|
||||
{
|
||||
/**
|
||||
* If there are more comments to load, show a loading component
|
||||
* with a skeleton loader and a loading spinner.
|
||||
* If there are more comments to load, show a loading component with a
|
||||
* skeleton loader and a loading spinner.
|
||||
*/
|
||||
!!isLoadingMore && <LoadingComponent length={pageSize} />
|
||||
}
|
||||
|
||||
{
|
||||
/**
|
||||
* If the user has scrolled to the end of the comments, show a
|
||||
* button that will scroll them back to the top of the comments
|
||||
* section.
|
||||
* If the user has scrolled to the end of the comments, show a button that
|
||||
* will scroll them back to the top of the comments section.
|
||||
*/
|
||||
!!isAtEnd && (
|
||||
<div className="flex h-20 items-center justify-center text-center">
|
||||
|
||||
@@ -18,9 +18,8 @@ import { useState, useEffect } from 'react';
|
||||
*/
|
||||
const useMediaQuery = (query: `(${string})`) => {
|
||||
/**
|
||||
* Initialize the matches state variable to false. This is updated whenever the
|
||||
* viewport size changes (i.e. when the component is mounted and when the window is
|
||||
* resized)
|
||||
* Initialize the matches state variable to false. This is updated whenever the viewport
|
||||
* size changes (i.e. when the component is mounted and when the window is resized)
|
||||
*/
|
||||
const [matches, setMatches] = useState(false);
|
||||
|
||||
@@ -35,8 +34,8 @@ const useMediaQuery = (query: `(${string})`) => {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a resize event listener to the window object, and update the `matches`
|
||||
* state variable whenever the viewport size changes.
|
||||
* Add a resize event listener to the window object, and update the `matches` state
|
||||
* variable whenever the viewport size changes.
|
||||
*/
|
||||
const listener = () => setMatches(media.matches);
|
||||
window.addEventListener('resize', listener);
|
||||
|
||||
Reference in New Issue
Block a user