-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: places categorization #368
Conversation
Pull Request Test Coverage Report for Build 6460577292
💛 - Coveralls |
src/entities/Place/types.ts
Outdated
@@ -44,6 +40,8 @@ export type AggregatePlaceAttributes = PlaceAttributes & { | |||
user_count?: number | |||
user_visits?: number | |||
realms_detail?: Realm[] | |||
category_id?: string | |||
category_ids?: string[] |
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.
why both?
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.
because a query can return a category_id, another query can get all the place's categories.
src/pages/places.tsx
Outdated
}, | ||
[params, track] | ||
) | ||
function handleCategorySelection(action: "add", categoryId: string): void |
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.
All this behavior could be encapsulated inside a component CampaignFilters
where you only listen the changed with eventHandler
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.
CampaignFilters 🤔 - too much rewards sever?
src/pages/places.tsx
Outdated
let target = location.pathname | ||
const params = newParams.toString() | ||
target += params ? "?" + params : "" | ||
navigate(target) |
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.
All URL manipulation should be isolated in src/modules/locaitons.ts
use this as reference: https://github.com/decentraland/events/blob/master/src/modules/locations.ts#L46
src/pages/places.tsx
Outdated
<Grid.Column tablet={4}> | ||
<CategoriesList | ||
onSelect={(categoryId) => | ||
handleCategorySelection("add", categoryId) |
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 pattern is no use anywhere else, try reusing already-defined patterns
7d0db2a
to
4e27fad
Compare
2c1340b
to
5f67014
Compare
* Revert "Revert "feat: places categorization (#368)" (#378)" This reverts commit 192ae9c. * refactor: several components from category * fix: CategoryFilters sort * fix: migration based on base_position * fix: some modal & styles fixes * feat: accept onClick within props * fix: move previous active to manager * fix: compute categories update --------- Co-authored-by: Braian Mellor <[email protected]> Co-authored-by: lauti7 <[email protected]>
This PR:
Visual Changes: