Skip to content

[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

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open

[WIP] Tweet view #106

wants to merge 7 commits into from

Conversation

mfkaptan
Copy link
Member

  • Put tweets inside slider so they won't take much space
  • User can swipe left/right to see next/previous tweet
  • Set autoloop, so slider loops automatically
  • Add twitter logo and brand color to slider badge
    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

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[];
Copy link
Member

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)
Copy link
Member

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;
Copy link
Member

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'
Copy link
Contributor

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 = {
Copy link
Contributor

@MajorBreakfast MajorBreakfast Oct 11, 2016

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)
Copy link
Contributor

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);
Copy link
Contributor

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++) {
Copy link
Contributor

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

@mfkaptan
Copy link
Member Author

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 ngOnInit() won't be in the final product. But still, thanks for the review.

@sacdallago
Copy link
Member

This PR is ancient, and the last commit as well

@AlexanderLill
Copy link
Collaborator

fyi see #68

@sacdallago
Copy link
Member

@AlexanderLill yup.. equally old :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants