2016-11-17 03:20:52 +11:00
import Column from '../ui/components/column' ;
2016-12-13 00:27:52 +11:00
import ColumnLink from '../ui/components/column_link' ;
2016-10-08 09:30:56 +11:00
import { Link } from 'react-router' ;
2016-12-13 00:27:52 +11:00
import { defineMessages , injectIntl , FormattedMessage } from 'react-intl' ;
import { connect } from 'react-redux' ;
2017-04-22 04:05:35 +10:00
import PropTypes from 'prop-types' ;
2016-12-27 07:55:52 +11:00
import ImmutablePropTypes from 'react-immutable-proptypes' ;
2016-10-08 01:00:11 +11:00
2016-12-13 00:27:52 +11:00
const messages = defineMessages ( {
heading : { id : 'getting_started.heading' , defaultMessage : 'Getting started' } ,
2017-04-13 20:57:41 +10:00
public _timeline : { id : 'navigation_bar.public_timeline' , defaultMessage : 'Federated timeline' } ,
2017-02-20 07:49:14 +11:00
community _timeline : { id : 'navigation_bar.community_timeline' , defaultMessage : 'Local timeline' } ,
2017-01-05 14:47:02 +11:00
preferences : { id : 'navigation_bar.preferences' , defaultMessage : 'Preferences' } ,
2017-01-08 10:41:57 +11:00
follow _requests : { id : 'navigation_bar.follow_requests' , defaultMessage : 'Follow requests' } ,
2017-04-13 20:57:41 +10:00
sign _out : { id : 'navigation_bar.logout' , defaultMessage : 'Logout' } ,
2017-02-06 05:22:05 +11:00
favourites : { id : 'navigation_bar.favourites' , defaultMessage : 'Favourites' } ,
2017-02-07 09:16:20 +11:00
blocks : { id : 'navigation_bar.blocks' , defaultMessage : 'Blocked users' } ,
2017-04-15 09:23:49 +10:00
mutes : { id : 'navigation_bar.mutes' , defaultMessage : 'Muted users' } ,
2017-02-07 09:16:20 +11:00
info : { id : 'navigation_bar.info' , defaultMessage : 'Extended information' }
2016-12-13 00:27:52 +11:00
} ) ;
const mapStateToProps = state => ( {
2016-12-27 07:55:52 +11:00
me : state . getIn ( [ 'accounts' , state . getIn ( [ 'meta' , 'me' ] ) ] )
2016-12-13 00:27:52 +11:00
} ) ;
const GettingStarted = ( { intl , me } ) => {
2016-12-27 07:55:52 +11:00
let followRequests = '' ;
if ( me . get ( 'locked' ) ) {
followRequests = < ColumnLink icon = 'users' text = { intl . formatMessage ( messages . follow _requests ) } to = '/follow_requests' / > ;
}
2016-10-07 07:47:35 +11:00
return (
2017-04-22 02:17:55 +10:00
< Column icon = 'asterisk' heading = { intl . formatMessage ( messages . heading ) } hideHeadingOnMobile = { true } >
2017-04-23 12:26:55 +10:00
< div className = 'getting-started__wrapper' >
2017-04-22 02:17:55 +10:00
< ColumnLink icon = 'users' hideOnMobile = { true } text = { intl . formatMessage ( messages . community _timeline ) } to = '/timelines/public/local' / >
< ColumnLink icon = 'globe' hideOnMobile = { true } text = { intl . formatMessage ( messages . public _timeline ) } to = '/timelines/public' / >
2017-01-05 14:47:02 +11:00
< ColumnLink icon = 'cog' text = { intl . formatMessage ( messages . preferences ) } href = '/settings/preferences' / >
2017-01-16 23:27:58 +11:00
< ColumnLink icon = 'star' text = { intl . formatMessage ( messages . favourites ) } to = '/favourites' / >
2016-12-27 07:55:52 +11:00
{ followRequests }
2017-02-08 09:48:50 +11:00
< ColumnLink icon = 'ban' text = { intl . formatMessage ( messages . blocks ) } to = '/blocks' / >
2017-04-15 09:23:49 +10:00
< ColumnLink icon = 'volume-off' text = { intl . formatMessage ( messages . mutes ) } to = '/mutes' / >
2017-02-07 09:16:20 +11:00
< ColumnLink icon = 'book' text = { intl . formatMessage ( messages . info ) } href = '/about/more' / >
2017-01-16 21:35:32 +11:00
< ColumnLink icon = 'sign-out' text = { intl . formatMessage ( messages . sign _out ) } href = '/auth/sign_out' method = 'delete' / >
2016-12-13 00:27:52 +11:00
< / div >
2017-03-30 07:27:24 +11:00
< div className = 'scrollable optionally-scrollable' style = { { display : 'flex' , flexDirection : 'column' } } >
2017-01-05 13:14:33 +11:00
< div className = 'static-content getting-started' >
2017-04-13 01:13:19 +10: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/documentation/blob/master/Using-Mastodon/Apps.md" target = "_blank" > < FormattedMessage id = 'getting_started.apps' defaultMessage = 'Various apps are available' / > < / a > } } / > < / p >
2017-01-05 13:14:33 +11:00
< / div >
2016-10-08 01:00:11 +11:00
< / div >
< / Column >
2016-10-07 07:47:35 +11:00
) ;
} ;
2016-12-27 07:33:51 +11:00
GettingStarted . propTypes = {
2017-04-22 04:05:35 +10:00
intl : PropTypes . object . isRequired ,
2016-12-27 07:55:52 +11:00
me : ImmutablePropTypes . map . isRequired
2016-12-27 07:33:51 +11:00
} ;
2016-12-13 00:27:52 +11:00
export default connect ( mapStateToProps ) ( injectIntl ( GettingStarted ) ) ;