Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.

Commit 24d41f0

Browse files
authored
Merge pull request #4740 from withspectrum/2.7.5
2.7.5
2 parents 0a9a9c0 + c32680d commit 24d41f0

File tree

8 files changed

+34
-16
lines changed

8 files changed

+34
-16
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Spectrum",
3-
"version": "2.7.4",
3+
"version": "2.7.5",
44
"license": "BSD-3-Clause",
55
"devDependencies": {
66
"@babel/preset-flow": "^7.0.0",

src/components/composer/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ type Props = {
9797
isInbox: boolean,
9898
websocketConnection: string,
9999
networkOnline: boolean,
100+
isEditing: boolean,
100101
};
101102

102103
const LS_BODY_KEY = 'last-plaintext-thread-composer-body';
@@ -600,6 +601,7 @@ class ComposerWithData extends Component<Props, State> {
600601
networkOnline,
601602
websocketConnection,
602603
isSlider,
604+
isEditing,
603605
} = this.props;
604606
const dataExists = user && availableCommunities && availableChannels;
605607

@@ -666,6 +668,7 @@ class ComposerWithData extends Component<Props, State> {
666668
autoFocus={!threadSliderIsOpen}
667669
bodyRef={ref => (this.bodyEditor = ref)}
668670
onKeyDown={this.handleKeyPress}
671+
isEditing={isEditing}
669672
/>
670673

671674
{networkDisabled && (

src/components/composer/inputs.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ type Props = {
2626
autoFocus?: boolean,
2727
bodyRef?: Function,
2828
onKeyDown?: Function,
29+
isEditing: boolean,
2930
};
3031

3132
export default (props: Props) => {
@@ -41,10 +42,11 @@ export default (props: Props) => {
4142
changeTitle,
4243
bodyRef,
4344
onKeyDown,
45+
isEditing,
4446
} = props;
4547

4648
return (
47-
<InputsGrid>
49+
<InputsGrid isEditing={isEditing}>
4850
<SegmentedControl
4951
css={{
5052
margin: '0',

src/components/composer/style.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,4 +299,10 @@ export const InputsGrid = styled.div`
299299
grid-area: body;
300300
overflow: hidden;
301301
overflow-y: scroll;
302+
303+
${props =>
304+
props.isEditing &&
305+
css`
306+
height: 100%;
307+
`}
302308
`;

src/views/communityLogin/index.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,12 @@ type Props = {
3535
redirectPath: ?string,
3636
};
3737

38-
export class Login extends React.Component<Props> {
39-
redirectPath = null;
38+
type State = {
39+
redirectPath: ?string,
40+
};
41+
42+
export class Login extends React.Component<Props, State> {
43+
state = { redirectPath: null };
4044

4145
escape = () => {
4246
this.props.history.push(`/${this.props.match.params.communitySlug}`);
@@ -46,15 +50,15 @@ export class Login extends React.Component<Props> {
4650
const { location, redirectPath } = this.props;
4751

4852
if (redirectPath) {
49-
this.redirectPath = redirectPath;
53+
this.setState({ redirectPath });
5054
}
5155

5256
if (location && !redirectPath) {
5357
const searchObj = queryString.parse(this.props.location.search);
54-
this.redirectPath = searchObj.r;
58+
this.setState({ redirectPath: searchObj.r });
5559
}
5660

57-
track(events.LOGIN_PAGE_VIEWED, { redirectPath: this.redirectPath });
61+
track(events.LOGIN_PAGE_VIEWED, { redirectPath: this.state.redirectPath });
5862
}
5963

6064
render() {
@@ -63,6 +67,7 @@ export class Login extends React.Component<Props> {
6367
isLoading,
6468
match,
6569
} = this.props;
70+
const { redirectPath } = this.state;
6671

6772
if (community && community.id) {
6873
const { brandedLogin } = community;
@@ -89,8 +94,7 @@ export class Login extends React.Component<Props> {
8994

9095
<LoginButtonSet
9196
redirectPath={
92-
this.redirectPath ||
93-
`${CLIENT_URL}/${match.params.communitySlug}`
97+
redirectPath || `${CLIENT_URL}/${match.params.communitySlug}`
9498
}
9599
signinType={'signin'}
96100
/>

src/views/thread/components/threadDetail.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ class ThreadDetailPure extends React.Component<Props, State> {
356356
changeBody={this.changeBody}
357357
changeTitle={this.changeTitle}
358358
onKeyDown={this.handleKeyPress}
359+
isEditing={isEditing}
359360
/>
360361
) : (
361362
<React.Fragment>

src/views/thread/container.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ class ThreadContainer extends React.Component<Props, State> {
550550
/>
551551

552552
<Content innerRef={this.setMessagesContainer}>
553-
<Detail type={slider ? '' : 'only'}>
553+
<Detail isEditing={isEditing} is type={slider ? '' : 'only'}>
554554
{this.renderPost()}
555555

556556
{!isEditing && (

src/views/thread/style.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,15 @@ export const Input = styled(FlexRow)`
9898
`;
9999

100100
export const Detail = styled(Column)`
101-
flex: 1 0 auto;
101+
min-width: 100%;
102102
margin: 0;
103-
height: 100%;
104-
max-width: 100%;
105-
max-height: 100%;
106-
position: relative;
107-
overflow-y: scroll;
103+
104+
${props =>
105+
props.isEditing &&
106+
css`
107+
height: 100%;
108+
overflow-y: scroll;
109+
`}
108110
`;
109111

110112
export const ChatInputWrapper = styled(FlexCol)`

0 commit comments

Comments
 (0)