-
Notifications
You must be signed in to change notification settings - Fork 387
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
Add completion marker to daily challenge profile counter #11780
base: master
Are you sure you want to change the base?
Changes from 3 commits
9fc4d20
b8adbac
5f2ab58
e69ab6a
18b2ecf
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 | ||||
---|---|---|---|---|---|---|
|
@@ -5,10 +5,27 @@ | |||||
background: hsl(var(--hsl-b4)); | ||||||
border-radius: @border-radius-large; | ||||||
min-width: 0; | ||||||
position: relative; | ||||||
display: flex; | ||||||
align-items: center; | ||||||
padding: 3px; | ||||||
|
||||||
&--played-today { | ||||||
border: 2px solid @osu-colour-lime-1; | ||||||
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 should only change the 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. In the process of applying this I noticed that the border even if transparent was also stacking onto the existing 3px of padding (see screenshots below, with the border green colour changed to transparent to show the difference):
which I didn't want to do and I don't think the design was going for, so I reduced the padding to 1px to compensate. |
||||||
|
||||||
&::before { | ||||||
.fas(); | ||||||
background-color: @osu-colour-b6; | ||||||
border-radius: 50%; | ||||||
color: @osu-colour-lime-1; | ||||||
content: @fa-var-check-circle; | ||||||
font-size: 16px; | ||||||
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. there has been an attempt on marking icon-specific hard coded font-size - instead of using variable - with |
||||||
position: absolute; | ||||||
right: -8px; | ||||||
top: -8px; | ||||||
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.
|
||||||
} | ||||||
} | ||||||
|
||||||
&__name { | ||||||
font-size: @font-size--normal; | ||||||
padding: 0 5px; | ||||||
|
@@ -20,7 +37,7 @@ | |||||
} | ||||||
|
||||||
&__value-box { | ||||||
border-radius: @border-radius-large; | ||||||
border-radius: @border-radius-small; | ||||||
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. Adjusted as per mention in #11597:
|
||||||
background: hsl(var(--hsl-b6)); | ||||||
padding: 5px 10px; | ||||||
} | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
import DailyChallengeUserStatsJson from 'interfaces/daily-challenge-user-stats-json'; | ||
import { autorun } from 'mobx'; | ||
import { observer } from 'mobx-react'; | ||
import * as moment from 'moment'; | ||
import * as React from 'react'; | ||
import { renderToStaticMarkup } from 'react-dom/server'; | ||
import { classWithModifiers, Modifiers } from 'utils/css'; | ||
|
@@ -122,10 +123,12 @@ export default class DailyChallenge extends React.Component<Props> { | |
return null; | ||
} | ||
|
||
const playedToday = this.props.stats.last_update != null && moment.utc(this.props.stats.last_update).isSame(Date.now(), 'day'); | ||
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. I think this is gonna do timezones correctly: https://momentjs.com/docs/#/query/is-same/
and it looked correct when I messed around with my timezone... 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. yeah that seems correct (until someone complains it's not) alternatively 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.
I uh... am not confident in my ability to do so, so I'd rather not if that's fine with you 😅 |
||
|
||
return ( | ||
<div | ||
ref={this.valueRef} | ||
className='daily-challenge' | ||
className={classWithModifiers('daily-challenge', { 'played-today': playedToday })} | ||
onMouseOver={this.onMouseOver} | ||
> | ||
<div className='daily-challenge__name'> | ||
|
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.
This is 1px on the design file but I find that 1px looks terrible on the rounded corners:
Arguably even 2px looks not great. Maybe 3px even could be considered. cc @ppy/team-design
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.
the extra spacing between the day count box and the green border seems a bit weird?
also dunno if matters but the popup box covers the check mark a little bit
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.
I mean yeah maybe. I'm just following design direction here 🤷
Yeah it does and was also unsure if it mattered. I guess maybe the design peoples can say?
Just for visual reference here's a screenshot: