add mp with icons and update after review
This commit is contained in:
@@ -20,7 +20,7 @@ export const initialState: GorodarState = {
|
||||
firstName: 'Иван',
|
||||
lastName: 'Иванов',
|
||||
city: 'Нижний Новгород',
|
||||
email: 'ivan.ivanovich@gorodar.app',
|
||||
email: '',
|
||||
phone: '+7 900 123-45-67',
|
||||
joinedLabel: 'Сентябрь 2026',
|
||||
},
|
||||
@@ -28,46 +28,58 @@ export const initialState: GorodarState = {
|
||||
|
||||
const gorodarReducer = createReducer(
|
||||
initialState,
|
||||
on(GorodarActions.photoCaptured, (state, { landmarkId, photo }): GorodarState => ({
|
||||
...state,
|
||||
claim: {
|
||||
landmarkId,
|
||||
photo,
|
||||
stage: 'check',
|
||||
step: 1,
|
||||
},
|
||||
})),
|
||||
on(GorodarActions.claimStepChanged, (state, { step }): GorodarState => ({
|
||||
...state,
|
||||
claim: {
|
||||
...state.claim,
|
||||
step,
|
||||
},
|
||||
})),
|
||||
on(GorodarActions.claimCompleted, (state, { landmarkId, photo, collectedAt }): GorodarState => ({
|
||||
...state,
|
||||
collectedIds: state.collectedIds.includes(landmarkId)
|
||||
? state.collectedIds
|
||||
: [...state.collectedIds, landmarkId],
|
||||
photos: {
|
||||
...state.photos,
|
||||
[landmarkId]: photo,
|
||||
},
|
||||
collectedAt: {
|
||||
...state.collectedAt,
|
||||
[landmarkId]: collectedAt,
|
||||
},
|
||||
claim: {
|
||||
landmarkId,
|
||||
photo,
|
||||
stage: 'success',
|
||||
step: 3,
|
||||
},
|
||||
})),
|
||||
on(GorodarActions.claimReset, (state): GorodarState => ({
|
||||
...state,
|
||||
claim: initialClaim,
|
||||
})),
|
||||
on(
|
||||
GorodarActions.photoCaptured,
|
||||
(state, { landmarkId, photo }): GorodarState => ({
|
||||
...state,
|
||||
claim: {
|
||||
landmarkId,
|
||||
photo,
|
||||
stage: 'check',
|
||||
step: 1,
|
||||
},
|
||||
}),
|
||||
),
|
||||
on(
|
||||
GorodarActions.claimStepChanged,
|
||||
(state, { step }): GorodarState => ({
|
||||
...state,
|
||||
claim: {
|
||||
...state.claim,
|
||||
step,
|
||||
},
|
||||
}),
|
||||
),
|
||||
on(
|
||||
GorodarActions.claimCompleted,
|
||||
(state, { landmarkId, photo, collectedAt }): GorodarState => ({
|
||||
...state,
|
||||
collectedIds: state.collectedIds.includes(landmarkId)
|
||||
? state.collectedIds
|
||||
: [...state.collectedIds, landmarkId],
|
||||
photos: {
|
||||
...state.photos,
|
||||
[landmarkId]: photo,
|
||||
},
|
||||
collectedAt: {
|
||||
...state.collectedAt,
|
||||
[landmarkId]: collectedAt,
|
||||
},
|
||||
claim: {
|
||||
landmarkId,
|
||||
photo,
|
||||
stage: 'success',
|
||||
step: 3,
|
||||
},
|
||||
}),
|
||||
),
|
||||
on(
|
||||
GorodarActions.claimReset,
|
||||
(state): GorodarState => ({
|
||||
...state,
|
||||
claim: initialClaim,
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
export const gorodarFeature = createFeature({
|
||||
|
||||
Reference in New Issue
Block a user