-
Notifications
You must be signed in to change notification settings - Fork 63
Conversation
src/components/VButton.vue
Outdated
@@ -95,7 +101,7 @@ const VButton = defineComponent({ | |||
as: { | |||
type: String as PropType<ButtonForm>, | |||
default: 'button', | |||
validate: (val: ButtonForm) => buttonForms.includes(val), | |||
validate: (val: unknown) => buttonForms.includes(val as ButtonForm), |
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.
TIL!
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 only changed this because I was trying to get the ExtractPropTypes
to work correctly with props that have default values. I'll set it back, there's no functional or operational difference either way.
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.
(Though the unknown
parameter type is technically more correct).
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.
It just doesn't matter because we don't call validate
directly so the type checking in this function is basically a "whatever" kind of thing.
@@ -36,22 +36,20 @@ export default defineComponent({ | |||
* the current play status of the audio | |||
*/ | |||
status: { | |||
type: String, | |||
validator: (val) => ['playing', 'paused', 'played'].includes(val), | |||
type: String as PropType<'playing' | 'paused' | 'played'>, |
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 could use the type from active media store here:
type MediaStatus = 'ejected' | 'playing' | 'paused' // 'ejected' means player is closed |
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.
It's a different status, this one has "played" instead of "ejected". IIRC there is some distinction, perhaps one for when the player is closed ("ejected") and the other for when the audio has simply finished playing to the end (in which case we show the replay button).
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.
Oh, thank you for explaining :)
83e0fe1
to
9de8a8e
Compare
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 buttons' colors are fixed. There are some size inconsistencies with the mockups:
The close button on the License Popover is the correct size (40x40px), but it probably should be right at the top of the popover (without any padding/margin).
The close button on the content report form is too big (48x48 instead of 40x40)
Do you think we should open a new issue for that?
@obulat I can fix those here. For the button position, I moved it because it looked awkward and wrong for it to not be vertically aligned with header text of the popover. cc @panchovm on that one. |
In both the license Popover and the content report form, I see Regarding the close button position in popovers, I have pending reviewing the popover style. Some cases have more content than others, and the vertical alignment can blend with the popover's title area. Here is an example. For now, I would keep it top-right aligned with a top and right margin of Also, notice that the resting style of the close button is |
I think that the close buttons should be at least 40x40px, because on the mobile phones it's very difficult to click on buttons that are smaller than 40px. This is also an accessibility/SEO requirement that is checked by Google Lighthouse. |
63c6952
to
eb59273
Compare
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.
LGTM!
export type ButtonProps = ProperlyExtractPropTypes< | ||
NonNullable<typeof VButton['props']> | ||
> |
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.
Shouldn't this be after the declaration of VButton
?
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 couldn't decide 😅 I thought putting it before would make it more obvious where it was coming from for someone reading this and wondering how it worked 🤔 type declarations and references can appear in any order in a file so it doesn't cause any integrity issues.
The target size criterion requires a What do you think? |
eb59273
to
dadebee
Compare
Fixes
Fixes #1206 by @zackkrida
Description
Fixes the problem in the linked issue by fixing the root cause in the VIconButton component. Also does some TypeScript stuff to make the VButton easier to use with TypeScript and able to type things like VIconButton that "spread props" to VButton.
Testing Instructions
Check out the VIconButton implementations in the app and ensure they look good:
I could add visual-regression tests for each of these but in the interest of expediency I only added it for the particular button in question.
Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin