Skip to content

[UI/UX] Pre-release Fixes #1956

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

Merged
merged 9 commits into from
Oct 29, 2022
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ You can alternatively download the file ending in .rpm from the [latest release]

#### Other Distributions (AppImage and TAR.XZ)

Since these two distribution formats don't have a form of dependency management, make sure the `curl` and `gawk` commands are available. You might run into weird issues if they aren't.
Since these two distribution formats don't have a form of dependency management, make sure the `curl` commands is available. You might run into weird issues if not.

##### AppImage

Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,21 +103,18 @@
"deb": {
"packageCategory": "games",
"depends": [
"gawk",
"curl"
]
},
"pacman": {
"packageCategory": "games",
"depends": [
"gawk",
"curl"
]
},
"rpm": {
"packageCategory": "games",
"depends": [
"gawk",
"curl"
]
}
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/components/UI/ActionIcons/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default function ActionIcons({
>
<FontAwesomeIcon
className="FormControl__segmentedFaIcon"
icon={faBorderAll}
icon={faList}
/>
</button>
) : (
Expand All @@ -86,7 +86,7 @@ export default function ActionIcons({
>
<FontAwesomeIcon
className="FormControl__segmentedFaIcon"
icon={faList}
icon={faBorderAll}
/>
</button>
)}
Expand Down
1 change: 1 addition & 0 deletions src/frontend/components/UI/Header/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
grid-area: filters;
display: flex;
align-self: center;
justify-self: flex-end;
}

.Header__filters .FormControl {
Expand Down
5 changes: 5 additions & 0 deletions src/frontend/components/UI/PlatformFilter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ export default function PlatformFilter() {

const isMac = platform === 'darwin'
const isLinux = platform === 'linux'
const isWindows = platform === 'win32'
const disabledIcon = isLinux && category === 'legendary'

if (isWindows) {
return null
}

return (
<div className="platformFilters">
<FormControl segmented>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ export default function SidebarLinks() {
const location = useLocation() as { pathname: string }
const [, , runner, appName, type] = location.pathname.split('/') as PathSplit

const { epic, gog, platform, activeController } = useContext(ContextProvider)
const { epic, gog, platform, activeController, refreshLibrary } =
useContext(ContextProvider)

const isStore = location.pathname.includes('store')
const isSettings = location.pathname.includes('settings')
Expand Down Expand Up @@ -117,6 +118,9 @@ export default function SidebarLinks() {
classNames('Sidebar__item', { active: isActive })
}
to={'/'}
onClick={async () =>
refreshLibrary({ runInBackground: false, fullRefresh: true })
}
>
<>
<div className="Sidebar__itemIcon">
Expand Down
45 changes: 26 additions & 19 deletions src/frontend/components/UI/StoreFilter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ import FormControl from 'frontend/components/UI/FormControl'
import ContextProvider from 'frontend/state/ContextProvider'

export default function StoreFilter() {
const { category, handleCategory } = useContext(ContextProvider)
const { category, handleCategory, gog, epic } = useContext(ContextProvider)
const { t } = useTranslation()

const isGOGLoggedin = gog.username
const isEpicLoggedin = epic.username

return (
<div className="storeFilter">
<FormControl segmented small>
Expand All @@ -20,24 +23,28 @@ export default function StoreFilter() {
>
{t('All').toUpperCase()}
</button>
<button
className={classNames('FormControl__button', {
active: category === 'legendary'
})}
title={`${t('header.store')}: ${t('store')}`}
onClick={() => handleCategory('legendary')}
>
EPIC
</button>
<button
className={classNames('FormControl__button', {
active: category === 'gog'
})}
title={`${t('header.store')}: ${t('GOG')}`}
onClick={() => handleCategory('gog')}
>
GOG
</button>
{isEpicLoggedin && (
<button
className={classNames('FormControl__button', {
active: category === 'legendary'
})}
title={`${t('header.store')}: ${t('store')}`}
onClick={() => handleCategory('legendary')}
>
EPIC
</button>
)}
{isGOGLoggedin && (
<button
className={classNames('FormControl__button', {
active: category === 'gog'
})}
title={`${t('header.store')}: ${t('GOG')}`}
onClick={() => handleCategory('gog')}
>
GOG
</button>
)}
<button
className={classNames('FormControl__button', {
active: category === 'sideload'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,22 @@ export default function SideloadDialog({
setWine()
}, [title])

useEffect(() => {
setTimeout(async () => {
try {
const res = await fetch(
`https://steamgrid.usebottles.com/api/search/${title}`
)
if (res.status === 200) {
const steamGridImage = (await res.json()) as string
setImageUrl(steamGridImage)
}
} catch (error) {
console.log('Error when getting image from SteamGridDB')
}
}, 2000)
}, [title])

async function handleInstall(): Promise<void> {
window.api.addNewApp({
runner: 'sideload',
Expand Down
19 changes: 12 additions & 7 deletions src/frontend/screens/Login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const epicLoginPath = '/loginweb/legendary'
export const gogLoginPath = '/loginweb/gog'

export default function NewLogin() {
const { epic, gog } = useContext(ContextProvider)
const { epic, gog, refreshLibrary } = useContext(ContextProvider)
const { t } = useTranslation()
const navigate = useNavigate()
const [loading, setLoading] = useState(true)
Expand All @@ -39,6 +39,11 @@ export default function NewLogin() {
setIsGogLoggedIn(Boolean(gog.username))
}, [epic.username, gog.username, t])

async function handleLibraryClick() {
await refreshLibrary({ fullRefresh: true, runInBackground: false })
navigate('/')
}

return (
<div className="loginPage">
{loading && (
Expand Down Expand Up @@ -96,12 +101,12 @@ export default function NewLogin() {
/>
</div>
</div>

{(epic.username || gog.username) && (
<button onClick={() => navigate('/')} className="goToLibrary">
{t('button.go_to_library', 'Go to Library')}
</button>
)}
<button
onClick={async () => handleLibraryClick()}
className="goToLibrary"
>
{t('button.go_to_library', 'Go to Library')}
</button>
</div>
</div>
)
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/screens/WebView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default function WebView() {

setTimeout(() => {
webview.findInPage('authorizationCode')
}, 500)
}, 50)
webview.addEventListener('found-in-page', async () => {
webview.focus()
webview.selectAll()
Expand All @@ -125,7 +125,7 @@ export default function WebView() {
console.error(error)
window.api.logError(String(error))
}
}, 500)
}, 200)
})
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/state/GlobalState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ export class GlobalState extends PureComponent<Props> {
}

handleSuccessfulLogin = (runner: Runner) => {
this.handleCategory(runner)
this.handleCategory('all')
this.refreshLibrary({
fullRefresh: true,
runInBackground: false,
Expand Down