Skip to content

Commit 9fbeac5

Browse files
authored
Fix/game settings UI (#1330)
* fix(games-settings): remove title from games settings section to prevent duplication * feat(tools): replace button elements with Button component * fix(settings): update title translation * fix(infoBox): standardize line-height and align text with variables
1 parent 0fdc160 commit 9fbeac5

File tree

6 files changed

+27
-25
lines changed

6 files changed

+27
-25
lines changed

public/locales/en/translation.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,6 @@
10511051
"copyToClipboard": "Copy All Settings to Clipboard",
10521052
"default_alert_message": "Changes in this section only apply as default values when installing games. If you want to change the settings of an already installed game, use the Settings button in the game page.",
10531053
"default_alert_title": "Default Settings",
1054-
"default_title": "Games Settings",
10551054
"eacRuntime": {
10561055
"gameModeRequired": {
10571056
"message": "GameMode is required for the EAC runtime to work on Flatpak. Do you want to enable it now?",

src/frontend/components/UI/InfoBox/index.css

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
width: 100%;
44
padding: var(--space-sm) var(--space-lg);
55
font-size: var(--text-md);
6-
line-height: 19px;
6+
line-height: var(--space-md);
77
background-color: var(--input-background);
88
border-radius: 10px;
99
text-align: start;
1010
}
1111

1212
.helpLink {
13+
display: flex;
1314
margin-block-start: var(--space-3xs);
1415
transition: 500ms;
1516
color: var(--accent);
1617
cursor: pointer;
17-
display: flex;
18-
height: 40px;
18+
height: var(--space-2lg);
1919
position: relative;
2020
align-items: center;
2121
min-width: 45px;
@@ -27,11 +27,14 @@
2727
}
2828

2929
.helpLink > svg {
30+
width: var(--space-xs);
3031
margin-inline-end: var(--space-3xs);
3132
}
3233

3334
.infoBox > ul {
34-
text-align: left;
35+
display: flex;
36+
text-align: center;
37+
align-items: center;
3538
}
3639

3740
.infoBox > strong {

src/frontend/screens/Settings/components/Tools/index.scss

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
.toolsWrapper {
22
display: flex;
33
cursor: pointer;
4-
justify-content: space-between;
5-
width: 430px;
4+
justify-content: flex-start;
65
max-width: fit-content;
7-
8-
.button {
9-
padding-block: var(--space-lg);
10-
margin: 0 var(--space-3xs);
11-
}
6+
gap: var(--space-md);
127

138
.drag {
149
font-family: var(--font-secondary-regular);

src/frontend/screens/Settings/components/Tools/index.tsx

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { getGameInfo } from 'frontend/helpers'
99
import { ProgressDialog } from 'frontend/components/UI/ProgressDialog'
1010
import SettingsContext from '../../SettingsContext'
1111
import ContextProvider from 'frontend/state/ContextProvider'
12+
import { Button } from '@hyperplay/ui'
1213

1314
export default function Tools() {
1415
const { t } = useTranslation()
@@ -112,34 +113,40 @@ export default function Tools() {
112113
/>
113114
)}
114115
<div className="toolsWrapper">
115-
<button
116+
<Button
116117
data-testid="wineCFG"
117-
className={classNames('button outline', { active: winecfgRunning })}
118+
className={classNames('buttonOutline', { active: winecfgRunning })}
118119
onClick={async () => callTools('winecfg')}
120+
type="secondary"
121+
size="medium"
119122
>
120123
<span className="toolTitle">Winecfg</span>
121-
</button>
122-
<button
124+
</Button>
125+
<Button
123126
data-testid="wineTricks"
124-
className={classNames('button outline', {
127+
className={classNames('buttonOutline', {
125128
active: winetricksRunning
126129
})}
127130
onClick={async () => callTools('winetricks')}
131+
type="secondary"
132+
size="medium"
128133
>
129134
<span className="toolTitle">Winetricks</span>
130-
</button>
131-
<a
135+
</Button>
136+
<Button
132137
onDrop={(ev) => {
133138
dropHandler(ev)
134139
}}
135140
onDragOver={(ev) => dragOverHandler(ev)}
136-
className="button outline drag"
141+
className="buttonOutlineDrag"
137142
onClick={handleRunExe}
143+
type="tertiary"
144+
size="medium"
138145
>
139146
{t('setting.runexe.title')}
140147
<br />
141148
<span>{t('setting.runexe.message')}</span>
142-
</a>
149+
</Button>
143150
</div>
144151
</div>
145152
</>

src/frontend/screens/Settings/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ function Settings() {
113113
</Tabs.Tab>
114114
<Tabs.Tab value="gamesSettings">
115115
<div className="menu">
116-
{t('settings.gamesSettings', 'Games Settings')}
116+
{t('settings.gamesSettings', 'Game Settings')}
117117
</div>
118118
</Tabs.Tab>
119119
<Tabs.Tab value="advSettings">

src/frontend/screens/Settings/sections/GamesSettings/index.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@ export default function GamesSettings() {
7272

7373
return (
7474
<>
75-
<div className={styles.gameSettingsTitle}>
76-
{t('settings.default_title', 'Games Settings')}
77-
</div>
75+
<div className={styles.gameSettingsTitle}></div>
7876
{isDefault && (
7977
<AlertCard
8078
variant="warning"

0 commit comments

Comments
 (0)