-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Web App] Select target recommendations are taken from the backend / …
…Components structure - refactor (#996) * Select target recommendations are taken from the backend / components structure refactor * RewardStore: rewardFromResource functionaliti applied to getRecommendedRewards request response - cover image urls issue resolved * functionality to minimize target reward thumbnail on 'get inspire' button click - added * unnecessary functionality - removed * SelectTargetRewardPage: 'Want something different?' block - added * SelectTargetRewardContainer: refactor
- Loading branch information
Showing
43 changed files
with
362 additions
and
256 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
6 changes: 0 additions & 6 deletions
6
packages/web-app/src/modules/reward-views/RewardFilterContainer.tsx
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
export * from '../../storefront-views/pages/StorefrontHomePage/RewardSearchBar/RewardSearchBar' | ||
export * from './RewardDescriptionPanel' | ||
export * from './RewardDisclaimers' | ||
export * from './RewardHeaderBar' | ||
export * from './RewardHowToPanel' | ||
export * from './RewardImageCarousel' | ||
export * from './RewardInfoPanel' | ||
export * from './RewardRequirementsPanel' | ||
export * from './RewardSearchBar' | ||
export * from './RewardSlider' |
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 |
---|---|---|
@@ -1,4 +1,2 @@ | ||
export * from './RewardDetailsContainer' | ||
export * from './RewardSearchBarContainer' | ||
export * from './RewardSearchResultContainer' | ||
export * from './SelectTargetRewardContainer' | ||
export * from './RewardDetailsContainer' |
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
2 changes: 2 additions & 0 deletions
2
packages/web-app/src/modules/reward-views/pages/RewardDetailsPage/index.ts
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,2 @@ | ||
export * from './RewardDetailsPage'; | ||
|
171 changes: 0 additions & 171 deletions
171
packages/web-app/src/modules/reward-views/pages/SelectTargetRewardPage.tsx
This file was deleted.
Oops, something went wrong.
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
File renamed without changes.
48 changes: 48 additions & 0 deletions
48
...web-app/src/modules/reward-views/pages/SelectTargetRewardPage/RewardsList/RewardsList.tsx
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,48 @@ | ||
import type { FunctionComponent } from 'react' | ||
import { useState } from 'react' | ||
import type { WithStyles } from 'react-jss' | ||
import withStyles from 'react-jss' | ||
import type { Reward } from '../../../../reward/models' | ||
import { RewardCard } from './RewardCard' | ||
|
||
export const styles = { | ||
rewards: { | ||
display: 'flex', | ||
gap: '32px', | ||
alignItems: 'stretch', | ||
maxWidth: 655, | ||
flexWrap: 'wrap', | ||
paddingBottom: '40px', | ||
}, | ||
} | ||
|
||
interface Props extends WithStyles<typeof styles> { | ||
rewards: Reward[] | ||
onConfirmTargetReward: (reward: Reward) => void | ||
} | ||
|
||
const visibleRewardsAmount = 6 | ||
|
||
const _RewardsList: FunctionComponent<Props> = ({ classes, rewards, onConfirmTargetReward }) => { | ||
const [selectedRewardId, setSelectedRewardId] = useState<string | null>(null) | ||
|
||
const selectTargetReward = (rewardId: string) => { | ||
setSelectedRewardId(rewardId) | ||
} | ||
|
||
return ( | ||
<div className={classes.rewards}> | ||
{rewards.slice(0, visibleRewardsAmount).map((reward) => ( | ||
<RewardCard | ||
key={reward.id} | ||
reward={reward} | ||
isSelected={selectedRewardId === reward.id} | ||
onSelectReward={selectTargetReward} | ||
onConfirmReward={onConfirmTargetReward} | ||
/> | ||
))} | ||
</div> | ||
) | ||
} | ||
|
||
export const RewardsList = withStyles(styles)(_RewardsList) |
2 changes: 2 additions & 0 deletions
2
packages/web-app/src/modules/reward-views/pages/SelectTargetRewardPage/RewardsList/index.ts
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,2 @@ | ||
export * from './RewardsList'; | ||
|
Oops, something went wrong.