forked from decentraland/marketplace
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: persistent try on (decentraland#576)
* feat: use first fashion pose * feat: make state persistent * fix: remove bodyShape * chore: analytics * fix: only enable try on if has representation
- Loading branch information
Showing
9 changed files
with
103 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { action } from 'typesafe-actions' | ||
|
||
export const SET_IS_TRYING_ON = 'Set is trying on' | ||
export const setIsTryingOn = (value: boolean) => | ||
action(SET_IS_TRYING_ON, { value }) | ||
export type SetIsTryingOnAction = ReturnType<typeof setIsTryingOn> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { SetIsTryingOnAction, SET_IS_TRYING_ON } from './actions' | ||
|
||
export type PreviewState = { | ||
isTryingOn: boolean | ||
} | ||
|
||
const INITIAL_STATE: PreviewState = { | ||
isTryingOn: false | ||
} | ||
|
||
type PreviewReducerAction = SetIsTryingOnAction | ||
|
||
export function previewReducer( | ||
state = INITIAL_STATE, | ||
action: PreviewReducerAction | ||
): PreviewState { | ||
switch (action.type) { | ||
case SET_IS_TRYING_ON: { | ||
return { | ||
...state, | ||
isTryingOn: action.payload.value | ||
} | ||
} | ||
default: | ||
return state | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { RootState } from '../../reducer' | ||
|
||
export const getState = (state: RootState) => state.ui.preview | ||
export const getIsTryingOn = (state: RootState) => getState(state).isTryingOn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters