Skip to content

Commit

Permalink
HF 30 - Private groups - Small fixes in stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
1aerostorm committed Aug 6, 2024
1 parent d7f1d58 commit 18e641d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
11 changes: 9 additions & 2 deletions src/components/elements/Stub.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ class StubInner extends React.Component {
</div>
} else {
return <div className='msgs-stub'>
{text}{btn}
<center>
{text}{btn}
</center>
</div>
}
}
Expand Down Expand Up @@ -102,7 +104,12 @@ export default Stub

export const renderStubs = (the_group, to, username) => {
let composeStub, msgsStub
if (!the_group || the_group.name !== to) {
if (!the_group) {
const isGroup = to && !to.startsWith('@')
if (isGroup) composeStub = { disabled: true }
return { composeStub, msgsStub}
}
if (the_group.name !== to) {
return { composeStub, msgsStub}
}

Expand Down
19 changes: 14 additions & 5 deletions src/components/elements/Stub.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,20 @@
padding-left: 0.5rem;
padding-right: 0.5rem;
padding-bottom: 0.5rem;
}

.message-list-container {
.msgs-stub {
position: absolute;
top: 50%;
transform: translateY(-50%);
padding: 1rem;
}
}

.stub-btn {
white-space: nowrap;
&.alert {
color: red;
}
.stub-btn {
white-space: nowrap;
&.alert {
color: red;
}
}
1 change: 1 addition & 0 deletions src/components/modules/messages/Messenger/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export default class Messages extends React.Component {
<Dropzone
className='messenger-dropzone'
noClick
noKeyboard
multiple={false}
accept='image/*'
disabled={!to}
Expand Down

0 comments on commit 18e641d

Please sign in to comment.