Skip to content

Conversation UI #81

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

Closed
wants to merge 17 commits into from
Closed

Conversation UI #81

wants to merge 17 commits into from

Conversation

arjunkalburgi
Copy link
Contributor

@arjunkalburgi arjunkalburgi commented Sep 21, 2021

Todo

  • header expand view
  • change font-family to sans-serif
  • time/date stuff
  • avatars - FirstLast if avail, else first letter of email.
  • ?error message - Shashaank redesigning
  • tablet and desktop breakpoint

image

Readiness checklist

  • [] Cypress tests passing?
  • [] New cypress tests added?
  • [] Included before/after screenshots, if the change is visual

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@vercel
Copy link

vercel bot commented Sep 21, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nylas/components/E5PCF2u5hd8nuAqf3udEXk9gE6jM
✅ Preview: https://components-git-ak-ch69383conversation-ui-nylas.vercel.app

@shortcut-integration
Copy link

This pull request has been linked to Shortcut Story #69383: Conversation Component UI Updates.

Copy link
Contributor

@philrenaud philrenaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple comments/questions remaining, and some type-check failures worth addressing before merge please

</button>
{/if}
{#if headerExpanded}
{#each reply.to.splice(1, reply.to.length - 1) as contact}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you expand on what this is doing? Alternatively: set this as a variable and each over that variable, so we'd have a name like "uniqueParticipants" or something equivalent

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll note that I have a slight aversion to using splice in template logic -- it is mutative and sometimes prone to side-effects. I wonder if there's another way here.

Copy link
Contributor Author

@arjunkalburgi arjunkalburgi Sep 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right I should be using slice! All I'm doing here is grabbing the rest of the reply.to array. The first entry is shown above, when the dropdown button is clicked they need to all be shown

<header class="mobile" class:expanded={headerExpanded}>
  <span>to: {reply.to[0]?.email}</span> <!-- First email -->
  {#if headerExpanded}
    {#each reply.to.slice(1) as contact} <!-- Rest of them -->
      <span>to: {contact.email}</span>

return date
.toLocaleTimeString()
.replaceAll(/:\d{1,2} /g, "")
.replaceAll(/.m./g, "m");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can do

.toLocaleTimeString([], {
                timeStyle: "short",
              })

here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the /.m replace doing?

Copy link
Contributor Author

@arjunkalburgi arjunkalburgi Sep 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ou very cool thanky ou!!

the replace gets rid of the periods

date.toLocaleTimeString([], {timeStyle: "short"})
> "11:06 a.m."
.replaceAll(/.m./g, "m");
> "11:06 am"

I'll simplyfy to

.replaceAll(/\./g, "")

Comment on lines +4 to +5
.toLocaleTimeString([], { timeStyle: "short" })
.replaceAll(/\./g, "");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix for above is to upgrade typescript microsoft/TypeScript#38266 (comment)

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.

2 participants