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

updated branch with hooks of pack screens #399

Open
wants to merge 21 commits into
base: andrew_testing
Choose a base branch
from

Conversation

owaisanwar
Copy link
Collaborator

No description provided.

@render
Copy link

render bot commented Sep 28, 2023


export default function HomeLayout() {
const queryClient = new QueryClient()
Copy link
Owner

Choose a reason for hiding this comment

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

we should move this to to its own TrpcQueryProvider context just for cleaner code

@render
Copy link

render bot commented Sep 28, 2023

Your Render PR Server at https://packrat-dev-pr-399.onrender.com is now live!

View it on your dashboard at https://dashboard.render.com/web/srv-ckadcfugtj9c738tibg0.


export const useAddNewPack = () => {
// console.log(obj);
const mutation = queryTrpc.addPack.useMutation();
Copy link
Owner

Choose a reason for hiding this comment

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

is this standard naming practice for react query custom hooks? genuine question i'm not sure

Copy link
Owner

Choose a reason for hiding this comment

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

We should at the very least be destructuring isLoading and error from the react query responses. To make it more like the redux store

let isLoading = true;
switch (feedType) {
case 'public':
const publicPacks = queryTrpc.getPublicPacks.useQuery({ queryBy:queryString ? queryString: 'Favorite' }, {
Copy link
Owner

Choose a reason for hiding this comment

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

We should at the very least be destructuring isLoading and error from the react query responses. To make it more like the redux store

@@ -28,7 +28,7 @@ export const AddPack = () => {
const error = useSelector((state) => state.packs.error);

const isError = error !== null;

const { mutation } = useAddNewPack()
Copy link
Owner

Choose a reason for hiding this comment

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

naming convention

Copy link
Owner

@andrew-bierman andrew-bierman left a comment

Choose a reason for hiding this comment

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

overall good just clarifying a few things

@andrew-bierman
Copy link
Owner

Uncaught Error
publicTrips.map is not a function

refetchOnWindowFocus: false,
keepPreviousData: true,
});
const isOwner = data && user && data.owner_id === user._id;
Copy link
Owner

Choose a reason for hiding this comment

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

user is undefined here, maybe we should use our matches current user hook for this ?

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