mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-11-08 07:21:18 +08:00
fix(sidebar): ui tweaks to narrow sidebar
This commit is contained in:
parent
a0a3247815
commit
8475afbbfb
4 changed files with 43 additions and 8 deletions
|
|
@ -61,6 +61,10 @@ body.platform-win32 {
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sidebar-section {
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.sheet-toolbar {
|
.sheet-toolbar {
|
||||||
|
|
@ -652,6 +656,9 @@ body.platform-win32 {
|
||||||
.sidebar-participant-picker {
|
.sidebar-participant-picker {
|
||||||
padding: 10px 5px 20px 5px;
|
padding: 10px 5px 20px 5px;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
|
select {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.column-MessageListSidebar {
|
.column-MessageListSidebar {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
import _ from 'underscore'
|
import _ from 'underscore'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {shell} from 'electron'
|
import {shell} from 'electron'
|
||||||
import {Utils} from 'nylas-exports'
|
import {DOMUtils, Utils} from 'nylas-exports'
|
||||||
import {RetinaImg} from 'nylas-component-kit'
|
import {RetinaImg} from 'nylas-component-kit'
|
||||||
import ParticipantProfileStore from './participant-profile-store'
|
import ParticipantProfileStore from './participant-profile-store'
|
||||||
|
|
||||||
|
|
@ -78,8 +78,8 @@ export default class SidebarParticipantProfile extends React.Component {
|
||||||
_renderCorePersonalInfo() {
|
_renderCorePersonalInfo() {
|
||||||
return (
|
return (
|
||||||
<div className="core-personal-info">
|
<div className="core-personal-info">
|
||||||
<div className="full-name">{this.props.contact.fullName()}</div>
|
<div className="selectable full-name" onClick={this._select}>{this.props.contact.fullName()}</div>
|
||||||
<div className="email">{this.props.contact.email}</div>
|
<div className="selectable email" onClick={this._select}>{this.props.contact.email}</div>
|
||||||
<div className="social-profiles-wrap">{this._renderSocialProfiles()}</div>
|
<div className="social-profiles-wrap">{this._renderSocialProfiles()}</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
@ -115,14 +115,14 @@ export default class SidebarParticipantProfile extends React.Component {
|
||||||
title = <span>{this.state.title}, </span>
|
title = <span>{this.state.title}, </span>
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<p className="current-job">{title}{this.state.employer}</p>
|
<p className="selectable current-job">{title}{this.state.employer}</p>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
_renderBio() {
|
_renderBio() {
|
||||||
if (!this.state.bio) { return false; }
|
if (!this.state.bio) { return false; }
|
||||||
return (
|
return (
|
||||||
<p className="bio">{this.state.bio}</p>
|
<p className="selectable bio">{this.state.bio}</p>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -132,12 +132,25 @@ export default class SidebarParticipantProfile extends React.Component {
|
||||||
<p className="location">
|
<p className="location">
|
||||||
<RetinaImg url={`nylas://participant-profile/assets/location-icon@2x.png`}
|
<RetinaImg url={`nylas://participant-profile/assets/location-icon@2x.png`}
|
||||||
mode={RetinaImg.Mode.ContentPreserve}
|
mode={RetinaImg.Mode.ContentPreserve}
|
||||||
style={{marginRight: 10}} />
|
style={{float: "left"}} />
|
||||||
{this.state.location}
|
<span className="selectable" style={{display: "block", marginLeft: 20}}>{this.state.location}</span>
|
||||||
</p>
|
</p>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_select(event) {
|
||||||
|
const el = event.target;
|
||||||
|
const sel = document.getSelection()
|
||||||
|
if (el.contains(sel.anchorNode) && !sel.isCollapsed) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const anchor = DOMUtils.findFirstTextNode(el)
|
||||||
|
const focus = DOMUtils.findLastTextNode(el)
|
||||||
|
if (anchor && focus && focus.data) {
|
||||||
|
sel.setBaseAndExtent(anchor, 0, focus, focus.data.length)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div className="participant-profile">
|
<div className="participant-profile">
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,8 @@
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: white;
|
color: white;
|
||||||
|
box-shadow: inset 0 0 1px rgba(0,0,0,0.18);
|
||||||
|
background-image: linear-gradient(to bottom, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 100%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -67,6 +69,13 @@
|
||||||
.core-personal-info {
|
.core-personal-info {
|
||||||
padding-top: 30px;
|
padding-top: 30px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
|
.full-name, .email {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
.full-name {
|
.full-name {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
@ -93,9 +102,12 @@
|
||||||
|
|
||||||
body.platform-win32 {
|
body.platform-win32 {
|
||||||
.participant-profile {
|
.participant-profile {
|
||||||
* {
|
border-radius: 0;
|
||||||
|
.profile-photo {
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
.related-threads {
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,9 @@ input, textarea, div[contenteditable], {
|
||||||
user-select: auto;
|
user-select: auto;
|
||||||
}
|
}
|
||||||
.selectable {
|
.selectable {
|
||||||
|
&:hover {
|
||||||
|
cursor: text;
|
||||||
|
}
|
||||||
-webkit-user-select: auto;
|
-webkit-user-select: auto;
|
||||||
user-select: auto;
|
user-select: auto;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue