Closed bryanlundberg closed 12 months ago
Hi I am interested in working on this
Sure, go ahead you can start @idrak888
Could you point me to the right file for this. Not sure where the 'new record message' is currently handled/rendered
Actually it is not rendered, doesn't exist in the app. That's the mission, create a good place to insert the text message.
If you mean where is the logic launched after doing a best time. hooks/useTimerStatistics
Doing like this you can get the overall record calculation from selected cube category.
const { global } = useTimerStatistics()
From hooks/useTimerStore const { lastSolve } = useTimerStore() This one has the last resolution details including time.
Finally in the place you want render the message make a boolean
global.best === lastSolve.time
If true message will be "congratulations...etc"
I have decided that HeaderTimer.tsx, right under the scramble display, would be a suitable place for the text. I did as you said and utilized the useTimerStore() and useTimerStatistics() to conditionally render the time like so:
Made a PR too
I will review it there, thanks!
we can improve the record alert including a legend.