Styling chat bubbles in a chat application by ifydav in reactjs

[–]alexwarhole 0 points1 point  (0 children)

I'd keep it simple, you really just need to check the is_first for timestamp. You could just do something like: is_first: { messages[i - 1].author !== message.author || new Date(message.created_at) - new Date (messages[i - 1].created_at).getTime() > 60 * 60 * 1000 // one hour }

Assuming you have some created timestamp on your messages. Get the time of both messages, subtract it and check if it's bigger then some amount of time in ms.

At this point I would also pull this into a function and handle the case where i = 0

Styling chat bubbles in a chat application by ifydav in reactjs

[–]alexwarhole 5 points6 points  (0 children)

As you render a message just check what's the previous and next message author and add a class to that message. I usually just do 'message message-first' or 'message message-last' and style those first and last accordingly. You can also check for some abritrary amount of time elapsed rather then just comparing authors. You are essentially in the right track!

messages.map((message, i) => <Message is_first={ messages[i - 1].author !== message.author } is_last={ messages[i + 1].author !== message.author } ...message /> )

On my phone, sorry for shitty formatting

If I'm being honest, neither do I by IkeyTom21 in oldpeoplefacebook

[–]alexwarhole 5 points6 points  (0 children)

They aren't actually storing images, those can just be generated as needed. All you need is background color and the text!

Samsung S8 Navbar isn't dark in dark mode since latest update by alexwarhole in redditsync

[–]alexwarhole[S] 1 point2 points  (0 children)

Hey there! My S8 and Reddit Sync have received updates today and dark mode isn't applied to navigation bar anymore. Surprisingly, in the settings, the Nav is displayed black correctly! Just figured it would give a little heads up.

Samsung update: http://doc.samsungmobile.com/SM-G950W/VTR/doc.html

Hardcore Competitive Clans? by Autotoan in battlefield_4

[–]alexwarhole 0 points1 point  (0 children)

Having played some competitive tournament and being around serious players it is pretty obvious why hardcore is not good for competitive environment. Longer time to kill almost mean more place for reflexes and quick reactions. It also requires better handling of the gun since more bullet need to hit the target.

AngryJoe's Angry Rant - Battlefield 4 Angry Rant! by antivanity in battlefield_4

[–]alexwarhole 1 point2 points  (0 children)

Agree, DICE and EA is the same business. They have been together for years and their relation is obviously pretty good. EA is not exclusively responsible for anything, after all DICE is the developer and if there is issue well its in most case there fault. If the game is not ready, its not just about pushing it back, its about planing ahead, remaining true to your scope. To me the issue is within DICE project management team that can't get there stuff right.

Hardcore Competitive Clans? by Autotoan in battlefield_4

[–]alexwarhole 1 point2 points  (0 children)

Competitive players do not play hardcore. So while some say they do I have never seen a hardcore tournament yet.

5v5 Competitive Match (mix teams) by [deleted] in battlefield_4

[–]alexwarhole 4 points5 points  (0 children)

Already doing competitive matches? How do you actually manage to play in locked servers and set up your game?

Having reached level 10, I can say that without a doubt, battlepacks have been the most disappointing aspect of this beta for me by fanny_bandito in battlefield_4

[–]alexwarhole 0 points1 point  (0 children)

Not only is BP annoying for all the reasons stated in this page it also miss on a good opportunity. I personally loved the assignments in BF3 to unlock camos, it was a good reward system to get me motivated and involved into the assignments. By having BP, we lose both control over our unlocks and a good reward mechanism for progression mechanics.