Skip to content

Commit

Permalink
Xp boost (#846)
Browse files Browse the repository at this point in the history
Resolves #844

### What

We want to have 1.2 XP boost for the final week.

- add XP boost label to the countdown
- calculate new XP amount


![image](https://github.com/tahowallet/dapp/assets/20949277/9b18c142-8aa1-4ac7-a3fa-d45ed3337b66)![image](https://github.com/tahowallet/dapp/assets/20949277/9d7f41ac-ce87-482c-9781-a06ea04162f7)
  • Loading branch information
xpaczka authored Dec 7, 2023
2 parents 45668f4 + da07b6c commit 4aed06e
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 9 deletions.
61 changes: 61 additions & 0 deletions src/shared/assets/icons/xp-boost.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import {
getRadialGradientFromRealmColor,
separateThousandsByComma,
} from "shared/utils"
import { WEEKLY_XP_ALLOCATION, getRealmMapData } from "shared/constants"
import {
WEEKLY_XP_ALLOCATION,
WEEKLY_XP_BOOST,
getRealmMapData,
} from "shared/constants"
import { RealmData } from "shared/types"
import RealmDetailsSection from "./RealmDetailsSection"

Expand Down Expand Up @@ -54,7 +58,8 @@ export default function RealmDetailsHeader({
/>
<span className="label_value">
{separateThousandsByComma(
/* realm.xpAllocatable || */ WEEKLY_XP_ALLOCATION,
/* realm.xpAllocatable || */ WEEKLY_XP_ALLOCATION *
WEEKLY_XP_BOOST,
0
)}{" "}
XP
Expand Down
25 changes: 18 additions & 7 deletions src/shared/components/RealmPanel/RealmPanelCountdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import {
useDappSelector,
} from "redux-state"
import { getNextSelectedWeekDay, getTimeRemaining } from "shared/utils"
import xpBoostIcon from "shared/assets/icons/xp-boost.svg"
import Icon from "../Icon"

export default function RealmPanelCountdown() {
const seasonWeek = useDappSelector(selectSeasonWeek)
Expand All @@ -19,14 +21,23 @@ export default function RealmPanelCountdown() {

return (
<>
<div className="countdown">
<div className="week">
Week {seasonWeek}{" "}
<span style={{ fontSize: 16, color: "var(--secondary-s1-50)" }}>
/ {seasonDuration}
</span>
<div className="countdown row">
<Icon
type="image"
src={xpBoostIcon}
width="125px"
height="64px"
style={{ marginTop: "10px" }}
/>
<div className="column">
<div className="week">
Week {seasonWeek}{" "}
<span style={{ fontSize: 16, color: "var(--secondary-s1-50)" }}>
/ {seasonDuration}
</span>
</div>
<div className="time_remaining">{timeRemaining}</div>
</div>
<div className="time_remaining">{timeRemaining}</div>
</div>
<style jsx>{`
.countdown {
Expand Down
1 change: 1 addition & 0 deletions src/shared/constants/game.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const WEEKLY_XP_ALLOCATION = 1_000_000
export const WEEKLY_XP_BOOST = 1.2
export const MOBILE_BREAKPOINT = 854
export const TABLET_BREAKPOINT = 1152
export const XP_COMING_SOON_TEXT = "XP Drop coming soon"

0 comments on commit 4aed06e

Please sign in to comment.