-
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.
- Loading branch information
Showing
7 changed files
with
190 additions
and
1 deletion.
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
10 changes: 10 additions & 0 deletions
10
packages/web-app/src/modules/achievements-views/AchievementPageContainer.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,10 @@ | ||
import { connect } from '../../connect' | ||
import type { RootStore } from '../../Store' | ||
import { AchievementPage } from './components/AchievementPage' | ||
|
||
const mapStoreToProps = (_store: RootStore): any => ({ | ||
// TODD: add store mapping | ||
// Example: unclaimedBonuses: store.bonuses.unclaimedBonuses, | ||
}) | ||
|
||
export const AchievementPageContainer = connect(mapStoreToProps, AchievementPage) |
Binary file added
BIN
+37.9 KB
packages/web-app/src/modules/achievements-views/assets/Achievement.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
104 changes: 104 additions & 0 deletions
104
packages/web-app/src/modules/achievements-views/components/AchievementCard.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,104 @@ | ||
import classNames from 'classnames' | ||
import type CSS from 'csstype' | ||
import { Img } from 'react-image' | ||
import type { WithStyles } from 'react-jss' | ||
import withStyles from 'react-jss' | ||
import Skeleton from 'react-loading-skeleton' | ||
import type { SaladTheme } from '../../../SaladTheme' | ||
|
||
const styles: (theme: SaladTheme) => Record<string, CSS.Properties> = (theme: SaladTheme) => ({ | ||
achievementCardWrapper: { | ||
width: '346px', | ||
height: '179px', | ||
position: 'relative', | ||
opacity: 0.35, | ||
backgroundColor: theme.darkBlue, | ||
}, | ||
achievementCardWrapperAchieved: { | ||
opacity: 1, | ||
}, | ||
achievementImage: { | ||
position: 'relative', | ||
width: '155px', | ||
height: '155px', | ||
}, | ||
achievementTitle: { | ||
fontFamily: theme.fontMallory, | ||
fontSize: theme.medium, | ||
fontWeight: 700, | ||
color: theme.green, | ||
margin: 0, | ||
}, | ||
achievementDescription: { | ||
fontFamily: theme.fontMallory, | ||
fontSize: theme.medium, | ||
color: theme.lightGreen, | ||
width: '155px', | ||
margin: 0, | ||
}, | ||
achievementContent: { | ||
position: 'absolute', | ||
top: '43px', | ||
left: '68px', | ||
width: '278px', | ||
height: '86px', | ||
padding: '24px', | ||
boxSizing: 'border-box', | ||
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'flex-end', | ||
justifyContent: 'center', | ||
gap: '8px', | ||
flexShrink: 0, | ||
borderRadius: '4px', | ||
border: '1px solid rgba(234, 236, 239, 0.5) ', | ||
background: | ||
'linear-gradient(187deg, rgba(252, 252, 252, 0.06) -32.65%, rgba(252, 252, 252, 0.01) 33.12%, rgba(252, 252, 252, 0.06) 56.13%, rgba(252, 252, 252, 0.12) 99.63%)', | ||
boxShadow: | ||
'16px 8px 73px 0px rgba(252, 252, 252, 0.05), 34px 34px 50px 0px rgba(0, 0, 0, 0.10), -8px -6px 80px 0px rgba(252, 252, 252, 0.05) inset', | ||
backdropFilter: 'blur(17.5px)', | ||
}, | ||
|
||
achievementDate: { | ||
fontFamily: theme.fontMallory, | ||
fontSize: theme.small, | ||
position: 'absolute', | ||
right: 0, | ||
top: '140px', | ||
color: '#859099', | ||
textAlign: 'right', | ||
margin: 0, | ||
}, | ||
}) | ||
|
||
interface Props extends WithStyles<typeof styles> { | ||
imageUrl: string | ||
title: string | ||
description: string | ||
isAchieved: boolean | ||
dateAchieved?: string | ||
} | ||
|
||
const _AchievementCard = ({ title, imageUrl, description, isAchieved, dateAchieved, classes }: Props) => { | ||
return ( | ||
<div | ||
className={classNames(classes.achievementCardWrapper, isAchieved && classes.achievementCardWrapperAchieved)} | ||
aria-label={title} | ||
> | ||
<p className={classes.achievementTitle}>{title}</p> | ||
<div className={classes.achievementContent}> | ||
<p className={classes.achievementDescription}>{description}</p> | ||
</div> | ||
<Img | ||
className={classes.achievementImage} | ||
src={imageUrl} | ||
draggable={false} | ||
alt={title} | ||
loader={<Skeleton height={'100%'} />} | ||
/> | ||
{dateAchieved && <p className={classes.achievementDate}>{dateAchieved}</p>} | ||
</div> | ||
) | ||
} | ||
|
||
export const AchievementCard = withStyles(styles)(_AchievementCard) |
70 changes: 70 additions & 0 deletions
70
packages/web-app/src/modules/achievements-views/components/AchievementPage.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,70 @@ | ||
import type CSS from 'csstype' | ||
import Scrollbars from 'react-custom-scrollbars' | ||
import type { IntlShape } from 'react-intl' | ||
import { injectIntl } from 'react-intl' | ||
import type { WithStyles } from 'react-jss' | ||
import withStyles from 'react-jss' | ||
import type { SaladTheme } from '../../../SaladTheme' | ||
import { withLogin } from '../../auth-views' | ||
import defaultAchievementImage from '../assets/Achievement.png' | ||
import { AchievementCard } from './AchievementCard' | ||
|
||
const styles: (theme: SaladTheme) => Record<string, CSS.Properties> = (theme: SaladTheme) => ({ | ||
achievementPageWrapper: { | ||
width: '100%', | ||
height: '100%', | ||
padding: '30px', | ||
boxSizing: 'border-box', | ||
}, | ||
achievementPageGrid: { | ||
marginTop: '32px', | ||
width: '100%', | ||
display: 'inline-grid', | ||
gridTemplateColumns: 'repeat(auto-fill, minmax(296px, 4fr))', | ||
gridGap: '50px', | ||
boxSizing: 'border-box', | ||
marginBottom: '96px', | ||
}, | ||
achievementPageHeader: { | ||
margin: 0, | ||
fontFamily: theme.fontGroteskLight09, | ||
color: theme.green, | ||
fontSize: '56px', | ||
fontWeight: 300, | ||
textShadow: '0px 0px 24px rgba(178, 213, 48, 0.7)', | ||
}, | ||
}) | ||
|
||
interface Props extends WithStyles<typeof styles> { | ||
intl: IntlShape | ||
} | ||
|
||
const _AchievementPage = ({ classes }: Props) => { | ||
const achievements = new Array(28).fill({ | ||
title: 'When Chef’s Mix, You Earn Six', | ||
imageUrl: defaultAchievementImage, | ||
description: 'Earn your first $6', | ||
dateAchieved: 'Achieved on Sept 8, 2023', | ||
isAchieved: true, | ||
}) | ||
return ( | ||
<Scrollbars> | ||
<div className={classes.achievementPageWrapper}> | ||
<h2 className={classes.achievementPageHeader}>Achievements</h2> | ||
<div className={classes.achievementPageGrid}> | ||
{achievements.map((achievement) => ( | ||
<AchievementCard | ||
title={achievement.title} | ||
imageUrl={achievement.imageUrl} | ||
description={achievement.description} | ||
dateAchieved={achievement.dateAchieved} | ||
isAchieved={achievement.isAchieved} | ||
/> | ||
))} | ||
</div> | ||
</div> | ||
</Scrollbars> | ||
) | ||
} | ||
|
||
export const AchievementPage = withLogin(withStyles(styles)(injectIntl(_AchievementPage))) |
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 @@ | ||
export * from './AchievementPageContainer' |
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