-
Notifications
You must be signed in to change notification settings - Fork 7
[WIP] Tweet view #106
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
base: develop
Are you sure you want to change the base?
[WIP] Tweet view #106
Conversation
Tweets will appear in a slider, user can swipe left/right for seeing tweets.
Change tweet slide badge color to Twitter's brand color Reduce font size for tweet ids issue #68
|
||
@Input() pokemon: Pokemon; | ||
|
||
tweetArray: Object[]; |
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.
tweets
|
||
// We will get timestamps from the api, here is a function for converting | ||
// http://stackoverflow.com/questions/847185/convert-a-unix-timestamp-to-time-in-javascript | ||
timestampToDate(timestamp) |
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.
brackets
|
||
export class PokeTweetsComponent { | ||
|
||
@Input() pokemon: Pokemon; |
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.
If you just need the name, just pass the name
@Component({ | ||
template: require('./poke-tweets.component.html'), | ||
styles: [require('./poke-tweets.component.scss')], | ||
selector: 'poke-tweets' |
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.
selector
should be first
/* Mock data */ | ||
this.tweetArray = []; | ||
for(var i = 0; i < 20; i++) { | ||
var tweet = { |
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.
use const
instead of var
"id": 12345 + i, | ||
"text": "Lorem ipsum dolor sit amet, " + this.pokemon.name + " adipiscing elit", | ||
"coordinates": [0, 0], | ||
"timestamp": this.timestampToDate((Date.now() / 1000) + i | 0) |
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.
Property names should be unquoted. Strings should use single quotes
var seconds = "0" + date.getSeconds(); | ||
|
||
// Will display time in 10:30:23 format | ||
var formattedTime = hours + ':' + minutes.substr(-2) + ':' + seconds.substr(-2); |
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.
var
-> const
ngOnInit() { | ||
/* Mock data */ | ||
this.tweetArray = []; | ||
for(var i = 0; i < 20; i++) { |
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.
Use let
instead of var
Thanks for the comments @MajorBreakfast @WoH . This is a work in progress so I just put that code to mock the api. The code in the |
This PR is ancient, and the last commit as well |
fyi see #68 |
@AlexanderLill yup.. equally old :D |
issue Implement Tweet-View #68
This tweets component could be used for the mob card issue #80
Work In Progress
Right now, works with randomly generated data.
TODO: Get data from the API