-
Notifications
You must be signed in to change notification settings - Fork 479
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
MazeThumbnail
React component and Storybook entry
#15692
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks great! I love seeing code move out of maze.js and into more isolated components.
It does seem a little funky for the start and finish coords to live on subtype but be exclusively controlled by maze; I'd love to (perhaps as another PR) see more of that code moved down to the subtype level.
Maze.start_ = {x: x, y: y}; | ||
Maze.finish_ = {x: x, y: y}; | ||
Maze.subtype.start = {x: x, y: y}; | ||
Maze.subtype.finish = {x: x, y: y}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given that start and finish have been moved to subtype, could this also be moved there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's definitely more refactoring to do but I'm tempted to save it for a future PR!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 54bfd79.
Extract maze
drawMap
to a separate file, and re-use it to render aMazeThumbnail
React component. Only one skin is currently supported. The thumbnail doesn't (yet) show the start or finish icons.