Skip to content

Conversation

@ruarim
Copy link
Owner

@ruarim ruarim commented Feb 24, 2023

This PR is doing a few things

-Plans can now be saved to DB.

  • The plans pages have been refactored so there is now an index page which links out to the pages related to paths.
    The current pages are...
  • Plan - Create a new plan.
  • View - Will show all of a users plans.
  • Explore - will show all created plan with some kind of filter system.
  • Random - Will show a random plan.
    So far only the plans page has been implemented.

-Refactored the header so the login dropdown in the mobile nav works.

-Error handling has been added to the login and register forms.

Kapture.2023-02-24.at.16.48.20.mp4

@ruarim ruarim added the enhancement New feature or request label Feb 24, 2023
@ruarim ruarim requested a review from Sam-Archie February 24, 2023 16:43
@ruarim ruarim self-assigned this Feb 24, 2023
leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
>
<Dialog.Panel className="relative transform overflow-hidden rounded-lg bg-gray-200 px-4 pt-5 pb-4 text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg sm:p-6">
{typeof title === "string" && (
Copy link
Collaborator

Choose a reason for hiding this comment

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

create a typeguard for this something like:

const isString = (value: unkown): value is string => typeof value === 'string'

Copy link
Owner Author

Choose a reason for hiding this comment

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

Is this necessary if it's only being used once here, I can understand if there was repeated use.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think as this thing grows it would be useful to have some utility functions, especially if you might want to use this as a project to show someone but can keep it as is for now if you like.

className={clsx(
"flex justify-center text-red-400",
venuesPath.includes(venue.name) && "text-blue-400"
venuesPath.includes(venue) && "text-blue-400"
Copy link
Collaborator

Choose a reason for hiding this comment

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

you could add another guard here something like this:

const isNullish = (value: unknown): value is null | undefined => {
  return value === null || value === undefined;
}

Copy link
Owner Author

Choose a reason for hiding this comment

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

Would be good to talk through this guarding idea it at some point.

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok sounds good.

Copy link
Collaborator

@Sam-Archie Sam-Archie left a comment

Choose a reason for hiding this comment

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

Have a look at getting that modal working just using state props, I should be around for a bit to help out with this if needs be.

It would also be good to get some test coverage. Again happy to start working on that.

@ruarim ruarim requested a review from Sam-Archie February 26, 2023 18:56
@ruarim ruarim merged commit 12e9ec2 into main Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants