email compose
This commit is contained in:
parent
2af0724938
commit
f95901d596
6 changed files with 639 additions and 274 deletions
|
|
@ -34,6 +34,7 @@ export default function RecipientField({
|
|||
orgDomain,
|
||||
onFocus,
|
||||
autoFocus = false,
|
||||
inline = false,
|
||||
}) {
|
||||
const [input, setInput] = useState("");
|
||||
const [open, setOpen] = useState(false);
|
||||
|
|
@ -134,8 +135,8 @@ export default function RecipientField({
|
|||
}
|
||||
|
||||
return (
|
||||
<div className="compose-recipient-field" ref={wrapRef}>
|
||||
<span className="compose-recipient-label">{label}</span>
|
||||
<div className={`compose-recipient-field${inline ? " inline" : ""}`} ref={wrapRef}>
|
||||
{label ? <span className="compose-recipient-label">{label}</span> : null}
|
||||
<div className="compose-recipient-chips" onClick={() => inputRef.current?.focus()}>
|
||||
{recipients.map((recipient, index) => (
|
||||
<span
|
||||
|
|
@ -169,13 +170,13 @@ export default function RecipientField({
|
|||
onBlur={() => {
|
||||
if (input.trim()) commitInput();
|
||||
}}
|
||||
placeholder={recipients.length ? "" : "Recipients"}
|
||||
placeholder={recipients.length ? "" : (inline ? "" : "Recipients")}
|
||||
autoComplete="off"
|
||||
spellCheck={false}
|
||||
/>
|
||||
</div>
|
||||
{open && filtered.length > 0 && (
|
||||
<ul className="compose-recipient-suggestions" role="listbox">
|
||||
<ul className="compose-recipient-suggestions" role="listbox" style={inline ? { left: 0 } : undefined}>
|
||||
{filtered.map((item, index) => (
|
||||
<li key={item.email || item.name} role="option" aria-selected={index === highlight}>
|
||||
<button
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue