Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UX] Show 'import game' hint/instructions in 'add game' dialog #3940

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions public/locales/en/gamepage.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@
"field": {
"title": "Title"
},
"import-hint": {
"content": "Do NOT use this feature for that.<1></1>Instead, <3>log into</3> the store, look for the game in your library, open the installation dialog, and click the &quot;Import Game&quot; button",
"title": "Important! Are you adding a game from Epic/GOG/Amazon? Click here!"
},
"info": {
"broser": "BrowserURL",
"exe": "Select Executable",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
CachedImage,
TextInputField,
PathSelectionBox,
ToggleSwitch
ToggleSwitch,
InfoBox
} from 'frontend/components/UI'
import { DialogContent, DialogFooter } from 'frontend/components/UI/Dialog'
import {
Expand All @@ -17,12 +18,13 @@ import {
writeConfig
} from 'frontend/helpers'
import React, { useContext, useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { Trans, useTranslation } from 'react-i18next'
import { AvailablePlatforms } from '..'
import fallbackImage from 'frontend/assets/heroic_card.jpg'
import ContextProvider from 'frontend/state/ContextProvider'
import classNames from 'classnames'
import axios from 'axios'
import { NavLink } from 'react-router-dom'

type Props = {
availablePlatforms: AvailablePlatforms
Expand All @@ -47,7 +49,7 @@ export default function SideloadDialog({
children,
appName
}: Props) {
const { t } = useTranslation('gamepage')
const { t, i18n } = useTranslation('gamepage')
const [title, setTitle] = useState<string | never>(
t('sideload.field.title', 'Title')
)
Expand Down Expand Up @@ -291,6 +293,22 @@ export default function SideloadDialog({
</span>
</div>
<div className="sideloadForm">
<InfoBox
text={t(
'sideload.import-hint.title',
'Important! Are you adding a game from Epic/GOG/Amazon? Click here!'
)}
>
<div className="sideloadImportHint">
<Trans i18n={i18n} key="sideload.import-hint.content">
Do NOT use this feature for that.
<br />
Instead, <NavLink to={'/login'}>log into</NavLink> the store,
look for the game in your library, open the installation
dialog, and click the &quot;Import Game&quot; button
</Trans>
</div>
</InfoBox>
<TextInputField
label={t('sideload.info.title', 'Game/App Title')}
placeholder={t(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,9 @@
.sideloadForm {
padding-inline-start: var(--space-xs);
}

.sideloadImportHint {
a {
text-decoration: underline;
}
}
Loading