2019-08-26 18:24:10 +02:00
|
|
|
import { connect } from 'react-redux';
|
2019-05-27 21:58:41 +02:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
2019-12-15 22:42:42 +01:00
|
|
|
import { defineMessages, FormattedMessage, injectIntl } from 'react-intl';
|
2019-05-27 21:58:41 +02:00
|
|
|
import { Link } from 'react-router-dom';
|
2019-12-15 22:42:42 +01:00
|
|
|
import { invitesEnabled, repository, source_url, version } from 'mastodon/initial_state';
|
2019-08-26 18:24:10 +02:00
|
|
|
import { logOut } from 'mastodon/utils/log_out';
|
|
|
|
import { openModal } from 'mastodon/actions/modal';
|
2019-12-21 17:20:44 +01:00
|
|
|
import { isStaff } from '../../../initial_state';
|
2019-05-27 21:58:41 +02:00
|
|
|
|
2019-08-26 18:24:10 +02:00
|
|
|
const messages = defineMessages({
|
|
|
|
logoutMessage: { id: 'confirmations.logout.message', defaultMessage: 'Are you sure you want to log out?' },
|
|
|
|
logoutConfirm: { id: 'confirmations.logout.confirm', defaultMessage: 'Log out' },
|
|
|
|
});
|
|
|
|
|
|
|
|
const mapDispatchToProps = (dispatch, { intl }) => ({
|
2019-12-15 22:42:42 +01:00
|
|
|
onLogout() {
|
2019-08-26 18:24:10 +02:00
|
|
|
dispatch(openModal('CONFIRM', {
|
2019-12-15 22:42:42 +01:00
|
|
|
message : intl.formatMessage(messages.logoutMessage),
|
|
|
|
confirm : intl.formatMessage(messages.logoutConfirm),
|
2019-08-26 18:24:10 +02:00
|
|
|
onConfirm: () => logOut(),
|
|
|
|
}));
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2019-12-23 15:03:32 +01:00
|
|
|
// const themeIsDark = true;
|
|
|
|
// const displaythemetoggler = true;
|
2019-08-26 18:24:10 +02:00
|
|
|
export default @injectIntl
|
|
|
|
@connect(null, mapDispatchToProps)
|
|
|
|
class LinkFooter extends React.PureComponent {
|
|
|
|
|
|
|
|
static propTypes = {
|
2019-12-23 15:03:32 +01:00
|
|
|
enableChristmasSnow: PropTypes.bool,
|
|
|
|
snowActive : PropTypes.bool,
|
|
|
|
withHotkeys : PropTypes.bool,
|
|
|
|
snow : PropTypes.func,
|
|
|
|
onLogout : PropTypes.func.isRequired,
|
|
|
|
intl : PropTypes.object.isRequired,
|
2019-08-26 18:24:10 +02:00
|
|
|
};
|
2019-12-23 11:01:09 +01:00
|
|
|
static defaultProps = {
|
2019-12-23 15:03:32 +01:00
|
|
|
enableChristmasSnow: true,
|
2019-12-23 11:01:09 +01:00
|
|
|
};
|
2019-08-26 18:24:10 +02:00
|
|
|
|
|
|
|
handleLogoutClick = e => {
|
|
|
|
e.preventDefault();
|
|
|
|
e.stopPropagation();
|
|
|
|
|
|
|
|
this.props.onLogout();
|
2019-05-27 21:58:41 +02:00
|
|
|
|
2019-08-26 18:24:10 +02:00
|
|
|
return false;
|
2019-12-15 22:42:42 +01:00
|
|
|
};
|
2019-08-26 18:24:10 +02:00
|
|
|
|
2019-12-23 15:03:32 +01:00
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
Date.prototype.getWeek = function () {
|
|
|
|
var onejan = new Date(this.getFullYear(), 0, 1);
|
|
|
|
return Math.ceil((((this - onejan) / 86400000) + onejan.getDay() + 1) / 7);
|
|
|
|
};
|
|
|
|
|
|
|
|
var weekNumber = (new Date()).getWeek();
|
|
|
|
// display snow during the last two weeks of the year
|
|
|
|
console.log('week', weekNumber);
|
|
|
|
const shouldWeDisplaySnow = (weekNumber > 48) && props.enableChristmasSnow;
|
|
|
|
|
|
|
|
this.state = { enableChristmasSnow: shouldWeDisplaySnow };
|
|
|
|
|
2019-12-23 11:01:09 +01:00
|
|
|
// make snow effect
|
2019-12-23 15:03:32 +01:00
|
|
|
if (shouldWeDisplaySnow) {
|
2019-12-23 11:01:09 +01:00
|
|
|
import('../../../utils/snowstorm-min')
|
|
|
|
.then((snowstorm) => {
|
2019-12-23 15:03:32 +01:00
|
|
|
Window.snowstorm = snowstorm.default;
|
|
|
|
this.state.snow = Window.snowstorm;
|
2019-12-23 17:00:57 +01:00
|
|
|
console.log('this.state.snow ', this.state.snow);
|
2019-12-23 15:03:32 +01:00
|
|
|
// snowstorm.start();
|
|
|
|
this.state.snowActive = true;
|
2019-12-23 11:01:09 +01:00
|
|
|
})
|
|
|
|
.catch((err) => console.error(err));
|
|
|
|
}
|
2019-12-23 15:03:32 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-12-23 17:00:57 +01:00
|
|
|
toggleSnow = () => {
|
2019-12-23 15:03:32 +01:00
|
|
|
console.log('toggle snow');
|
|
|
|
if (this.state.snow) {
|
|
|
|
if (this.state.snowActive) {
|
|
|
|
this.state.snow.stop();
|
|
|
|
this.state.snowActive = false;
|
|
|
|
} else {
|
|
|
|
this.state.snow.start();
|
|
|
|
this.state.snowActive = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2019-12-23 17:00:57 +01:00
|
|
|
};
|
2019-12-23 15:03:32 +01:00
|
|
|
|
|
|
|
changeTheme(newTheme) {
|
|
|
|
console.log('change theme en ', newTheme);
|
2019-12-23 11:01:09 +01:00
|
|
|
}
|
|
|
|
|
2019-12-15 22:42:42 +01:00
|
|
|
render() {
|
2019-08-26 18:24:10 +02:00
|
|
|
const { withHotkeys } = this.props;
|
2019-12-23 15:03:32 +01:00
|
|
|
var snowClasses = this.props.snowActive ? 'snow-button active' : 'snow-button ';
|
2019-08-26 18:24:10 +02:00
|
|
|
|
|
|
|
return (
|
2019-12-23 15:03:32 +01:00
|
|
|
|
2020-01-04 16:27:50 +01:00
|
|
|
<div className='getting-started__footer hide-on-smaller-screens'>
|
2019-12-23 17:00:57 +01:00
|
|
|
|
2019-12-23 15:03:32 +01:00
|
|
|
<div className='extras'>
|
|
|
|
|
|
|
|
{/*// TODO*/}
|
|
|
|
{/*<button className='mod-theme btn btn-block'>*/}
|
|
|
|
{/* {themeIsDark ? (*/}
|
|
|
|
{/* <span*/}
|
|
|
|
{/* onClick={this.changeTheme('light')}*/}
|
|
|
|
{/* title='set light'*/}
|
|
|
|
{/* >*/}
|
|
|
|
{/* <i className='fa fa-pencil-o' />*/}
|
|
|
|
{/* </span >*/}
|
|
|
|
{/* ) : (*/}
|
|
|
|
{/* <span*/}
|
|
|
|
{/* onClick={this.changeTheme('dark')}*/}
|
|
|
|
{/* title='set dark'*/}
|
|
|
|
{/* >*/}
|
|
|
|
{/* <i className='fa fa-pencil' />*/}
|
|
|
|
{/* </span >*/}
|
|
|
|
{/* )}*/}
|
|
|
|
{/*</button >*/}
|
|
|
|
|
|
|
|
{this.state.enableChristmasSnow && (
|
|
|
|
<div
|
2019-12-23 17:00:57 +01:00
|
|
|
onClick={this.toggleSnow}
|
2019-12-23 15:03:32 +01:00
|
|
|
className='christmas-snow'
|
|
|
|
>
|
|
|
|
<div className={snowClasses}>
|
|
|
|
<i
|
|
|
|
className='icon fa fa-snowflake-o'
|
|
|
|
aria-hidden='true'
|
|
|
|
/>
|
|
|
|
</div >
|
|
|
|
<div > Joyeuses fêtes!</div >
|
2019-12-23 17:00:57 +01:00
|
|
|
{isStaff && (
|
|
|
|
|
|
|
|
<a href='/admin/tags?pending_review=1'>
|
|
|
|
<i className='fa fa-fire' />
|
|
|
|
Trending hashtags</a >
|
|
|
|
|
|
|
|
)}
|
2019-12-23 15:03:32 +01:00
|
|
|
<br />
|
|
|
|
<div className='external-utilities'>
|
|
|
|
<a href='https://mastodon.cipherbliss.com/@tykayn'>
|
|
|
|
<i className='fa fa-paper-plane' />
|
|
|
|
contactez nous
|
|
|
|
</a >
|
2019-12-23 17:09:56 +01:00
|
|
|
<a href='https://liberapay.com/cipherbliss'><i className='fa fa-coffee' /> Supportez Cipherbliss</a >
|
2019-12-23 15:03:32 +01:00
|
|
|
|
2019-12-23 17:00:57 +01:00
|
|
|
<a href='https://peertube.cipherbliss.com'> <i className='fa fa-play ' /> Videos</a >
|
2019-12-23 15:03:32 +01:00
|
|
|
<a href='https://framadate.org/'> <i className='fa fa-calendar' /> FramaDate</a >
|
|
|
|
<a href='https://framapad.org/'> <i className='fa fa-file-text' /> Pad</a >
|
|
|
|
<a href='https://framagit.org/tykayn/mastodon'> <i className='fa fa-gitlab' /> Source</a >
|
2019-12-23 17:09:56 +01:00
|
|
|
<hr />
|
|
|
|
<a href='/web/timelines/tag/vélo'> <i className='fa fa-bicycle' /> #vélo</a >
|
|
|
|
<a href='/web/timelines/tag/openstreetmap'> <i className='fa fa-map-o' /> #OpenStreetMap</a >
|
|
|
|
<a href='/web/timelines/tag/mastoart'> <i className='fa fa-paint-brush' /> #Mastoart</a >
|
|
|
|
<a href='/web/timelines/tag/ironèmes'> <i className='fa fa-file-text-o' /> #ironèmes</a >
|
2019-12-23 15:03:32 +01:00
|
|
|
</div >
|
|
|
|
</div >
|
|
|
|
)}
|
|
|
|
</div >
|
2019-12-23 11:01:09 +01:00
|
|
|
|
2019-12-18 12:52:46 +01:00
|
|
|
<ul >
|
2019-12-23 15:03:32 +01:00
|
|
|
|
2019-12-18 12:52:46 +01:00
|
|
|
{invitesEnabled && <li ><a
|
|
|
|
href='/invites'
|
|
|
|
target='_blank'
|
|
|
|
><FormattedMessage
|
2019-12-15 22:42:42 +01:00
|
|
|
id='getting_started.invite'
|
|
|
|
defaultMessage='Invite people'
|
2019-12-18 12:52:46 +01:00
|
|
|
/> ·</a >
|
|
|
|
</li >}
|
|
|
|
{withHotkeys && <li ><Link to='/keyboard-shortcuts'>
|
|
|
|
<FormattedMessage
|
|
|
|
id='navigation_bar.keyboard_shortcuts'
|
|
|
|
defaultMessage='Hotkeys'
|
|
|
|
/> ·
|
|
|
|
</Link >
|
|
|
|
</li >}
|
|
|
|
<li >
|
|
|
|
<a href='/auth/edit'>
|
|
|
|
<FormattedMessage
|
|
|
|
id='getting_started.security'
|
|
|
|
defaultMessage='Security'
|
|
|
|
/> ·
|
|
|
|
</a >
|
|
|
|
</li >
|
|
|
|
<li >
|
|
|
|
<a
|
|
|
|
href='/about/more'
|
|
|
|
target='_blank'
|
|
|
|
><FormattedMessage
|
|
|
|
id='navigation_bar.info'
|
|
|
|
defaultMessage='About this server'
|
|
|
|
/> ·
|
|
|
|
</a >
|
|
|
|
</li >
|
|
|
|
<li >
|
|
|
|
<a
|
|
|
|
href='https://joinmastodon.org/apps'
|
|
|
|
target='_blank'
|
|
|
|
><FormattedMessage
|
|
|
|
id='navigation_bar.apps'
|
|
|
|
defaultMessage='Mobile apps'
|
|
|
|
/> ·
|
|
|
|
</a >
|
|
|
|
</li >
|
|
|
|
<li >
|
|
|
|
<a
|
|
|
|
href='/terms'
|
|
|
|
target='_blank'
|
|
|
|
>
|
|
|
|
<FormattedMessage
|
|
|
|
id='getting_started.terms'
|
|
|
|
defaultMessage='Terms of service'
|
|
|
|
/> ·</a >
|
|
|
|
</li >
|
|
|
|
<li >
|
|
|
|
<a
|
|
|
|
href='/settings/applications'
|
|
|
|
target='_blank'
|
|
|
|
><FormattedMessage
|
|
|
|
id='getting_started.developers'
|
|
|
|
defaultMessage='Developers'
|
|
|
|
/> ·
|
|
|
|
</a >
|
|
|
|
</li >
|
|
|
|
<li >
|
|
|
|
<a
|
|
|
|
href='https://docs.joinmastodon.org'
|
|
|
|
target='_blank'
|
|
|
|
>
|
|
|
|
<FormattedMessage
|
|
|
|
id='getting_started.documentation'
|
|
|
|
defaultMessage='Documentation'
|
|
|
|
/>
|
|
|
|
</a > ·
|
|
|
|
</li >
|
|
|
|
<li >
|
|
|
|
<a
|
|
|
|
href='/auth/sign_out'
|
|
|
|
onClick={this.handleLogoutClick}
|
|
|
|
>
|
|
|
|
<FormattedMessage
|
|
|
|
id='navigation_bar.logout'
|
|
|
|
defaultMessage='Logout'
|
|
|
|
/>
|
|
|
|
</a >
|
|
|
|
</li >
|
|
|
|
</ul >
|
2019-08-26 18:24:10 +02:00
|
|
|
|
2019-12-18 12:52:46 +01:00
|
|
|
<p >
|
2019-08-26 18:24:10 +02:00
|
|
|
<FormattedMessage
|
|
|
|
id='getting_started.open_source_notice'
|
2019-12-18 12:52:46 +01:00
|
|
|
defaultMessage='Mastodon is open source software. You can contribute or report issues on the forge at {forge}.'
|
2019-12-15 22:42:42 +01:00
|
|
|
values={{
|
2019-12-18 12:52:46 +01:00
|
|
|
forge: <span ><a
|
|
|
|
href={source_url}
|
|
|
|
rel='noopener noreferrer'
|
|
|
|
target='_blank'
|
|
|
|
>{repository}</a > (v{version})</span >,
|
2019-12-15 22:42:42 +01:00
|
|
|
}}
|
2019-08-26 18:24:10 +02:00
|
|
|
/>
|
2019-12-18 12:52:46 +01:00
|
|
|
</p >
|
|
|
|
</div >
|
2019-08-26 18:24:10 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|