1
0

fix multicolumns

This commit is contained in:
whippyshou 2023-11-04 16:07:54 +09:00
parent e36d377509
commit 9e16c075cf
12 changed files with 39 additions and 39 deletions

View File

@ -27,12 +27,20 @@ import NavigationContainer from './containers/navigation_container';
import SearchContainer from './containers/search_container';
import SearchResultsContainer from './containers/search_results_container';
import { fetchServer, fetchExtendedDescription, fetchDomainBlocks } from 'mastodon/actions/server';
const messages = defineMessages({
start: { id: 'getting_started.heading', defaultMessage: 'Getting started' },
home_timeline: { id: 'tabs_bar.home', defaultMessage: 'Home' },
notifications: { id: 'tabs_bar.notifications', defaultMessage: 'Notifications' },
public: { id: 'navigation_bar.public_timeline', defaultMessage: 'Federated timeline' },
firehose: { id: 'column.firehose', defaultMessage: 'Live feeds' },
community: { id: 'navigation_bar.community_timeline', defaultMessage: 'Local timeline' },
admin: { id: 'navigation_bar.admin', defaultMessage: 'Admin' },
conversations: { id: 'navigation_bar.conversations', defaultMessage: 'conversations' },
preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' },
logout: { id: 'navigation_bar.logout', defaultMessage: 'Logout' },
compose: { id: 'navigation_bar.compose', defaultMessage: 'Compose new post' },
@ -41,6 +49,7 @@ const messages = defineMessages({
});
const mapStateToProps = (state, ownProps) => ({
server: state.getIn(['server', 'server']),
columns: state.getIn(['settings', 'columns']),
showSearch: ownProps.multiColumn ? state.getIn(['search', 'submitted']) && !state.getIn(['search', 'hidden']) : false,
});
@ -48,6 +57,7 @@ const mapStateToProps = (state, ownProps) => ({
class Compose extends PureComponent {
static propTypes = {
server: ImmutablePropTypes.map,
dispatch: PropTypes.func.isRequired,
columns: ImmutablePropTypes.list.isRequired,
multiColumn: PropTypes.bool,
@ -55,8 +65,11 @@ class Compose extends PureComponent {
intl: PropTypes.object.isRequired,
};
componentDidMount () {
const { dispatch } = this.props;
dispatch(fetchServer());
dispatch(fetchExtendedDescription());
dispatch(mountCompose());
}
@ -96,23 +109,25 @@ class Compose extends PureComponent {
const { multiColumn, showSearch, intl } = this.props;
if (multiColumn) {
const { columns } = this.props;
const { columns, server } = this.props;
const username = server.getIn(['contact', 'account', 'acct'])
return (
<div className='drawer' role='region' aria-label={intl.formatMessage(messages.compose)}>
<nav className='drawer__header'>
<Link to='/getting-started' className='drawer__tab' title={intl.formatMessage(messages.start)} aria-label={intl.formatMessage(messages.start)}><Icon id='bars' fixedWidth /></Link>
{!columns.some(column => column.get('id') === 'HOME') && (
{(
<Link to='/home' className='drawer__tab' title={intl.formatMessage(messages.home_timeline)} aria-label={intl.formatMessage(messages.home_timeline)}><Icon id='home' fixedWidth /></Link>
)}
{!columns.some(column => column.get('id') === 'NOTIFICATIONS') && (
{ (
<Link to='/notifications' className='drawer__tab' title={intl.formatMessage(messages.notifications)} aria-label={intl.formatMessage(messages.notifications)}><Icon id='bell' fixedWidth /></Link>
)}
{!columns.some(column => column.get('id') === 'COMMUNITY') && (
<Link to='/public/local' className='drawer__tab' title={intl.formatMessage(messages.community)} aria-label={intl.formatMessage(messages.community)}><Icon id='users' fixedWidth /></Link>
{(
<Link to='/local' className='drawer__tab' title={intl.formatMessage(messages.firehose)} aria-label={intl.formatMessage(messages.firehose)}><Icon id='hashtag' fixedWidth /></Link>
)}
{!columns.some(column => column.get('id') === 'PUBLIC') && (
<Link to='/public' className='drawer__tab' title={intl.formatMessage(messages.public)} aria-label={intl.formatMessage(messages.public)}><Icon id='globe' fixedWidth /></Link>
{(
<Link to={`/@${username}`} className='drawer__tab' title={intl.formatMessage(messages.admin)} aria-label={intl.formatMessage(messages.admin)}><Icon id='info-circle' fixedWidth /></Link>
)}
<a href='/settings/preferences' className='drawer__tab' title={intl.formatMessage(messages.preferences)} aria-label={intl.formatMessage(messages.preferences)}><Icon id='cog' fixedWidth /></a>
<a href='/auth/sign_out' className='drawer__tab' title={intl.formatMessage(messages.logout)} aria-label={intl.formatMessage(messages.logout)} onClick={this.handleLogoutClick}><Icon id='sign-out' fixedWidth /></a>
@ -126,9 +141,6 @@ class Compose extends PureComponent {
<ComposeFormContainer autoFocus={!isMobile(window.innerWidth)} />
<div className='drawer__inner__mastodon'>
<img alt='' draggable='false' src={mascot || elephantUIPlane} />
</div>
</div>
<Motion defaultStyle={{ x: -100 }} style={{ x: spring(showSearch ? 0 : -100, { stiffness: 210, damping: 20 }) }}>

View File

@ -80,7 +80,7 @@ class DirectTimeline extends PureComponent {
return (
<Column bindToDocument={!multiColumn} ref={this.setRef} label={intl.formatMessage(messages.title)}>
<ColumnHeader
icon='at'
icon='envelope'
active={hasUnread}
title={intl.formatMessage(messages.title)}
onPin={this.handlePin}

View File

@ -24,6 +24,7 @@ import TrendsContainer from './containers/trends_container';
const messages = defineMessages({
home_timeline: { id: 'tabs_bar.home', defaultMessage: 'Home' },
notifications: { id: 'tabs_bar.notifications', defaultMessage: 'Notifications' },
firehose: { id: 'column.firehose', defaultMessage: 'Live feeds' },
public_timeline: { id: 'navigation_bar.public_timeline', defaultMessage: 'Federated timeline' },
settings_subheading: { id: 'column_subheading.settings', defaultMessage: 'Settings' },
community_timeline: { id: 'navigation_bar.community_timeline', defaultMessage: 'Local timeline' },
@ -107,15 +108,15 @@ class GettingStarted extends ImmutablePureComponent {
}
navItems.push(
<ColumnLink key='community_timeline' icon='users' text={intl.formatMessage(messages.community_timeline)} to='/public/local' />,
<ColumnLink key='public_timeline' icon='globe' text={intl.formatMessage(messages.public_timeline)} to='/public' />,
<ColumnLink key='community_timeline' icon='hashtag' text={intl.formatMessage(messages.firehose)} to='/local' />,
// <ColumnLink key='public_timeline' icon='globe' text={intl.formatMessage(messages.public_timeline)} to='/public' />,
);
if (signedIn) {
navItems.push(
<ColumnSubheading key='header-personal' text={intl.formatMessage(messages.personal)} />,
<ColumnLink key='home' icon='home' text={intl.formatMessage(messages.home_timeline)} to='/home' />,
<ColumnLink key='direct' icon='at' text={intl.formatMessage(messages.direct)} to='/conversations' />,
<ColumnLink key='direct' icon='envelope' text={intl.formatMessage(messages.direct)} to='/conversations' />,
<ColumnLink key='bookmark' icon='bookmark' text={intl.formatMessage(messages.bookmarks)} to='/bookmarks' />,
<ColumnLink key='favourites' icon='star' text={intl.formatMessage(messages.favourites)} to='/favourites' />,
<ColumnLink key='lists' icon='list-ul' text={intl.formatMessage(messages.lists)} to='/lists' />,

View File

@ -26,21 +26,5 @@ export const ExplorePrompt = () => (
/>
</p>
<div className='dismissable-banner__message__wrapper'>
<div className='dismissable-banner__message__actions'>
<Link to='/explore' className='button'>
<FormattedMessage
id='home.actions.go_to_explore'
defaultMessage="See what's trending"
/>
</Link>
<Link to='/explore/suggestions' className='button button-tertiary'>
<FormattedMessage
id='home.actions.go_to_suggestions'
defaultMessage='Find people to follow'
/>
</Link>
</div>
</div>
</DismissableBanner>
);

View File

@ -7,7 +7,6 @@ import { Link } from 'react-router-dom';
import { WordmarkLogo } from 'mastodon/components/logo';
import NavigationPortal from 'mastodon/components/navigation_portal';
import { timelinePreview, trendsEnabled } from 'mastodon/initial_state';
import { transientSingleColumn } from 'mastodon/is_mobile';
import ColumnLink from './column_link';

View File

@ -196,16 +196,15 @@ class SwitchingColumnsArea extends PureComponent {
<WrappedRoute path='/privacy-policy' component={PrivacyPolicy} content={children} />
<WrappedRoute path={['/home', '/timelines/home']} component={HomeTimeline} content={children} />
<Redirect from='/timelines/public' to='/public' exact />
{/* <Redirect from='/timelines/public' to='/public' exact />
<Redirect from='/timelines/public/local' to='/public/local' exact />
<WrappedRoute path='/public' exact component={Firehose} componentParams={{ feedType: 'public' }} content={children} />
<WrappedRoute path='/public/local' exact component={Firehose} componentParams={{ feedType: 'community' }} content={children} />
*/}
<Redirect from='/timelines/local' to='/local' exact />
<WrappedRoute path='/local' exact component={LocalTimeline} content={children} />
<WrappedRoute path={['/conversations', '/timelines/direct']} component={DirectTimeline} content={children} />
<WrappedRoute path='/tags/:id' component={HashtagTimeline} content={children} />
<WrappedRoute path='/lists/:id' component={ListTimeline} content={children} />
@ -217,7 +216,7 @@ class SwitchingColumnsArea extends PureComponent {
<WrappedRoute path='/direct_messages' component={SendDirectMessagesStatuses} content={children} />
<WrappedRoute path='/start' exact component={Onboarding} content={children} />
<WrappedRoute path='/directory' component={Directory} content={children} />
{/* <WrappedRoute path='/directory' component={Directory} content={children} /> */}
{/* <WrappedRoute path={['/explore', '/search']} component={Explore} content={children} /> */}
<WrappedRoute path={['/publish', '/statuses/new']} component={Compose} content={children} />

View File

@ -404,6 +404,7 @@
"moved_to_account_banner.text": "Your account {disabledAccount} is currently disabled because you moved to {movedToAccount}.",
"mute_modal.duration": "Duration",
"mute_modal.hide_notifications": "Hide notifications from this user?",
"navigation_bar.admin": "Admin",
"mute_modal.indefinite": "Indefinite",
"navigation_bar.about": "About",
"navigation_bar.advanced_interface": "Open in advanced web interface",
@ -417,6 +418,7 @@
"navigation_bar.edit_profile": "Edit profile",
"navigation_bar.explore": "Explore",
"navigation_bar.favourites": "Favorites",
"navigation_bar.conversations": "Dircet Message",
"navigation_bar.filters": "Muted words",
"navigation_bar.follow_requests": "Follow requests",
"navigation_bar.followed_tags": "Followed hashtags",

View File

@ -313,7 +313,7 @@
"home.column_settings.show_replies": "답글 표시",
"local.column_settings.basic": "실시간 피드",
"local.column_settings.show_media": "미디어만",
"home.explore_prompt.body": "홈 피드에는 내가 팔로우한 해시태그 그리고 팔로우한 사람과 부스트가 함께 나타납니다. 너무 고요하게 느껴진다면, 다음 것들을 살펴볼 수 있습니다.",
"home.explore_prompt.body": "홈 피드에는 내가 팔로우한 해시태그 그리고 팔로우한 사람과 부스트가 함께 나타납니다.",
"home.explore_prompt.title": "이곳은 마스토돈의 내 본거지입니다.",
"local.explore_prompt.body": "실시간 피드에는 {title}에 있는 사람들의 답장이 아닌 최근 게시글을 살펴볼 수 있습니다.",
@ -405,6 +405,7 @@
"mute_modal.duration": "기간",
"mute_modal.hide_notifications": "이 사용자로부터의 알림을 숨기시겠습니까?",
"mute_modal.indefinite": "무기한",
"navigation_bar.admin": "관리자",
"navigation_bar.about": "정보",
"navigation_bar.advanced_interface": "고급 웹 인터페이스에서 열기",
"navigation_bar.blocks": "차단한 사용자",
@ -427,6 +428,7 @@
"navigation_bar.opened_in_classic_interface": "게시물, 계정, 기타 특정 페이지들은 기본적으로 기존 웹 인터페이스로 열리게 됩니다.",
"navigation_bar.personal": "개인용",
"navigation_bar.pins": "고정된 게시물",
"navigation_bar.conversations": "다이렉트 메시지",
"navigation_bar.directMessages": "보낸 다이렉트 메시지",
"navigation_bar.preferences": "환경설정",
"navigation_bar.public_timeline": "연합 타임라인",

View File

@ -120,6 +120,7 @@ const defaultColumns = fromJS([
{ id: 'COMPOSE', uuid: uuid(), params: {} },
{ id: 'HOME', uuid: uuid(), params: {} },
{ id: 'NOTIFICATIONS', uuid: uuid(), params: {} },
{ id: 'DIRECT', uuid: uuid(), params: {} }
]);
const hydrate = (state, settings) => state.mergeDeep(settings).update('columns', (val = defaultColumns) => val);

View File

@ -1,2 +1,3 @@
@import 'application';
@import 'mastodon-bird-ui-vanilla/layout-single-column.scss';
@import 'mastodon-bird-ui-vanilla/layout-multiple-columns.scss';

View File

@ -2,3 +2,4 @@
@import 'application';
@import 'mastodon-light/diff';
@import 'mastodon-bird-ui-vanilla/layout-single-column.scss';
@import 'mastodon-bird-ui-vanilla/layout-multiple-columns.scss';

View File

@ -10,7 +10,6 @@ Rails.application.routes.draw do
/getting-started
/keyboard-shortcuts
/home
/public/local
/conversations
/lists/(*any)
/notifications
@ -18,7 +17,6 @@ Rails.application.routes.draw do
/bookmarks
/pinned
/start
/directory
/search
/publish
/follow_requests