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

draft: added character input #3

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

Conversation

Momen-Mawad
Copy link

This PR adds an input element to allow the user inputting a character name, which will change the title of the page to that character name as well.

image

Copy link

vercel bot commented Jan 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
aeternum-tracker ❌ Failed (Inspect) Jul 11, 2024 0:48am

Copy link
Owner

@lmachens lmachens left a comment

Choose a reason for hiding this comment

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

Thx for your pull request 👍.
I don't think it's very useful to have the character name input without doing something with it (except changing the title).
It would be a good feature if you can track the activities for multiple of your characters.

Example:
I have two characters and play with my main character first. I track some progress for my main character and sign in to my second character in-game.
Then, I like to track the progress for this character too, but the aeternum-tracker is still showing the progress for my main.
In this case, I need to be able to select (and add/edit/remove) characters, which have their own activity progress.

return (
<header className="fixed left-0 top-0 z-50 flex w-full justify-center border-b bg-gradient-to-b py-2 backdrop-blur-2xl border-neutral-800 bg-zinc-800/30 from-inherit">
<div className="container mx-auto flex items-center gap-2">
<p className="text-lg md:text-2xl font-extrabold tracking-tight grow whitespace-nowrap">
Aeternum Tracker
</p>

<input
Copy link
Owner

Choose a reason for hiding this comment

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

There is a Input component which is already styled. See https://github.com/lmachens/aeternum-tracker/blob/main/components/ui/input.tsx

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for pointing that out.

@Momen-Mawad
Copy link
Author

Thx for your pull request 👍. I don't think it's very useful to have the character name input without doing something with it (except changing the title). It would be a good feature if you can track the activities for multiple of your characters.

Example: I have two characters and play with my main character first. I track some progress for my main character and sign in to my second character in-game. Then, I like to track the progress for this character too, but the aeternum-tracker is still showing the progress for my main. In this case, I need to be able to select (and add/edit/remove) characters, which have their own activity progress.

Yes, that's a good point. I need to figure out first how can the tracker call the data of a character.

@Momen-Mawad
Copy link
Author

@lmachens I see that aeternum-tracker does not have a feature for character login. Would it be a good idea to implement a similar code from aeternum-map for login? Or is there a better approach for tracking multiple characters?

@lmachens
Copy link
Owner

@lmachens I see that aeternum-tracker does not have a feature for character login. Would it be a good idea to implement a similar code from aeternum-map for login? Or is there a better approach for tracking multiple characters?

It's enough to have a simple input to enter and maintain the character name by yourself and save it in the local storage (you can use the persistent zustand store which is used to persist the activities).

I would not implement anything which involves a login or server side action.

@Momen-Mawad
Copy link
Author

@lmachens I see that aeternum-tracker does not have a feature for character login. Would it be a good idea to implement a similar code from aeternum-map for login? Or is there a better approach for tracking multiple characters?

It's enough to have a simple input to enter and maintain the character name by yourself and save it in the local storage (you can use the persistent zustand store which is used to persist the activities).

I would not implement anything which involves a login or server side action.

@lmachens so the workflow would be:

  • A user enters a character name and presses Enter (for example).
  • aeternum-tracker will fill the lists according to the inputted name.
  • The retrieved data are only going to be saved locally within the browser.
  • If the user deletes the cached data of the browser, they will lose all entered values in aeternum-tracker.

@lmachens
Copy link
Owner

@lmachens I see that aeternum-tracker does not have a feature for character login. Would it be a good idea to implement a similar code from aeternum-map for login? Or is there a better approach for tracking multiple characters?

It's enough to have a simple input to enter and maintain the character name by yourself and save it in the local storage (you can use the persistent zustand store which is used to persist the activities).
I would not implement anything which involves a login or server side action.

@lmachens so the workflow would be:

  • A user enters a character name and presses Enter (for example).
  • aeternum-tracker will fill the lists according to the inputted name.
  • The retrieved data are only going to be saved locally within the browser.
  • If the user deletes the cached data of the browser, they will lose all entered values in aeternum-tracker.

Yes. You can try out how it works now. You can complete or reset the activities and create and maintain custom activities.
It's stored in the local storage.
If you find out how this works, it might be easier to extend the functionality by adding a character, which has their own activity progress.

@Momen-Mawad
Copy link
Author

Work is still in progress. I am reading more about the library "zustand" and how to use it.

@Momen-Mawad Momen-Mawad changed the title added character input draft: added character input Feb 2, 2024
@Momen-Mawad
Copy link
Author

Currently, facing an error when updating a store:

const marioStore = useCharacterStore('Mario');
marioStore.setProgress("Mutated Dungeons", 6);
[zustand persist middleware] Unable to update item 'Mario-activities-storage', the given storage is currently unavailable.

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