2016-11-17 01:20:52 +09:00
import Column from '../ui/components/column' ;
2016-12-12 22:27:52 +09:00
import ColumnLink from '../ui/components/column_link' ;
2016-10-08 07:30:56 +09:00
import { Link } from 'react-router' ;
2016-12-12 22:27:52 +09:00
import { defineMessages , injectIntl , FormattedMessage } from 'react-intl' ;
import { connect } from 'react-redux' ;
2016-12-27 05:55:52 +09:00
import ImmutablePropTypes from 'react-immutable-proptypes' ;
2016-10-07 23:00:11 +09:00
2016-12-12 22:27:52 +09:00
const messages = defineMessages ( {
heading : { id : 'getting_started.heading' , defaultMessage : 'Getting started' } ,
2017-02-20 04:25:54 +09:00
public _timeline : { id : 'navigation_bar.public_timeline' , defaultMessage : 'Whole Known Network' } ,
2017-02-20 05:49:14 +09:00
community _timeline : { id : 'navigation_bar.community_timeline' , defaultMessage : 'Local timeline' } ,
2017-01-05 12:47:02 +09:00
preferences : { id : 'navigation_bar.preferences' , defaultMessage : 'Preferences' } ,
2017-01-08 08:41:57 +09:00
follow _requests : { id : 'navigation_bar.follow_requests' , defaultMessage : 'Follow requests' } ,
2017-01-16 21:27:58 +09:00
sign _out : { id : 'navigation_bar.logout' , defaultMessage : 'Sign out' } ,
2017-02-06 03:22:05 +09:00
favourites : { id : 'navigation_bar.favourites' , defaultMessage : 'Favourites' } ,
2017-02-07 07:16:20 +09:00
blocks : { id : 'navigation_bar.blocks' , defaultMessage : 'Blocked users' } ,
info : { id : 'navigation_bar.info' , defaultMessage : 'Extended information' }
2016-12-12 22:27:52 +09:00
} ) ;
const mapStateToProps = state => ( {
2016-12-27 05:55:52 +09:00
me : state . getIn ( [ 'accounts' , state . getIn ( [ 'meta' , 'me' ] ) ] )
2016-12-12 22:27:52 +09:00
} ) ;
const GettingStarted = ( { intl , me } ) => {
2016-12-27 05:55:52 +09:00
let followRequests = '' ;
if ( me . get ( 'locked' ) ) {
followRequests = < ColumnLink icon = 'users' text = { intl . formatMessage ( messages . follow _requests ) } to = '/follow_requests' / > ;
}
2016-10-07 05:47:35 +09:00
return (
2016-12-12 22:27:52 +09:00
< Column icon = 'asterisk' heading = { intl . formatMessage ( messages . heading ) } >
< div style = { { position : 'relative' } } >
2017-02-20 06:42:38 +09:00
< ColumnLink icon = 'users' text = { intl . formatMessage ( messages . community _timeline ) } to = '/timelines/public/local' / >
2016-12-12 22:27:52 +09:00
< ColumnLink icon = 'globe' text = { intl . formatMessage ( messages . public _timeline ) } to = '/timelines/public' / >
2017-01-05 12:47:02 +09:00
< ColumnLink icon = 'cog' text = { intl . formatMessage ( messages . preferences ) } href = '/settings/preferences' / >
2017-01-16 21:27:58 +09:00
< ColumnLink icon = 'star' text = { intl . formatMessage ( messages . favourites ) } to = '/favourites' / >
2016-12-27 05:55:52 +09:00
{ followRequests }
2017-02-08 07:48:50 +09:00
< ColumnLink icon = 'ban' text = { intl . formatMessage ( messages . blocks ) } to = '/blocks' / >
2017-02-07 07:16:20 +09:00
< ColumnLink icon = 'book' text = { intl . formatMessage ( messages . info ) } href = '/about/more' / >
2017-01-16 19:35:32 +09:00
< ColumnLink icon = 'sign-out' text = { intl . formatMessage ( messages . sign _out ) } href = '/auth/sign_out' method = 'delete' / >
2016-12-12 22:27:52 +09:00
< / div >
2017-01-05 11:14:33 +09:00
< div className = 'scrollable optionally-scrollable' >
< div className = 'static-content getting-started' >
< p > < FormattedMessage id = 'getting_started.about_addressing' defaultMessage = 'You can follow people if you know their username and the domain they are on by entering an e-mail-esque address into the form at the top of the sidebar.' / > < / p >
< p > < FormattedMessage id = 'getting_started.about_shortcuts' defaultMessage = 'If the target user is on the same domain as you, just the username will work. The same rule applies to mentioning people in statuses.' / > < / p >
2017-03-18 00:16:39 +09:00
< p > < FormattedMessage id = 'getting_started.open_source_notice' defaultMessage = 'Mastodon is open source software. You can contribute or report issues on github at {github}. {apps}.' values = { { github : < a href = "https://github.com/tootsuite/mastodon" target = "_blank" > tootsuite / mastodon < / a > , apps : < a href = "https://github.com/tootsuite/mastodon/blob/master/docs/Using-Mastodon/Apps.md" target = "_blank" > < FormattedMessage id = 'getting_started.apps' defaultMessage = 'Various apps are available' / > < / a > } } / > < / p >
2017-01-05 11:14:33 +09:00
< / div >
2016-10-07 23:00:11 +09:00
< / div >
< / Column >
2016-10-07 05:47:35 +09:00
) ;
} ;
2016-12-27 05:33:51 +09:00
GettingStarted . propTypes = {
intl : React . PropTypes . object . isRequired ,
2016-12-27 05:55:52 +09:00
me : ImmutablePropTypes . map . isRequired
2016-12-27 05:33:51 +09:00
} ;
2016-12-12 22:27:52 +09:00
export default connect ( mapStateToProps ) ( injectIntl ( GettingStarted ) ) ;