Skip to content

Commit

Permalink
[UI] Update quest warning copy (#941)
Browse files Browse the repository at this point in the history
* update copy

* run i18n

* bump version

* update copy
  • Loading branch information
BrettCleary authored Jul 16, 2024
1 parent f61d5d5 commit 3664857
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hyperplay",
"version": "0.15.3",
"version": "0.16.0",
"private": true,
"main": "build/main/main.js",
"homepage": "./",
Expand Down
9 changes: 9 additions & 0 deletions public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -656,14 +656,23 @@
"needMoreAchievements": "You need to have completed {{percent}}% of the achievements in one of these games.",
"Play": "Play",
"playstreak": "Play Streak",
"points": "Points",
"quests": "Quests",
"readyForClaim": "Ready for claim",
"reputation": "Reputation",
"reward": "Reward",
"rewards": "Rewards",
"signIn": "Sign in",
"sync": "Sync",
"View Game": "View Game"
},
"quests": {
"playstreak": {
"signInWarning": {
"client": "You are currently not logged in, play streak progress will not be tracked. Please login to HyperPlay via the top-right dropdown to track progress.",
"overlay": "You are currently not logged in, play streak progress will not be tracked. Please exit the game and login to HyperPlay via the top-right dropdown to track progress."
}
},
"quests": "Quests"
},
"queue": {
Expand Down
7 changes: 6 additions & 1 deletion src/frontend/components/UI/QuestsViewer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { QuestLogWrapper } from './components/QuestLogWrapper'
import { QuestDetailsWrapper } from './components/QuestDetailsWrapper'
import { Alert } from '@hyperplay/ui'
import useAuthSession from 'frontend/hooks/useAuthSession'
import { useTranslation } from 'react-i18next'

export interface QuestsViewerProps {
projectId: string
Expand All @@ -12,13 +13,17 @@ export interface QuestsViewerProps {
export function QuestsViewer({ projectId: appName }: QuestsViewerProps) {
const [selectedQuestId, setSelectedQuestId] = useState<number | null>(null)
const { isSignedIn } = useAuthSession()
const { t } = useTranslation()

let alertComponent = null
if (!isSignedIn) {
alertComponent = (
<Alert
className={styles.alert}
message="Be sure to log into HyperPlay to maintain your play streak progress."
message={t(
'quests.playstreak.signInWarning.overlay',
'You are currently not logged in, play streak progress will not be tracked. Please exit the game and login to HyperPlay via the top-right dropdown to track progress.'
)}
variant="warning"
/>
)
Expand Down
7 changes: 6 additions & 1 deletion src/frontend/screens/Quests/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ import styles from './index.module.scss'
import { Alert, Background } from '@hyperplay/ui'
import classNames from 'classnames'
import useAuthSession from 'frontend/hooks/useAuthSession'
import { useTranslation } from 'react-i18next'

export function QuestsPage() {
const [selectedQuestId, setSelectedQuestId] = useState<number | null>(null)
const { isSignedIn } = useAuthSession()
const { t } = useTranslation()

let alertComponent = null
const showAlert = !isSignedIn
Expand All @@ -18,7 +20,10 @@ export function QuestsPage() {
alertComponent = (
<Alert
className={styles.alert}
message="Be sure to log into HyperPlay to maintain your play streak progress."
message={t(
'quests.playstreak.signInWarning.client',
'You are currently not logged in, play streak progress will not be tracked. Please login to HyperPlay via the top-right dropdown to track progress.'
)}
variant="warning"
/>
)
Expand Down

0 comments on commit 3664857

Please sign in to comment.