From bc35ed5bac7f7e05c08366a8e7e98984aabe5925 Mon Sep 17 00:00:00 2001 From: Flavio Lima Date: Sun, 10 Apr 2022 13:29:28 +0200 Subject: [PATCH 01/11] fix: colors and sidebar size --- .../UI/Sidebar/components/SidebarLinks/index.css | 10 ++++++++-- src/components/UI/Sidebar/index.css | 11 ++++++++--- src/index.css | 14 +++++++++++--- src/screens/Settings/index.css | 4 ++-- 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/src/components/UI/Sidebar/components/SidebarLinks/index.css b/src/components/UI/Sidebar/components/SidebarLinks/index.css index ba581d2e82..4fd919018d 100644 --- a/src/components/UI/Sidebar/components/SidebarLinks/index.css +++ b/src/components/UI/Sidebar/components/SidebarLinks/index.css @@ -5,16 +5,22 @@ } .Sidebar__item.SidebarLinks__subItem { - padding: 4px var(--sidebar-horizontal-padding) 4px 24px; + padding: 4px var(--sidebar-horizontal-padding) 4px 50px; font-size: 14px; line-height: 20px; white-space: break-spaces; } .Sidebar__item.SidebarLinks__subItem::before { - content: '- '; + content: '• '; } .SidebarLinks__subItem + .Sidebar__item:not(.SidebarLinks__subItem) { margin-top: 4px; } + +@media screen and (max-width: 730px) { + .Sidebar__item.SidebarLinks__subItem { + padding: 4px var(--sidebar-horizontal-padding) 4px 20px; + } +} diff --git a/src/components/UI/Sidebar/index.css b/src/components/UI/Sidebar/index.css index 29cdc308a9..482b51b82b 100644 --- a/src/components/UI/Sidebar/index.css +++ b/src/components/UI/Sidebar/index.css @@ -29,13 +29,13 @@ border: none; background: none; cursor: pointer; - font-size: inherit; - color: inherit; + font-size: 18px; + color: var(--accent); transition: color 250ms; } .Sidebar__item:focus-visible { - outline: 2px solid var(--accent); + outline: 2px solid var(--text-hover); outline-offset: -2px; } @@ -45,6 +45,11 @@ .Sidebar__item.active { color: var(--accent); + font-weight: 700; +} + +.Sidebar__item.active.SidebarLinks__subItem { + background-color: var(--background-lighter); } .Sidebar__itemIcon { diff --git a/src/index.css b/src/index.css index e3af2d8f06..db5d8ff3bb 100644 --- a/src/index.css +++ b/src/index.css @@ -1,6 +1,6 @@ html { /* Colours */ - --navbar-background: #151f3d; + --navbar-background: var(--background); --input-background: #0d0f1c; --body-background: #13172a; --current-background: var(--body-background); @@ -26,11 +26,12 @@ html { --success-hover: #30eca8; --danger-hover: #e43f3f; --icon-disabled: #625e69; - /* Legacy: Don't use it */ + /* Generic colors */ --background: #151f3d; --background-darker: #0d0f1c; --background-darker-80: #0d0f1ce0; --background-secondary: #323035; + --background-lighter: #151f5d; --background-gradient: linear-gradient( 180deg, rgba(0, 0, 0, 0.418) 2.4%, @@ -71,8 +72,9 @@ html { --font-secondary-bold: Cabin normal 500; --font-secondary-regular-italic: Cabin italic 400; --font-secondary-bold-italic: Cabin italic 500; + /* Measurements */ - --sidebar-width: 218px; + --sidebar-width: 240px; --content-width: calc(100vw - var(--sidebar-width)); overflow-y: overlay; /* Effects */ @@ -80,6 +82,12 @@ html { --blur-strong: 16px; } +@media screen and (max-width: 730px) { + * { + --sidebar-width: calc(var(--sidebar-width) - 1em); + } +} + body { margin: 0; font-family: -apple-system, Cabin, BlinkMacSystemFont, 'Segoe UI', 'Roboto', diff --git a/src/screens/Settings/index.css b/src/screens/Settings/index.css index c51c5f3f0a..4f273a607b 100644 --- a/src/screens/Settings/index.css +++ b/src/screens/Settings/index.css @@ -19,10 +19,10 @@ font: var(--font-primary-bold); font-size: 18.5px; line-height: 19px; - color: var(--text-default); } .settingsNavbar > a { + color: var(--accent); margin-block-end: 11px; padding-block: 6px; } @@ -34,7 +34,7 @@ .settingsNavbar > a.active { transition: all 350ms ease-out 0s; transform: scale(1.2); - color: var(--accent); + color: var(--text-default); font-weight: 500; } From 711b7a0856052346ae9e2a00f0f1af370ca51267 Mon Sep 17 00:00:00 2001 From: Flavio Lima Date: Sun, 10 Apr 2022 13:43:46 +0200 Subject: [PATCH 02/11] feat: change on hover on submenus --- src/components/UI/Sidebar/index.css | 4 ++-- src/index.css | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/UI/Sidebar/index.css b/src/components/UI/Sidebar/index.css index 482b51b82b..27aee397db 100644 --- a/src/components/UI/Sidebar/index.css +++ b/src/components/UI/Sidebar/index.css @@ -40,15 +40,15 @@ } .Sidebar__item:hover { - color: var(--text-hover); + background-color: var(--background-lighter); } .Sidebar__item.active { color: var(--accent); - font-weight: 700; } .Sidebar__item.active.SidebarLinks__subItem { + font-weight: 700; background-color: var(--background-lighter); } diff --git a/src/index.css b/src/index.css index db5d8ff3bb..379ed49ed6 100644 --- a/src/index.css +++ b/src/index.css @@ -31,7 +31,7 @@ html { --background-darker: #0d0f1c; --background-darker-80: #0d0f1ce0; --background-secondary: #323035; - --background-lighter: #151f5d; + --background-lighter: #152f6d; --background-gradient: linear-gradient( 180deg, rgba(0, 0, 0, 0.418) 2.4%, From d31117b911e3b3a5c179c326259ecffaa1948d7a Mon Sep 17 00:00:00 2001 From: Flavio Lima Date: Sun, 10 Apr 2022 17:09:58 +0200 Subject: [PATCH 03/11] feat: move settings tabs to navbar --- .../Sidebar/components/SidebarLinks/index.tsx | 139 ++++++++++++++++-- src/screens/Settings/index.css | 32 +--- 2 files changed, 126 insertions(+), 45 deletions(-) diff --git a/src/components/UI/Sidebar/components/SidebarLinks/index.tsx b/src/components/UI/Sidebar/components/SidebarLinks/index.tsx index 1b1e92aa12..0b7c80c42a 100644 --- a/src/components/UI/Sidebar/components/SidebarLinks/index.tsx +++ b/src/components/UI/Sidebar/components/SidebarLinks/index.tsx @@ -13,6 +13,7 @@ import { useTranslation } from 'react-i18next' import { NavLink, useHistory, useLocation } from 'react-router-dom' import { getAppSettings } from 'src/helpers' import ContextProvider from 'src/state/ContextProvider' +import { Runner } from 'src/types' import './index.css' const Store = window.require('electron-store') @@ -23,19 +24,46 @@ const gogStore: ElectronStore = new Store({ cwd: 'gog_store' }) +interface LocationState { + fromGameCard: boolean + hasCloudSave: boolean + runner: Runner + isLinuxNative: boolean + isMacNative: boolean +} + export default function SidebarLinks() { const { t } = useTranslation() const history = useHistory() const [showUnrealMarket, setShowUnrealMarket] = useState(false) + const { state } = useLocation() as { state: LocationState } + const location = useLocation() as { pathname: string } + const [appName, type] = location.pathname + .replaceAll('/settings/', '') + .split('/') - const { category, handleCategory, handleFilter } = useContext(ContextProvider) + const { category, handleCategory, handleFilter, platform } = + useContext(ContextProvider) - const location = useLocation() as { pathname: string } const isLibrary = location.pathname === '/' const isStore = location.pathname.includes('store') + const isSettings = location.pathname.includes('settings') + const isDefaultSetting = location.pathname.startsWith('/settings/default') + + const { + hasCloudSave = false, + isLinuxNative = false, + isMacNative = false + } = state || {} + const isWin = platform === 'win32' + const isLinuxGame = isLinuxNative && platform === 'linux' + const isMacGame = isMacNative && platform === 'darwin' + + const shouldRenderWineSettings = !isWin && !isMacGame && !isLinuxGame + const isEpicLoggedIn = Boolean(configStore.get('userInfo')) const isGOGLoggedIn = Boolean(gogStore.get('credentials')) - const showSidebar = + const showLibrarySubmenu = ((isEpicLoggedIn && isGOGLoggedIn) || (isEpicLoggedIn && showUnrealMarket)) && isLibrary @@ -62,6 +90,8 @@ export default function SidebarLinks() { } }, []) + console.log({ cloudsave: state?.hasCloudSave, appName, type, location }) + return (
- {showSidebar && ( + {showLibrarySubmenu && ( <> {isEpicLoggedIn && ( )} - location.pathname.includes('settings')} - to={{ pathname: '/settings/default/general' }} - > -
- -
- {t('Settings')} -
)} + location.pathname.includes('settings')} + to={{ pathname: '/settings/default/general' }} + > +
+ +
+ {t('Settings')} +
+ {isSettings && ( + <> + {isDefaultSetting && ( + + {t('settings.navbar.general')} + + )} + {shouldRenderWineSettings && ( + + Wine + + )} + {hasCloudSave && ( + + {t('settings.navbar.sync')} + + )} + + {t('settings.navbar.other')} + + {isDefaultSetting && ( + + {t('settings.navbar.advanced', 'Advanced')} + + )} + + {t('settings.navbar.log', 'Log')} + + + )} a { - color: var(--accent); - margin-block-end: 11px; - padding-block: 6px; -} - -.settingsNavbar > a:hover { - color: var(--text-hover); -} - -.settingsNavbar > a.active { - transition: all 350ms ease-out 0s; - transform: scale(1.2); - color: var(--text-default); - font-weight: 500; + margin-block-start: 20px; + padding-left: 48px; } .settingsWrapper { From 4c38aadb8e21baf5a8fbe953e41cdddd38129162 Mon Sep 17 00:00:00 2001 From: Flavio Lima Date: Sun, 10 Apr 2022 17:10:07 +0200 Subject: [PATCH 04/11] feat: create Advanced Settings --- .../Library/components/GameCard/index.tsx | 10 +- src/screens/Library/index.tsx | 2 + .../components/AdvancedSettings/index.tsx | 286 ++++++++++++++++++ .../components/GeneralSettings/index.tsx | 179 +---------- src/screens/Settings/index.tsx | 171 ++--------- 5 files changed, 317 insertions(+), 331 deletions(-) create mode 100644 src/screens/Settings/components/AdvancedSettings/index.tsx diff --git a/src/screens/Library/components/GameCard/index.tsx b/src/screens/Library/components/GameCard/index.tsx index c3827b4285..84f7e7dce1 100644 --- a/src/screens/Library/components/GameCard/index.tsx +++ b/src/screens/Library/components/GameCard/index.tsx @@ -29,6 +29,7 @@ interface Card { cover: string coverList: string hasUpdate: boolean + hasCloudSave: boolean isGame: boolean isInstalled: boolean logo: string @@ -51,6 +52,7 @@ const GameCard = ({ coverList, size = '', hasUpdate, + hasCloudSave, buttonClick, forceCard, isMacNative, @@ -218,7 +220,13 @@ const GameCard = ({ onClick={() => history.push({ pathname: path, - state: { fromGameCard: true, runner } + state: { + fromGameCard: true, + runner, + hasCloudSave, + isLinuxNative, + isMacNative + } }) } > diff --git a/src/screens/Library/index.tsx b/src/screens/Library/index.tsx index aee0db1138..ba19108cde 100644 --- a/src/screens/Library/index.tsx +++ b/src/screens/Library/index.tsx @@ -106,6 +106,7 @@ export const Library = ({ library, showRecentsOnly }: Props) => { is_mac_native, is_linux_native, runner, + cloud_save_enabled, is_game, install: { version, install_size, is_dlc } }: GameInfo) => { @@ -120,6 +121,7 @@ export const Library = ({ library, showRecentsOnly }: Props) => { cover={art_square} coverList={art_cover} logo={art_logo} + hasCloudSave={cloud_save_enabled} title={title} appName={app_name} isInstalled={is_installed} diff --git a/src/screens/Settings/components/AdvancedSettings/index.tsx b/src/screens/Settings/components/AdvancedSettings/index.tsx new file mode 100644 index 0000000000..ab8880495b --- /dev/null +++ b/src/screens/Settings/components/AdvancedSettings/index.tsx @@ -0,0 +1,286 @@ +import { + CreateNewFolder, + Backspace, + CleaningServicesOutlined, + ContentCopyOutlined, + DeleteOutline +} from '@mui/icons-material' +import classNames from 'classnames' +import { IpcRenderer, Clipboard } from 'electron' +import ElectronStore from 'electron-store' +import { useTranslation } from 'react-i18next' +import React, { useContext, useEffect, useState } from 'react' +import { SvgButton } from 'src/components/UI' +import ContextProvider from 'src/state/ContextProvider' +import { AppSettings, Path } from 'src/types' + +interface ElectronProps { + ipcRenderer: IpcRenderer + clipboard: Clipboard +} + +const { ipcRenderer, clipboard } = window.require('electron') as ElectronProps + +interface Props { + altLegendaryBin: string + altGogdlBin: string + setAltLegendaryBin: (value: string) => void + setAltGogdlBin: (value: string) => void + settingsToSave: AppSettings +} + +const Store = window.require('electron-store') +const configStore: ElectronStore = new Store({ + cwd: 'store' +}) + +export const AdvancedSettings = ({ + altLegendaryBin, + altGogdlBin, + setAltLegendaryBin, + setAltGogdlBin, + settingsToSave +}: Props) => { + const [legendaryVersion, setLegendaryVersion] = useState('') + const [gogdlVersion, setGogdlVersion] = useState('') + const [isCopiedToClipboard, setCopiedToClipboard] = useState(false) + const { t } = useTranslation() + + const { isRTL } = useContext(ContextProvider) + + const settings = configStore.get('settings') as { + altLeg: string + altGogdl: string + } + + useEffect(() => { + // set copied to clipboard status to true if it's not already set to true + // used for changing text and color + if (!isCopiedToClipboard) return + + const timer = setTimeout(() => { + setCopiedToClipboard(false) + }, 3000) + + return () => clearTimeout(timer) + }, [isCopiedToClipboard]) + + useEffect(() => { + const getMoreInfo = async () => { + configStore.set('settings', { + ...settings, + altLeg: altLegendaryBin + }) + + const legendaryVer = await ipcRenderer.invoke('getLegendaryVersion') + if (legendaryVer === 'invalid') { + setLegendaryVersion('Invalid') + setTimeout(() => { + setAltLegendaryBin('') + return setLegendaryVersion('') + }, 3000) + } + return setLegendaryVersion(legendaryVer) + } + getMoreInfo() + }, [altLegendaryBin]) + + useEffect(() => { + const getGogdlVersion = async () => { + configStore.set('settings', { + ...settings, + altGogdl: altGogdlBin + }) + const gogdlVersion = await ipcRenderer.invoke('getGogdlVersion') + if (gogdlVersion === 'invalid') { + setGogdlVersion('Invalid') + setTimeout(() => { + setAltGogdlBin('') + return setGogdlVersion('') + }, 3000) + } + return setGogdlVersion(gogdlVersion) + } + + getGogdlVersion() + }, [altGogdlBin]) + + function handleLegendaryBinary() { + return ipcRenderer + .invoke('openDialog', { + buttonLabel: t('box.choose'), + properties: ['openFile'], + title: t( + 'box.choose-legendary-binary', + 'Select Legendary Binary (needs restart)' + ) + }) + .then(({ path }: Path) => setAltLegendaryBin(path ? path : '')) + } + + function handleGogdlBinary() { + return ipcRenderer + .invoke('openDialog', { + buttonLabel: t('box.choose'), + properties: ['openFile'], + title: t( + 'box.choose-gogdl-binary', + 'Select GOGDL Binary (needs restart)' + ) + }) + .then(({ path }: Path) => setAltGogdlBin(path ? path : '')) + } + + return ( +
+ + + {t( + 'setting.alt-legendary-bin', + 'Choose an Alternative Legendary Binary (needs restart)to use' + )} + + + setAltLegendaryBin(event.target.value)} + /> + {!altLegendaryBin.length ? ( + handleLegendaryBinary()} + className="material-icons settings folder" + > + + + ) : ( + setAltLegendaryBin('')} + > + + + )} + + + {t('other.legendary-version', 'Legendary Version: ')} + {legendaryVersion} + + + + + {t( + 'setting.alt-gogdl-bin', + 'Choose an Alternative GOGDL Binary to use (needs restart)' + )} + + + setAltGogdlBin(event.target.value)} + /> + {!altGogdlBin.length ? ( + handleGogdlBinary()} + className="material-icons settings folder" + > + + + ) : ( + setAltGogdlBin('')} + > + + + )} + + + {t('other.gogdl-version', 'GOGDL Version: ')} + {gogdlVersion} + + +
+ + + + +
+
+ ) +} diff --git a/src/screens/Settings/components/GeneralSettings/index.tsx b/src/screens/Settings/components/GeneralSettings/index.tsx index 49612fbdc7..d1a5413388 100644 --- a/src/screens/Settings/components/GeneralSettings/index.tsx +++ b/src/screens/Settings/components/GeneralSettings/index.tsx @@ -6,7 +6,6 @@ import ContextProvider from 'src/state/ContextProvider' import { InfoBox, SvgButton } from 'src/components/UI' import LanguageSelector from 'src/components/UI/LanguageSelector' import ToggleSwitch from 'src/components/UI/ToggleSwitch' -import ElectronStore from 'electron-store' import classNames from 'classnames' import { IpcRenderer } from 'electron' @@ -16,16 +15,10 @@ import CreateNewFolder from '@mui/icons-material/CreateNewFolder' const { ipcRenderer } = window.require('electron') as { ipcRenderer: IpcRenderer } -const Store = window.require('electron-store') -const configStore: ElectronStore = new Store({ - cwd: 'store' -}) const storage: Storage = window.localStorage interface Props { - altLegendaryBin: string - altGogdlBin: string checkForUpdatesOnStartup: boolean darkTrayIcon: boolean defaultInstallPath: string @@ -40,8 +33,6 @@ interface Props { setEgsLinkedPath: (value: string) => void setEgsPath: (value: string) => void setLanguage: (value: string) => void - setAltLegendaryBin: (value: string) => void - setAltGogdlBin: (value: string) => void setMaxWorkers: (value: number) => void startInTray: boolean toggleDarkTrayIcon: () => void @@ -58,10 +49,6 @@ export default function GeneralSettings({ egsPath, checkForUpdatesOnStartup, setEgsPath, - altLegendaryBin, - setAltLegendaryBin, - altGogdlBin, - setAltGogdlBin, egsLinkedPath, setEgsLinkedPath, showUnrealMarket, @@ -82,18 +69,11 @@ export default function GeneralSettings({ }: Props) { const [isSyncing, setIsSyncing] = useState(false) const [maxCpus, setMaxCpus] = useState(maxWorkers) - const [legendaryVersion, setLegendaryVersion] = useState('') - const [gogdlVersion, setGogdlVersion] = useState('') const { platform, refreshLibrary, isRTL } = useContext(ContextProvider) const { t, i18n } = useTranslation() const isLinked = Boolean(egsLinkedPath.length) const isWindows = platform === 'win32' - const settings = configStore.get('settings') as { - altLeg: string - altGogdl: string - } - useEffect(() => { i18n.changeLanguage(language) storage.setItem('language', language) @@ -102,45 +82,10 @@ export default function GeneralSettings({ useEffect(() => { const getMoreInfo = async () => { const cores = await ipcRenderer.invoke('getMaxCpus') - configStore.set('settings', { - ...settings, - altLeg: altLegendaryBin - }) - setMaxCpus(cores) - - const legendaryVer = await ipcRenderer.invoke('getLegendaryVersion') - if (legendaryVer === 'invalid') { - setLegendaryVersion('Invalid') - setTimeout(() => { - setAltLegendaryBin('') - return setLegendaryVersion('') - }, 3000) - } - return setLegendaryVersion(legendaryVer) } getMoreInfo() - }, [maxWorkers, altLegendaryBin]) - - useEffect(() => { - const getGogdlVersion = async () => { - configStore.set('settings', { - ...settings, - altGogdl: altGogdlBin - }) - const gogdlVersion = await ipcRenderer.invoke('getGogdlVersion') - if (gogdlVersion === 'invalid') { - setGogdlVersion('Invalid') - setTimeout(() => { - setAltGogdlBin('') - return setGogdlVersion('') - }, 3000) - } - return setGogdlVersion(gogdlVersion) - } - - getGogdlVersion() - }, [altGogdlBin]) + }, [maxWorkers]) async function handleSync() { setIsSyncing(true) @@ -194,32 +139,6 @@ export default function GeneralSettings({ .then(({ path }: Path) => setEgsPath(path ? path : '')) } - function handleLegendaryBinary() { - return ipcRenderer - .invoke('openDialog', { - buttonLabel: t('box.choose'), - properties: ['openFile'], - title: t( - 'box.choose-legendary-binary', - 'Select Legendary Binary (needs restart)' - ) - }) - .then(({ path }: Path) => setAltLegendaryBin(path ? path : '')) - } - - function handleGogdlBinary() { - return ipcRenderer - .invoke('openDialog', { - buttonLabel: t('box.choose'), - properties: ['openFile'], - title: t( - 'box.choose-gogdl-binary', - 'Select GOGDL Binary (needs restart)' - ) - }) - .then(({ path }: Path) => setAltGogdlBin(path ? path : '')) - } - async function handleChangeLanguage(language: string) { ipcRenderer.send('changeLanguage', language) setLanguage(language) @@ -278,102 +197,6 @@ export default function GeneralSettings({ - - - {t( - 'setting.alt-legendary-bin', - 'Choose an Alternative Legendary Binary (needs restart)to use' - )} - - - setAltLegendaryBin(event.target.value)} - /> - {!altLegendaryBin.length ? ( - handleLegendaryBinary()} - className="material-icons settings folder" - > - - - ) : ( - setAltLegendaryBin('')} - > - - - )} - - - {t('other.legendary-version', 'Legendary Version: ')} - {legendaryVersion} - - - - - {t( - 'setting.alt-gogdl-bin', - 'Choose an Alternative GOGDL Binary to use (needs restart)' - )} - - - setAltGogdlBin(event.target.value)} - /> - {!altGogdlBin.length ? ( - handleGogdlBinary()} - className="material-icons settings folder" - > - - - ) : ( - setAltGogdlBin('')} - > - - - )} - - - {t('other.gogdl-version', 'GOGDL Version: ')} - {gogdlVersion} - - {!isWindows && ( diff --git a/src/screens/Settings/index.tsx b/src/screens/Settings/index.tsx index bc6298cae4..ecebb6b8c3 100644 --- a/src/screens/Settings/index.tsx +++ b/src/screens/Settings/index.tsx @@ -1,21 +1,16 @@ import './index.css' import React, { useContext, useEffect, useState } from 'react' -import classNames from 'classnames' import { AppSettings, Runner, WineInstallation } from 'src/types' -import { Clipboard, IpcRenderer } from 'electron' +import { IpcRenderer } from 'electron' import { NavLink, useLocation, useParams } from 'react-router-dom' -import { getGameInfo, getPlatform, writeConfig } from 'src/helpers' +import { getGameInfo, writeConfig } from 'src/helpers' import { useToggle } from 'src/hooks' import { useTranslation } from 'react-i18next' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faWindows, faApple, faLinux } from '@fortawesome/free-brands-svg-icons' -import { - ContentCopyOutlined, - CleaningServicesOutlined, - DeleteOutline -} from '@mui/icons-material' + import ContextProvider from 'src/state/ContextProvider' import UpdateComponent from 'src/components/UI/UpdateComponent' @@ -25,17 +20,17 @@ import SyncSaves from './components/SyncSaves' import Tools from './components/Tools' import WineSettings from './components/WineSettings' import LogSettings from './components/LogSettings' +import { AdvancedSettings } from './components/AdvancedSettings' interface ElectronProps { ipcRenderer: IpcRenderer - clipboard: Clipboard } -const { ipcRenderer, clipboard } = window.require('electron') as ElectronProps +const { ipcRenderer } = window.require('electron') as ElectronProps const storage: Storage = window.localStorage interface RouteParams { appName: string - type: string + type: 'general' | 'wine' | 'other' | 'sync' | 'log' | 'advanced' } interface LocationState { @@ -182,18 +177,12 @@ function Settings() { setOn: setShowUnrealMarket } = useToggle(false) - const [haveCloudSaving, setHaveCloudSaving] = useState({ - cloudSaveEnabled: false, - saveFolder: '' - }) const [autoSyncSaves, setAutoSyncSaves] = useState(false) const [altWine, setAltWine] = useState([] as WineInstallation[]) const [isMacNative, setIsMacNative] = useState(false) const [isLinuxNative, setIsLinuxNative] = useState(false) - const [isCopiedToClipboard, setCopiedToClipboard] = useState(false) - const { appName, type } = useParams() as RouteParams const isDefault = appName === 'default' const isGeneralSettings = type === 'general' @@ -201,6 +190,7 @@ function Settings() { const isSyncSettings = type === 'sync' const isOtherSettings = type === 'other' const isLogSettings = type === 'log' + const isAdvancedSetting = type === 'advanced' && isDefault useEffect(() => { const getSettings = async () => { @@ -255,8 +245,6 @@ function Settings() { setUseSteamRuntime(config.useSteamRuntime || false) if (!isDefault) { const { - cloud_save_enabled: cloudSaveEnabled, - save_folder: saveFolder, title: gameTitle, canRunOffline: can_run_offline, is_mac_native, @@ -264,9 +252,8 @@ function Settings() { } = await getGameInfo(appName, state.runner) setCanRunOffline(can_run_offline) setTitle(gameTitle) - setIsMacNative(is_mac_native && (await getPlatform()) == 'darwin') - setIsLinuxNative(is_linux_native && (await getPlatform()) == 'linux') - return setHaveCloudSaving({ cloudSaveEnabled, saveFolder }) + setIsMacNative(is_mac_native && platform === 'darwin') + return setIsLinuxNative(is_linux_native && platform === 'linux') } return setTitle(t('globalSettings', 'Global Settings')) } @@ -338,7 +325,6 @@ function Settings() { } as AppSettings const settingsToSave = isDefault ? GlobalSettings : GameSettings - const shouldRenderWineSettings = !isWin && !isMacNative && !isLinuxNative let returnPath: string | null = '/' if (state && !state.fromGameCard) { returnPath = `/gameconfig/${appName}` @@ -348,18 +334,6 @@ function Settings() { writeConfig([appName, settingsToSave]) }, [GlobalSettings, GameSettings, appName]) - useEffect(() => { - // set copied to clipboard status to true if it's not already set to true - // used for changing text and color - if (!isCopiedToClipboard) return - - const timer = setTimeout(() => { - setCopiedToClipboard(false) - }, 3000) - - return () => clearTimeout(timer) - }, [isCopiedToClipboard]) - if (!title) { return } @@ -367,58 +341,6 @@ function Settings() { return ( <>
-
{title && ( )} - {isGeneralSettings && ( -
- - {isDefault && ( - <> - - - - - )} -
- )} {isWineSettings && ( )} + {isAdvancedSetting && ( + + )} + {t('info.settings')} {isLogSettings && ( )} - {t('info.settings')} {!isDefault && AppName: {appName}}
From ec7669d617c202658f7603ae90da3ba14143abd0 Mon Sep 17 00:00:00 2001 From: Flavio Lima Date: Sun, 10 Apr 2022 17:26:29 +0200 Subject: [PATCH 05/11] i18n: updated keys --- electron/main.ts | 6 ++++++ public/locales/bg/translation.json | 1 + public/locales/ca/translation.json | 1 + public/locales/cs/translation.json | 1 + public/locales/de/translation.json | 1 + public/locales/el/translation.json | 1 + public/locales/en/translation.json | 1 + public/locales/es/translation.json | 1 + public/locales/et/translation.json | 1 + public/locales/fa/translation.json | 13 +++++++------ public/locales/fi/translation.json | 1 + public/locales/fr/translation.json | 1 + public/locales/gl/translation.json | 1 + public/locales/hr/translation.json | 1 + public/locales/hu/translation.json | 1 + public/locales/id/translation.json | 1 + public/locales/it/translation.json | 1 + public/locales/ja/translation.json | 1 + public/locales/ko/translation.json | 1 + public/locales/ml/translation.json | 3 ++- public/locales/nl/translation.json | 1 + public/locales/pl/translation.json | 1 + public/locales/pt/translation.json | 1 + public/locales/pt_BR/translation.json | 1 + public/locales/ru/translation.json | 1 + public/locales/sv/translation.json | 1 + public/locales/ta/translation.json | 1 + public/locales/tr/translation.json | 1 + public/locales/uk/translation.json | 1 + public/locales/vi/translation.json | 1 + public/locales/zh_Hans/translation.json | 1 + public/locales/zh_Hant/translation.json | 1 + 32 files changed, 44 insertions(+), 7 deletions(-) diff --git a/electron/main.ts b/electron/main.ts index e1ecc1d4ac..3083216463 100644 --- a/electron/main.ts +++ b/electron/main.ts @@ -1307,6 +1307,12 @@ ipcMain.handle('gamepadAction', async (event, args) => { } }) +/* + Other Keys that should go into translation files: + t('box.error.generic.title') + t('box.error.generic.message') + */ + /* * INSERT OTHER IPC HANLDER HERE */ diff --git a/public/locales/bg/translation.json b/public/locales/bg/translation.json index 907542569b..50eaa87b2f 100644 --- a/public/locales/bg/translation.json +++ b/public/locales/bg/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "Журналът е отрязан. Показани са последните 1000 реда!" }, "navbar": { + "advanced": "Advanced", "general": "Общи", "log": "Log", "other": "Други", diff --git a/public/locales/ca/translation.json b/public/locales/ca/translation.json index 9bd0f6611a..3c2ae3840e 100644 --- a/public/locales/ca/translation.json +++ b/public/locales/ca/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "S'ha truncat el registre, es mostren les últimes 1.000 línies." }, "navbar": { + "advanced": "Advanced", "general": "General", "log": "Registre", "other": "Altres", diff --git a/public/locales/cs/translation.json b/public/locales/cs/translation.json index 6dda47425c..5bbc0a11cb 100644 --- a/public/locales/cs/translation.json +++ b/public/locales/cs/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "Log truncated, last 1000 lines are shown!" }, "navbar": { + "advanced": "Advanced", "general": "Obecné", "log": "Log", "other": "Ostatní", diff --git a/public/locales/de/translation.json b/public/locales/de/translation.json index 3103480d85..00ccbb1a95 100644 --- a/public/locales/de/translation.json +++ b/public/locales/de/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "Log abgeschnitten, die letzten 1000 Zeilen werden angezeigt!" }, "navbar": { + "advanced": "Advanced", "general": "Allgemein", "log": "Log", "other": "Andere", diff --git a/public/locales/el/translation.json b/public/locales/el/translation.json index fd15ef7eb1..efc693d11b 100644 --- a/public/locales/el/translation.json +++ b/public/locales/el/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "Το αρχείο καταγραφής ελαττώθηκε, εμφάνιση τελευταίων 1000 γραμμών!" }, "navbar": { + "advanced": "Advanced", "general": "Γενικά", "log": "Log", "other": "Άλλα", diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 331cdab313..0844bce677 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "Log truncated, last 1000 lines are shown!" }, "navbar": { + "advanced": "Advanced", "general": "General", "log": "Log", "other": "Other", diff --git a/public/locales/es/translation.json b/public/locales/es/translation.json index 9fa4021afb..4bc5ceb676 100644 --- a/public/locales/es/translation.json +++ b/public/locales/es/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "Registro truncado. ¡Se mostrarán las últimas 1000 líneas!" }, "navbar": { + "advanced": "Advanced", "general": "General", "log": "Registro", "other": "Otro", diff --git a/public/locales/et/translation.json b/public/locales/et/translation.json index b8b707fadb..39768e1979 100644 --- a/public/locales/et/translation.json +++ b/public/locales/et/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "Logi on kärbitud, näidatakse viimased 1000 rida!" }, "navbar": { + "advanced": "Advanced", "general": "Üldine", "log": "Logi", "other": "Muu", diff --git a/public/locales/fa/translation.json b/public/locales/fa/translation.json index 174dcdd94d..d460dd602d 100644 --- a/public/locales/fa/translation.json +++ b/public/locales/fa/translation.json @@ -12,7 +12,7 @@ }, "choose": "انتخاب", "choose-egs-prefix": "انتخاب محل نصب شده EGS", - "choose-gogdl-binary": "انتخاب باینری GOGDL (نیازمند راه‌اندازی مجدد)", + "choose-gogdl-binary": "انتخاب باینری GOGDL (نیازمند راهاندازی مجدد)", "choose-legendary-binary": "انتخاب باینری Legendary", "customWine": "انتخاب فایل باینری Wine یا Proton", "default-install-path": "انتخاب محل پیشفرض نصب", @@ -36,7 +36,7 @@ "launch": "خطا در هنگام اجرای بازی، لاگها را چک کنید!", "no-offline-mode": { "message": "اجرا متوقف شد! بازی برای اجرا به اتصال اینترنت نیاز دارد.", - "title": "حالت آفلاین پشتیبانی نمی‌شود." + "title": "حالت آفلاین پشتیبانی نمیشود." }, "title": "خطا", "wine-not-found": { @@ -97,7 +97,7 @@ }, "Downloading": "در حال دانلود", "epic": { - "offline-notification-body": "به علت آفلاین بودن سرورهای اپیک گیمز سرویس‌های آنلاین ممکن است کار نکنند!", + "offline-notification-body": "به علت آفلاین بودن سرورهای اپیک گیمز سرویسهای آنلاین ممکن است کار نکنند!", "offline-notification-title": "offline" }, "Epic Games": "اپیک گیمز", @@ -217,7 +217,7 @@ "setting": { "adddesktopshortcuts": "افزودن خودکار میانبرهای دسکتاپ", "addgamestostartmenu": "افزودن خودکار میانبرهای منوی استارت", - "alt-gogdl-bin": "انتخاب باینری GOGDL جایگزین برای استفاده (نیازمند راه‌اندازی مجدد)", + "alt-gogdl-bin": "انتخاب باینری GOGDL جایگزین برای استفاده (نیازمند راهاندازی مجدد)", "alt-legendary-bin": "انتخاب باینری Legendary جایگزین (نیازمند راهاندازی مجدد)", "audiofix": "تنظیم صدا (تاخیر Pulse Audio)", "autodxvk": "نصب/بهروزرسانی خودکار DXVK در Prefix", @@ -285,6 +285,7 @@ "long-log-hint": "لاگ کوتاه شد، ١٠٠٠ خط آخر نمایش داده شدهاند!" }, "navbar": { + "advanced": "Advanced", "general": "عمومی", "log": "Log", "other": "بقیه", @@ -297,7 +298,7 @@ "logging": "در حال وارد شدن..." }, "store": "فروشگاه اپیک", - "stores": "فروشگاه‌ها", + "stores": "فروشگاهها", "title": { "allGames": "همه بازیها", "allUnreal": "Unreal - همهچیز", @@ -332,7 +333,7 @@ "discord": "Discord", "logout": "خروج از حساب", "logout_confirmation": "آیا میخواهید از حساب خود خارج شوید؟", - "manageaccounts": "مدیریت حساب‌ها", + "manageaccounts": "مدیریت حسابها", "quit": "خروج" }, "webview": { diff --git a/public/locales/fi/translation.json b/public/locales/fi/translation.json index 0e3ee704e4..fc740cfc7c 100644 --- a/public/locales/fi/translation.json +++ b/public/locales/fi/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "Loki typistetty, viimeiset 1000 riviä näytetään!" }, "navbar": { + "advanced": "Advanced", "general": "Yleiset", "log": "Log", "other": "Muut", diff --git a/public/locales/fr/translation.json b/public/locales/fr/translation.json index a2b575a141..b9268b5c9d 100644 --- a/public/locales/fr/translation.json +++ b/public/locales/fr/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "Log truncated, last 1000 lines are shown!" }, "navbar": { + "advanced": "Advanced", "general": "Général", "log": "Log", "other": "Autre", diff --git a/public/locales/gl/translation.json b/public/locales/gl/translation.json index d3d0e5778c..3e40a0e3e9 100644 --- a/public/locales/gl/translation.json +++ b/public/locales/gl/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "Log truncated, last 1000 lines are shown!" }, "navbar": { + "advanced": "Advanced", "general": "Xeral", "log": "Log", "other": "Outro", diff --git a/public/locales/hr/translation.json b/public/locales/hr/translation.json index 90b1527f4b..93ac72c8e0 100644 --- a/public/locales/hr/translation.json +++ b/public/locales/hr/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "Log truncated, last 1000 lines are shown!" }, "navbar": { + "advanced": "Advanced", "general": "", "log": "Log", "other": "", diff --git a/public/locales/hu/translation.json b/public/locales/hu/translation.json index 5ad800a37d..2c12c33043 100644 --- a/public/locales/hu/translation.json +++ b/public/locales/hu/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "A napló rövidítve van, az utolsó 1000 sor van megjelenítve!" }, "navbar": { + "advanced": "Advanced", "general": "Általános", "log": "Napló", "other": "Egyéb", diff --git a/public/locales/id/translation.json b/public/locales/id/translation.json index a0392d7f9e..84fe6cefd0 100644 --- a/public/locales/id/translation.json +++ b/public/locales/id/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "Log truncated, last 1000 lines are shown!" }, "navbar": { + "advanced": "Advanced", "general": "", "log": "Log", "other": "", diff --git a/public/locales/it/translation.json b/public/locales/it/translation.json index 024d7ab36d..938a97835d 100644 --- a/public/locales/it/translation.json +++ b/public/locales/it/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "Log truncated, last 1000 lines are shown!" }, "navbar": { + "advanced": "Advanced", "general": "Generale", "log": "Log", "other": "Altro", diff --git a/public/locales/ja/translation.json b/public/locales/ja/translation.json index 151dbd4d8b..51779a8a46 100644 --- a/public/locales/ja/translation.json +++ b/public/locales/ja/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "Log truncated, last 1000 lines are shown!" }, "navbar": { + "advanced": "Advanced", "general": "一般", "log": "Log", "other": "他", diff --git a/public/locales/ko/translation.json b/public/locales/ko/translation.json index 238747f250..73aebc3451 100644 --- a/public/locales/ko/translation.json +++ b/public/locales/ko/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "로그 잘림, 마지막 1000줄이 표시됩니다!" }, "navbar": { + "advanced": "Advanced", "general": "일반", "log": "Log", "other": "기타", diff --git a/public/locales/ml/translation.json b/public/locales/ml/translation.json index 268eca7ee8..7874e65d0b 100644 --- a/public/locales/ml/translation.json +++ b/public/locales/ml/translation.json @@ -111,7 +111,7 @@ "platform": "" }, "help": { - "general": "എപിക് ഗെയിം കടയുടെ കുഴപ്പമൊന്നുില്ലാത്ത ഒരു നടീല്\u200d മറ്റെവിടെയെങ്കിലും ഉണ്ടെങ്കില്\u200d നിങ്ങളുടെ കളികള്\u200d വീണ്ടും ഇറക്കിയെടുക്കുന്നത് ഒഴിവാക്കാനായി EGSുമായി ഒന്നിപ്പിക്കുക.", + "general": "എപിക് ഗെയിം കടയുടെ കുഴപ്പമൊന്നുില്ലാത്ത ഒരു നടീല് മറ്റെവിടെയെങ്കിലും ഉണ്ടെങ്കില് നിങ്ങളുടെ കളികള് വീണ്ടും ഇറക്കിയെടുക്കുന്നത് ഒഴിവാക്കാനായി EGSുമായി ഒന്നിപ്പിക്കുക.", "other": { "part1": "കളി ഓടിക്കുന്നതിനുമുന്പുള്ള വിളികള്ക്കായി ", "part2": "ഉയര്ന്ന ക്രമീകരണങ്ങള്", @@ -285,6 +285,7 @@ "long-log-hint": "Log truncated, last 1000 lines are shown!" }, "navbar": { + "advanced": "Advanced", "general": "പൊതുവായവ", "log": "Log", "other": "മറ്റുള്ളവ", diff --git a/public/locales/nl/translation.json b/public/locales/nl/translation.json index 57d57c5cae..54034647f3 100644 --- a/public/locales/nl/translation.json +++ b/public/locales/nl/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "Log truncated, last 1000 lines are shown!" }, "navbar": { + "advanced": "Advanced", "general": "Algemeen", "log": "Log", "other": "Overig", diff --git a/public/locales/pl/translation.json b/public/locales/pl/translation.json index af98c0e422..d996444604 100644 --- a/public/locales/pl/translation.json +++ b/public/locales/pl/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "Log skrócony, wyświetlam ostatnie 1000 linijek!" }, "navbar": { + "advanced": "Advanced", "general": "Główne", "log": "Log", "other": "Inne", diff --git a/public/locales/pt/translation.json b/public/locales/pt/translation.json index 4abb5e697e..4268d6872a 100644 --- a/public/locales/pt/translation.json +++ b/public/locales/pt/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "Log truncated, last 1000 lines are shown!" }, "navbar": { + "advanced": "Advanced", "general": "Geral", "log": "Log", "other": "Outros", diff --git a/public/locales/pt_BR/translation.json b/public/locales/pt_BR/translation.json index a1be409685..189e01f932 100644 --- a/public/locales/pt_BR/translation.json +++ b/public/locales/pt_BR/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "Log truncado, últimas 1000 linhas serão mostradas!" }, "navbar": { + "advanced": "Advanced", "general": "Config. Gerais", "log": "Log", "other": "Outros", diff --git a/public/locales/ru/translation.json b/public/locales/ru/translation.json index c760faad28..4d17cb6098 100644 --- a/public/locales/ru/translation.json +++ b/public/locales/ru/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "Журнал урезан, показаны последние 1000 строк!" }, "navbar": { + "advanced": "Advanced", "general": "Основные", "log": "Журнал", "other": "Другие", diff --git a/public/locales/sv/translation.json b/public/locales/sv/translation.json index 1fcc2906e9..a5426e36bd 100644 --- a/public/locales/sv/translation.json +++ b/public/locales/sv/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "Loggen avkortad , enbart senaste 1000 rader visas!" }, "navbar": { + "advanced": "Advanced", "general": "Allmänt", "log": "Logg", "other": "Övrigt", diff --git a/public/locales/ta/translation.json b/public/locales/ta/translation.json index e495913656..c80c827ebb 100644 --- a/public/locales/ta/translation.json +++ b/public/locales/ta/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "Log truncated, last 1000 lines are shown!" }, "navbar": { + "advanced": "Advanced", "general": "பொதுவானவை", "log": "Log", "other": "மற்றவை", diff --git a/public/locales/tr/translation.json b/public/locales/tr/translation.json index 5ea79b8bb7..1097f596b9 100644 --- a/public/locales/tr/translation.json +++ b/public/locales/tr/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "Günlük kısaltıldı, son 1000 satır gösteriliyor!" }, "navbar": { + "advanced": "Advanced", "general": "Genel", "log": "Log", "other": "Diğer", diff --git a/public/locales/uk/translation.json b/public/locales/uk/translation.json index 5ad82b9050..3939fe2fc1 100644 --- a/public/locales/uk/translation.json +++ b/public/locales/uk/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "Лог усічений, показані останні 1000 рядків!" }, "navbar": { + "advanced": "Advanced", "general": "Загальні", "log": "Лог", "other": "Інше", diff --git a/public/locales/vi/translation.json b/public/locales/vi/translation.json index c6bf51ecbe..caca84cbe1 100644 --- a/public/locales/vi/translation.json +++ b/public/locales/vi/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "Log bị cắt ngắn, hiển thị 1000 dòng cuối!" }, "navbar": { + "advanced": "Advanced", "general": "Tổng quan", "log": "Log", "other": "Khác", diff --git a/public/locales/zh_Hans/translation.json b/public/locales/zh_Hans/translation.json index 3847e0d009..832c30b303 100644 --- a/public/locales/zh_Hans/translation.json +++ b/public/locales/zh_Hans/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "日志被截断,显示最后 1000 行!" }, "navbar": { + "advanced": "Advanced", "general": "常规", "log": "Log", "other": "其它", diff --git a/public/locales/zh_Hant/translation.json b/public/locales/zh_Hant/translation.json index 04f9ab81a2..2afeb0f29e 100644 --- a/public/locales/zh_Hant/translation.json +++ b/public/locales/zh_Hant/translation.json @@ -285,6 +285,7 @@ "long-log-hint": "Log truncated, last 1000 lines are shown!" }, "navbar": { + "advanced": "Advanced", "general": "一般", "log": "Log", "other": "其它", From 4f52076564e8431d8417b448ea921ecda282aaed Mon Sep 17 00:00:00 2001 From: Flavio Lima Date: Sun, 10 Apr 2022 18:20:41 +0200 Subject: [PATCH 06/11] feat: add back button on game page --- src/screens/Game/GamePage/index.css | 42 ++++++++++++++++++++++++++ src/screens/Game/GamePage/index.tsx | 19 ++++++++++-- src/screens/Game/GamePicture/index.css | 23 -------------- src/screens/Game/GamePicture/index.tsx | 9 ------ 4 files changed, 59 insertions(+), 34 deletions(-) diff --git a/src/screens/Game/GamePage/index.css b/src/screens/Game/GamePage/index.css index 5f34647f2d..bf0952c08f 100644 --- a/src/screens/Game/GamePage/index.css +++ b/src/screens/Game/GamePage/index.css @@ -27,6 +27,48 @@ flex-grow: 0; } +.store-icon { + border-radius: 10px; + position: absolute; + right: 18px; + top: 6px; + z-index: 2; + padding: 5px; + width: 60px; + height: 60px; + place-content: center; +} + +.store-icon > img { + background-color: var(--body-background); + width: 60px; + padding: 4px; + border-radius: 10px; +} + +.store-icon > img.gogIcon { + padding: 0px 4px 4px 4px; +} + +.backButton { + position: absolute; + top: 12px; + left: 12px; + background: none; + border: none; + color: var(--text-default); +} + +.backButton > .MuiSvgIcon-root { + width: 50px; + height: 50px; + transition: 300ms; +} + +.backButton > .MuiSvgIcon-root:hover { + color: var(--accent); +} + .gameInfo { text-align: initial; font-size: 1rem; diff --git a/src/screens/Game/GamePage/index.tsx b/src/screens/Game/GamePage/index.tsx index 18da47bfb1..3cd6577308 100644 --- a/src/screens/Game/GamePage/index.tsx +++ b/src/screens/Game/GamePage/index.tsx @@ -8,6 +8,8 @@ import React, { useMemo } from 'react' +import ArrowCircleLeftIcon from '@mui/icons-material/ArrowCircleLeft' + import { IpcRenderer } from 'electron' import { getGameInfo, @@ -17,7 +19,7 @@ import { sendKill, syncSaves } from 'src/helpers' -import { Link, useParams } from 'react-router-dom' +import { Link, useHistory, useParams } from 'react-router-dom' import { useTranslation } from 'react-i18next' import ContextProvider from 'src/state/ContextProvider' import UpdateComponent from 'src/components/UI/UpdateComponent' @@ -40,7 +42,8 @@ import GameRequirements from '../GameRequirements' import { GameSubMenu } from '..' import { InstallModal } from 'src/screens/Library/components' import { install } from 'src/helpers/library' - +import EpicLogo from 'src/assets/epic-logo.svg' +import GOGLogo from 'src/assets/gog-logo.svg' const storage: Storage = window.localStorage const { ipcRenderer } = window.require('electron') as { @@ -88,6 +91,8 @@ export default function GamePage(): JSX.Element | null { message: string | unknown }>({ error: false, message: '' }) + const history = useHistory() + const isWin = platform === 'win32' const isMac = platform === 'darwin' const isLinux = platform === 'linux' @@ -224,6 +229,16 @@ export default function GamePage(): JSX.Element | null { {title ? ( <> + +
+ +
{is_game && ( <> diff --git a/src/screens/Game/GamePicture/index.css b/src/screens/Game/GamePicture/index.css index e4ca65a887..293c6aff4a 100644 --- a/src/screens/Game/GamePicture/index.css +++ b/src/screens/Game/GamePicture/index.css @@ -33,26 +33,3 @@ width: 70%; min-width: 140px; } - -.gamePicture > .store-icon { - border-radius: 10px; - position: absolute; - left: 0px; - top: 0px; - z-index: 2; - padding: 5px; - width: 60px; - height: 60px; - place-content: center; -} - -.gamePicture > .store-icon > img { - background-color: var(--body-background); - width: 60px; - padding: 4px; - border-radius: 10px; -} - -.gamePicture > .store-icon > img.gogIcon { - padding: 0px 4px 4px 4px; -} diff --git a/src/screens/Game/GamePicture/index.tsx b/src/screens/Game/GamePicture/index.tsx index 380e9acb36..4ff634d089 100644 --- a/src/screens/Game/GamePicture/index.tsx +++ b/src/screens/Game/GamePicture/index.tsx @@ -1,7 +1,5 @@ import React from 'react' import './index.css' -import EpicLogo from 'src/assets/epic-logo.svg' -import GOGLogo from 'src/assets/gog-logo.svg' import fallbackImage from 'src/assets/fallback-image.jpg' type Props = { art_square: string @@ -21,13 +19,6 @@ function GamePicture({ art_square, store }: Props) { return (
cover-art -
- -
) } From a52e9a0b09132636d6dcf4559e2d5b08f77e4832 Mon Sep 17 00:00:00 2001 From: Flavio Lima Date: Sun, 10 Apr 2022 18:31:56 +0200 Subject: [PATCH 07/11] feat: add back button to settings --- src/screens/Game/GamePage/index.css | 4 ++-- src/screens/Game/GamePage/index.tsx | 8 +++----- .../Settings/components/OtherSettings/index.tsx | 2 +- src/screens/Settings/index.css | 14 +++++++++++++- src/screens/Settings/index.tsx | 9 ++++++++- 5 files changed, 27 insertions(+), 10 deletions(-) diff --git a/src/screens/Game/GamePage/index.css b/src/screens/Game/GamePage/index.css index bf0952c08f..e0d1800da7 100644 --- a/src/screens/Game/GamePage/index.css +++ b/src/screens/Game/GamePage/index.css @@ -56,7 +56,7 @@ left: 12px; background: none; border: none; - color: var(--text-default); + color: var(--accent); } .backButton > .MuiSvgIcon-root { @@ -66,7 +66,7 @@ } .backButton > .MuiSvgIcon-root:hover { - color: var(--accent); + color: var(--text-hover); } .gameInfo { diff --git a/src/screens/Game/GamePage/index.tsx b/src/screens/Game/GamePage/index.tsx index 3cd6577308..eb615cc050 100644 --- a/src/screens/Game/GamePage/index.tsx +++ b/src/screens/Game/GamePage/index.tsx @@ -19,7 +19,7 @@ import { sendKill, syncSaves } from 'src/helpers' -import { Link, useHistory, useParams } from 'react-router-dom' +import { Link, NavLink, useParams } from 'react-router-dom' import { useTranslation } from 'react-i18next' import ContextProvider from 'src/state/ContextProvider' import UpdateComponent from 'src/components/UI/UpdateComponent' @@ -91,8 +91,6 @@ export default function GamePage(): JSX.Element | null { message: string | unknown }>({ error: false, message: '' }) - const history = useHistory() - const isWin = platform === 'win32' const isMac = platform === 'darwin' const isLinux = platform === 'linux' @@ -229,9 +227,9 @@ export default function GamePage(): JSX.Element | null { {title ? ( <> - +
)} - {canRunOffline && ( + {!isDefault && canRunOffline && (