links, publish: remove create group toggle

This commit is contained in:
Matilde Park 2020-07-15 16:29:24 -04:00
parent fdf9826b05
commit e1e72fdbd1
2 changed files with 18 additions and 67 deletions

View File

@ -23,7 +23,6 @@ export class NewScreen extends Component {
this.titleChange = this.titleChange.bind(this);
this.descriptionChange = this.descriptionChange.bind(this);
this.setInvite = this.setInvite.bind(this);
this.createGroupChange = this.createGroupChange.bind(this);
}
componentDidUpdate(prevProps, prevState) {
@ -59,12 +58,6 @@ export class NewScreen extends Component {
});
}
createGroupChange(event) {
this.setState({
createGroup: Boolean(event.target.checked)
});
}
onClickCreate() {
const { props, state } = this;
@ -136,10 +129,6 @@ export class NewScreen extends Component {
render() {
const { props, state } = this;
const createGroupClasses = state.createGroup
? 'relative checked bg-green2 br3 h1 toggle v-mid z-0'
: 'relative bg-gray4 bg-gray1-d br3 h1 toggle v-mid z-0';
const createClasses = state.idName
? 'pointer db f9 mt7 green2 bg-gray0-d ba pv3 ph4 b--green2'
: 'pointer db f9 mt7 gray2 ba bg-gray0-d pa2 pv3 ph4 b--gray3';
@ -157,24 +146,6 @@ export class NewScreen extends Component {
);
}
let createGroupToggle = <div />;
if (state.groups.length === 0) {
createGroupToggle = (
<div className="mt7">
<input
type="checkbox"
style={{ WebkitAppearance: 'none', width: 28 }}
className={createGroupClasses}
onChange={this.createGroupChange}
/>
<span className="dib f9 white-d inter ml3">Create Group</span>
<p className="f9 gray2 pt1" style={{ paddingLeft: 40 }}>
Participants will share this group across applications
</p>
</div>
);
}
return (
<div
className={
@ -211,13 +182,16 @@ export class NewScreen extends Component {
}}
onChange={this.descriptionChange}
/>
<p className="f8 mt4 lh-copy db">
Invite
<span className="gray3"> (Optional)</span>
<div className="mt4 db relative">
<p className="f8">
Invite
<span className="gray3"> (Optional)</span>
</p>
<p className="f9 gray2 db mb2 pt1">
Selected groups or ships will be able to post to collection
<Link className="green2 absolute right-0 bottom-0 f9" to="/~groups/new">Create Group</Link>
<p className="f9 gray2 db mv1">
Selected group or ships will be invited to the collection
</p>
</div>
<InviteSearch
associations={props.associations.contacts}
groups={props.groups}
@ -230,7 +204,6 @@ export class NewScreen extends Component {
}}
setInvite={this.setInvite}
/>
{createGroupToggle}
<button
onClick={this.onClickCreate.bind(this)}
className={createClasses}

View File

@ -23,7 +23,6 @@ export class NewScreen extends Component {
this.idChange = this.idChange.bind(this);
this.descriptionChange = this.descriptionChange.bind(this);
this.setInvite = this.setInvite.bind(this);
this.createGroupChange = this.createGroupChange.bind(this);
}
componentDidUpdate(prevProps) {
@ -48,10 +47,6 @@ export class NewScreen extends Component {
});
}
createGroupChange(event) {
this.setState({ createGroup: Boolean(event.target.checked) });
}
setInvite(value) {
this.setState({ invites: value });
}
@ -99,31 +94,12 @@ export class NewScreen extends Component {
}
render() {
const createGroupClasses = this.state.createGroup
? 'relative checked bg-green2 br3 h1 toggle v-mid z-0'
: 'relative bg-gray4 bg-gray1-d br3 h1 toggle v-mid z-0';
let createClasses = 'pointer db f9 green2 bg-gray0-d ba pv3 ph4 mv7 b--green2';
if (!this.state.idName || this.state.disabled) {
createClasses = 'db f9 gray2 ba bg-gray0-d pa2 pv3 ph4 mv7 b--gray3';
}
const createGroupToggle =
!((this.state.invites.ships.length > 0) && (this.state.invites.groups.length === 0))
? null
: <div className="mv7">
<input
type="checkbox"
style={{ WebkitAppearance: 'none', width: 28 }}
className={createGroupClasses}
onChange={this.createGroupChange}
/>
<span className="dib f9 white-d inter ml3">Create Group</span>
<p className="f9 gray2 pt1" style={{ paddingLeft: 40 }}>
Participants will share this group across applications
</p>
</div>;
let idErrElem = <span />;
if (this.state.idError) {
idErrElem = (
@ -182,14 +158,17 @@ export class NewScreen extends Component {
onChange={this.descriptionChange}
value={this.state.description}
/>
<p className="f8 mt4 lh-copy db">
Invite
<span className="gray3 ml1">(Optional)</span>
</p>
<p className="f9 gray2 db mb2 pt1">
Selected ships will be invited to read your notebook. Selected
groups will be invited to read and write notes.
<div className="mt4 db relative">
<p className="f8">
Invite
<span className="gray3"> (Optional)</span>
</p>
<Link className="green2 absolute right-0 bottom-0 f9" to="/~groups/new">Create Group</Link>
<p className="f9 gray2 db mv1 pb4">
Selected ships will be invited to read your notebook. Selected
groups will be invited to read and write notes.
</p>
</div>
<InviteSearch
associations={this.props.associations}
groupResults={true}
@ -199,7 +178,6 @@ export class NewScreen extends Component {
invites={this.state.invites}
setInvite={this.setInvite}
/>
{createGroupToggle}
<button
disabled={this.state.disabled}
onClick={this.onClickCreate.bind(this)}