-
Notifications
You must be signed in to change notification settings - Fork 42
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
Feat/video label #704
Feat/video label #704
Conversation
fa69f3d
to
1ddb933
Compare
e499664
to
e890977
Compare
import renderer from "react-test-renderer"; | ||
import VideoLabel from "../video-label"; | ||
|
||
module.exports = () => { |
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.
export default
|
||
const styles = { | ||
title: { | ||
...sharedStyles.title |
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.
these index files do not seem to add anything...
<Text style={[styles.title, { color, marginLeft: 5 }]}> | ||
{beautifyTitle("VIDEO")} | ||
</Text> | ||
{title ? ( |
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.
&&
instead of a ternary?
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.
to my surprise this does not seem to work:
Unexpected text node: . A text node cannot be a child of a <View>.
{title ? ( | ||
<Text style={[styles.title, { color, marginLeft: 3 }]}>|</Text> | ||
) : null} | ||
{title ? ( |
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.
&&
.add("VideoLabel with title", () => ( | ||
<VideoLabel | ||
title="SWIMMING" | ||
color={select( |
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.
nice knobs
// apply transformations to add uppercase and letter spacing. | ||
// letterSpacing CSS prop does not work on android: | ||
// https://github.com/facebook/react-native/pull/13199 | ||
const beautifyTitle = title => |
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.
maybe we can now get rid of this letter spacing hack in light of facebook/react-native#17398. Just need to check
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.
Not part of react-native-0.53.3
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.
ok
packages/video-label/video-label.js
Outdated
{title ? ( | ||
<Text style={[styles.title, { color, paddingLeft: 3 }]}>{title}</Text> | ||
<Text style={[styles.title, { color, paddingLeft: 5 }]}>{title.toUpperCase()}</Text> |
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.
better
packages/icons/icons/video.js
Outdated
@@ -6,8 +6,9 @@ import iconPropTypes from "./proptypes"; | |||
const viewBox = | |||
"0.15463916957378387 0.049614034593105316 23.59917640686035 13.728596687316895"; | |||
|
|||
const ratio = 1.72; |
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.
In twitter.js
we using a ratio here we using a decimal. Can use 43 / 25
for video and 75 / 60
for twitter. Other than this it seems good to merge
0acfd7d
to
6ec45c3
Compare
fcc7fea
to
7f3028b
Compare
Implements video label as a seperate package.
In order to avoid magic numbers when using the video-icon inside the video label, I made width of icons optional and compute the width from the aspect ratio and height.
reference: https://www.thetimes.co.uk/past-six-days/2018-03-06/sport/weekend-review-mourinhos-tumble-richarlisons-tantrum-and-dioufs-spat-tfsfwtbkf