-
-
Notifications
You must be signed in to change notification settings - Fork 452
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
[Refactor] Sidebar cleanup (and a bit more that's related) #3544
Changes from all commits
2ce0e45
15293ca
1850db1
c521950
9c28fbc
818f20f
733cc2f
4ad21a6
1ae89d7
dbabe6e
41b5007
4786c30
79e4c48
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
.Sidebar { | ||
.currentDownload { | ||
font-size: var(--text-sm); | ||
padding: var(--space-md) 0; | ||
transition: 300ms; | ||
margin-top: var(--space-sm); | ||
align-self: end; | ||
|
||
& > .gameTitle { | ||
font-size: var(--text-md); | ||
transition: 600ms; | ||
font-weight: var(--bold); | ||
} | ||
|
||
&:hover > .gameTitle { | ||
color: var(--accent-overlay); | ||
transition: 600ms; | ||
} | ||
|
||
.downloadStatus { | ||
color: var(--success); | ||
font-family: var(--secondary-font-family); | ||
font-style: italic; | ||
font-weight: normal; | ||
font-size: var(--text-sm); | ||
line-height: var(--text-sm); | ||
} | ||
|
||
.MuiLinearProgress-bar1Determinate { | ||
background-color: var(--success); | ||
} | ||
|
||
.statusIcon { | ||
display: none; | ||
margin-inline-end: 10px; | ||
svg { | ||
width: 27px; | ||
height: auto; | ||
color: var(--success); | ||
} | ||
} | ||
} | ||
|
||
&.collapsed { | ||
.statusIcon { | ||
display: block; | ||
} | ||
.full-size { | ||
display: none; | ||
} | ||
} | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ import Box from '@mui/material/Box' | |
import { getGameInfo } from 'frontend/helpers' | ||
import { hasProgress } from 'frontend/hooks/hasProgress' | ||
import { Runner } from 'common/types' | ||
import './index.scss' | ||
import './index.css' | ||
import { useTranslation } from 'react-i18next' | ||
import ContextProvider from 'frontend/state/ContextProvider' | ||
import Badge from '@mui/material/Badge' | ||
|
@@ -52,37 +52,35 @@ export default React.memo(function CurrentDownload({ appName, runner }: Props) { | |
} | ||
|
||
return ( | ||
<> | ||
<Link to={`/download-manager`} className="currentDownload"> | ||
<span className="statusIcon" title={`${getStatus()} - ${gameTitle}`}> | ||
<Badge | ||
badgeContent={`${Math.round(progress.percent ?? 0)}%`} | ||
color="primary" | ||
> | ||
<FontAwesomeIcon icon={faDownload} /> | ||
</Badge> | ||
</span> | ||
<Link to={`/download-manager`} className="currentDownload"> | ||
<span className="statusIcon" title={`${getStatus()} - ${gameTitle}`}> | ||
<Badge | ||
badgeContent={`${Math.round(progress.percent ?? 0)}%`} | ||
color="primary" | ||
> | ||
<FontAwesomeIcon icon={faDownload} /> | ||
</Badge> | ||
</span> | ||
|
||
<div className="full-size"> | ||
<span className="gameTitle">{gameTitle ?? 'GameName'}</span> | ||
<br /> | ||
<span className="downloadStatus">{getStatus()}</span> | ||
<br /> | ||
<Box sx={{ display: 'flex', alignItems: 'center' }}> | ||
<Box sx={{ width: '100%', mr: 1 }}> | ||
<LinearProgress | ||
variant="determinate" | ||
value={progress.percent || 0} | ||
/> | ||
</Box> | ||
<Box sx={{ minWidth: 35 }}> | ||
<Typography variant="body2">{`${Math.round( | ||
progress.percent || 0 | ||
)}%`}</Typography> | ||
</Box> | ||
<div className="full-size"> | ||
<span className="gameTitle">{gameTitle ?? 'GameName'}</span> | ||
<br /> | ||
<span className="downloadStatus">{getStatus()}</span> | ||
<br /> | ||
<Box sx={{ display: 'flex', alignItems: 'center' }}> | ||
<Box sx={{ width: '100%', mr: 1 }}> | ||
<LinearProgress | ||
variant="determinate" | ||
value={progress.percent || 0} | ||
/> | ||
</Box> | ||
</div> | ||
</Link> | ||
</> | ||
<Box sx={{ minWidth: 35 }}> | ||
<Typography variant="body2">{`${Math.round( | ||
progress.percent || 0 | ||
)}%`}</Typography> | ||
</Box> | ||
</Box> | ||
</div> | ||
</Link> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is just me removing the extra |
||
) | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
.Sidebar { | ||
.heroicVersion { | ||
display: flex; | ||
gap: 5px; | ||
font-size: var(--text-sm); | ||
cursor: pointer; | ||
transition: 300ms; | ||
color: var(--brand-text-01); | ||
|
||
&:hover { | ||
color: var(--accent); | ||
} | ||
} | ||
|
||
.heroicNewReleases { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-around; | ||
font-size: var(--text-sm); | ||
|
||
& > a { | ||
color: var(--accent); | ||
transition: 300ms; | ||
-webkit-app-region: no-drag; | ||
cursor: pointer; | ||
|
||
&:hover { | ||
color: var(--accent-overlay); | ||
} | ||
} | ||
} | ||
|
||
&.collapsed { | ||
.heroicVersion { | ||
font-size: var(--text-xs); | ||
text-align: center; | ||
} | ||
|
||
.heroicVersion__title { | ||
display: none; | ||
} | ||
|
||
.heroicNewReleases { | ||
display: none; | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
.Sidebar { | ||
.Sidebar__item { | ||
--sidebar-item-inactive-text-color: var( | ||
--navbar-inactive, | ||
var(--navbar-accent) | ||
); | ||
--sidebar-hover-text-color: var(--text-hover); | ||
--sidebar-item-active-text-color: var( | ||
--navbar-active, | ||
var(--accent-overlay, var(--accent)) | ||
); | ||
--sidebar-active-item-background: var(--navbar-active-background); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this file is mostly extraction of |
||
|
||
display: flex; | ||
gap: 10px; | ||
width: 100%; | ||
padding: var(--space-xs) var(--sidebar-horizontal-padding); | ||
border: none; | ||
background: none; | ||
cursor: pointer; | ||
font-size: var(--text-md); | ||
color: var(--sidebar-item-inactive-text-color); | ||
transition: color 250ms; | ||
text-align: start; | ||
font-family: var(--primary-font-family); | ||
|
||
.Sidebar__itemIcon { | ||
width: 24px; | ||
display: inline-flex; | ||
justify-content: center; | ||
} | ||
|
||
&:focus-visible { | ||
outline: 2px solid var(--sidebar-hover-text-color); | ||
outline-offset: -2px; | ||
} | ||
|
||
&.active { | ||
color: var(--sidebar-item-active-text-color); | ||
|
||
.Sidebar__itemIcon { | ||
color: currentColor; | ||
} | ||
|
||
&.SidebarLinks__subItem { | ||
font-weight: var(--bold); | ||
} | ||
} | ||
&.active:not(.SidebarLinks__subItem) { | ||
background-color: var(--sidebar-active-item-background); | ||
} | ||
|
||
&.SidebarLinks__subItem { | ||
&, | ||
&:hover { | ||
padding-block: var(--space-3xs); | ||
padding-inline: var(--space-xl) var(--sidebar-horizontal-padding); | ||
font-size: var(--text-sm); | ||
line-height: 20px; | ||
white-space: break-spaces; | ||
} | ||
&::before { | ||
content: '• '; | ||
} | ||
& + .Sidebar__item:not(.SidebarLinks__subItem) { | ||
margin-top: 4px; | ||
} | ||
} | ||
|
||
&:hover { | ||
background-color: var(--navbar-active-background); | ||
transition: 0.1s; | ||
padding-inline-start: 12px; | ||
} | ||
|
||
@media screen and (max-width: 730px) { | ||
&, | ||
&:hover { | ||
padding: var(--space-3xs) var(--sidebar-horizontal-padding) | ||
var(--space-3xs) var(--space-lg); | ||
} | ||
} | ||
} | ||
|
||
&.collapsed { | ||
.Sidebar__item { | ||
padding: var(--space-xs) 0; | ||
|
||
& > span { | ||
display: none; | ||
} | ||
|
||
&.SidebarLinks__subItem { | ||
padding: var(--space-xs) var(--sidebar-horizontal-padding); | ||
&::before { | ||
display: none; | ||
} | ||
} | ||
|
||
&.active svg, | ||
& svg { | ||
transform: scale(1.2); | ||
padding: var(--space-2xs) 0; | ||
} | ||
|
||
.Sidebar__itemIcon { | ||
margin: 0 auto; | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need these
app/default
routes anymore, the Settings component always renders Heroic's settings, game's settings are not handled by this url