Skip to content
This repository has been archived by the owner on Jan 27, 2020. It is now read-only.

Commit

Permalink
Merge pull request mastodon#774 from pixiv/form
Browse files Browse the repository at this point in the history
Fix intent
  • Loading branch information
abcang authored Dec 28, 2017
2 parents 62a61ab + 2ef5e55 commit 9a8b3f2
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 27 deletions.
3 changes: 0 additions & 3 deletions app/javascript/pawoo_music/components/intent/index.js

This file was deleted.

15 changes: 0 additions & 15 deletions app/javascript/pawoo_music/components/intent/intent.js

This file was deleted.

12 changes: 7 additions & 5 deletions app/javascript/pawoo_music/components/timeline/timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default class Timeline extends PureComponent {
static propTypes = {
target: PropTypes.string.isRequired,
children: PropTypes.node,
gallery: PropTypes.node.isRequired,
gallery: PropTypes.node,
galleryStyle: PropTypes.object,
}

Expand All @@ -28,12 +28,14 @@ export default class Timeline extends PureComponent {
<div className='navigation-column'>
<GlobalNaviContainer />
</div>
<div className='lobby-column'>
<div className={classNames('lobby-column', { 'with-gallery': gallery })}>
{children}
</div>
<div className='gallery-column' style={galleryStyle}>
{gallery}
</div>
{gallery && (
<div className='gallery-column' style={galleryStyle}>
{gallery}
</div>
)}
</div>
);
}
Expand Down
6 changes: 5 additions & 1 deletion app/javascript/pawoo_music/components/timeline/timeline.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

.lobby-column {
flex-shrink: 0;
flex-grow: 0;
flex-grow: 1;
width: var(--width-lobby);

display: flex;
Expand Down Expand Up @@ -107,6 +107,10 @@
}
}
}

&.with-gallery {
flex-grow: 0;
}
}

.gallery-column {
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/pawoo_music/containers/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import PublicTimelineContainer from '../public_timeline';
import HashtagTimelineContainer from '../hashtag_timeline';
import AccountGalleryContainer from '../account_gallery';
import FavouritedStatusesContainer from '../favourited_statuses';
import Intent from '../../components/intent';
import IntentContainer from '../../containers/intent';
import LoadingBarContainer from '../../../mastodon/features/ui/containers/loading_bar_container';
import NotificationsContainer from '../../../mastodon/features/ui/containers/notifications_container';
import AccountFollowersContainer from '../account_followers';
Expand Down Expand Up @@ -144,7 +144,7 @@ export default class App extends PureComponent {
const routes = (
<Switch>
<Route path='/' exact component={HomeTimelineContainer} />
<Route path='/share' exact component={Intent} />
<Route path='/share' exact component={IntentContainer} />
<Route path='/notifications' component={NotificationTimelineContainer} />
<Route path='/timelines/public/local' component={CommunityTimelineContainer} />
<Route path='/timelines/public' exact component={PublicTimelineContainer} />
Expand Down
4 changes: 4 additions & 0 deletions app/javascript/pawoo_music/containers/intent/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import IntentContainer from './intent';
import './intent.scss';

export default IntentContainer;
30 changes: 30 additions & 0 deletions app/javascript/pawoo_music/containers/intent/intent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import PropTypes from 'prop-types';
import React from 'react';
import { connect } from 'react-redux';
import AccountContainer from '../account';
import StatusFormContainer from '../status_form';
import Timeline from '../../components/timeline';

const mapStateToProps = (state) => ({
me: state.getIn(['meta', 'me']),
});

@connect(mapStateToProps)
export default class IntentContainer extends React.PureComponent {

static propTypes = {
me: PropTypes.number,
};

render () {
return (
<Timeline>
<div className='intent'>
<AccountContainer id={this.props.me} />
<StatusFormContainer />
</div>
</Timeline>
);
}

}
4 changes: 4 additions & 0 deletions app/javascript/pawoo_music/containers/intent/intent.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.intent {
margin: auto;
width: var(--width-gallery);
}
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@

# Remote follow
resource :authorize_follow, only: [:show, :create]
resource :share, only: [:show, :create]
get '/share', to: 'timelines#index'

namespace :admin do
resources :subscriptions, only: [:index]
Expand Down

0 comments on commit 9a8b3f2

Please sign in to comment.