Skip to content

Commit

Permalink
refactor: show number of elements in message
Browse files Browse the repository at this point in the history
  • Loading branch information
ph1p committed Jan 25, 2020
1 parent 0d63940 commit a98f3a8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ const Head = styled.div`
display: grid;
grid-template-columns: auto 1fr auto;
width: 100%;
.back-button,
.left {
cursor: pointer;
}
Expand All @@ -56,8 +55,6 @@ const Head = styled.div`
font-weight: bold;
align-self: center;
}
.right {
}
.icon {
cursor: pointer;
}
Expand Down
8 changes: 5 additions & 3 deletions src/components/message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ interface Props {
const Message: FunctionComponent<Props> = ({ data, instanceId }) => {
const username = data.user.name || '';
const colorClass = colors[data.user.color] || 'blue';
const selection = data?.message?.selection;

return (
<MessageContainer
Expand All @@ -25,17 +26,18 @@ const Message: FunctionComponent<Props> = ({ data, instanceId }) => {
</div>
)}
</MessageHeader>
{data.message.selection ? (
{selection ? (
<span
onClick={() =>
sendMainMessage('focus-nodes', {
ids: data.message.selection
ids: selection
})
}
>
{data.message.text}
<button className="selection button button--secondary">
attached elements
attached {selection.length} element
{selection.length > 1 ? 's' : ''}
</button>
</span>
) : (
Expand Down
1 change: 1 addition & 0 deletions src/views/minimized.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const Maximize = styled.div`
}
}
`;

const Minimized = styled.div`
display: grid;
text-align: center;
Expand Down

0 comments on commit a98f3a8

Please sign in to comment.