Skip to content

Commit

Permalink
Add new onboarding flow to web UI (mastodon#24619)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargron authored and skerit committed Jul 7, 2023
1 parent d5273ed commit fbe23e2
Show file tree
Hide file tree
Showing 23 changed files with 1,014 additions and 352 deletions.
57 changes: 57 additions & 0 deletions app/javascript/images/elephant_ui_conversation.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions app/javascript/mastodon/actions/compose.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export const COMPOSE_CHANGE_MEDIA_DESCRIPTION = 'COMPOSE_CHANGE_MEDIA_DESCRIPTIO
export const COMPOSE_CHANGE_MEDIA_FOCUS = 'COMPOSE_CHANGE_MEDIA_FOCUS';

export const COMPOSE_SET_STATUS = 'COMPOSE_SET_STATUS';
export const COMPOSE_FOCUS = 'COMPOSE_FOCUS';

const messages = defineMessages({
uploadErrorLimit: { id: 'upload_error.limit', defaultMessage: 'File upload limit exceeded.' },
Expand Down Expand Up @@ -125,6 +126,14 @@ export function resetCompose() {
};
}

export const focusCompose = routerHistory => dispatch => {
dispatch({
type: COMPOSE_FOCUS,
});

ensureComposeIsVisible(routerHistory);
};

export function mentionCompose(account, routerHistory) {
return (dispatch, getState) => {
dispatch({
Expand Down
22 changes: 1 addition & 21 deletions app/javascript/mastodon/components/account.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import Skeleton from 'mastodon/components/skeleton';
import { Link } from 'react-router-dom';
import { counterRenderer } from 'mastodon/components/common_counter';
import ShortNumber from 'mastodon/components/short_number';
import Icon from 'mastodon/components/icon';
import classNames from 'classnames';
import VerifiedBadge from 'mastodon/components/verified_badge';

const messages = defineMessages({
follow: { id: 'account.follow', defaultMessage: 'Follow' },
Expand All @@ -27,26 +27,6 @@ const messages = defineMessages({
block: { id: 'account.block', defaultMessage: 'Block @{name}' },
});

class VerifiedBadge extends React.PureComponent {

static propTypes = {
link: PropTypes.string.isRequired,
verifiedAt: PropTypes.string.isRequired,
};

render () {
const { link } = this.props;

return (
<span className='verified-badge'>
<Icon id='check' className='verified-badge__mark' />
<span dangerouslySetInnerHTML={{ __html: link }} />
</span>
);
}

}

class Account extends ImmutablePureComponent {

static propTypes = {
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/mastodon/components/check.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';

const Check = () => (
<svg width='14' height='11' viewBox='0 0 14 11'>
<path d='M11.264 0L5.26 6.004 2.103 2.847 0 4.95l5.26 5.26 8.108-8.107L11.264 0' fill='currentColor' fillRule='evenodd' />
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='currentColor'>
<path fillRule='evenodd' d='M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z' clipRule='evenodd' />
</svg>
);

Expand Down
12 changes: 9 additions & 3 deletions app/javascript/mastodon/components/column_back_button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,19 @@ export default class ColumnBackButton extends React.PureComponent {

static propTypes = {
multiColumn: PropTypes.bool,
onClick: PropTypes.func,
};

handleClick = () => {
if (window.history && window.history.state) {
this.context.router.history.goBack();
const { router } = this.context;
const { onClick } = this.props;

if (onClick) {
onClick();
} else if (window.history && window.history.state) {
router.history.goBack();
} else {
this.context.router.history.push('/');
router.history.push('/');
}
};

Expand Down
1 change: 1 addition & 0 deletions app/javascript/mastodon/components/status.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ class Status extends ImmutablePureComponent {
{prepend}

<div className={classNames('status', `status-${status.get('visibility')}`, { 'status-reply': !!status.get('in_reply_to_id'), muted: this.props.muted })} data-id={status.get('id')}>
{/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}
<div onClick={this.handleClick} className='status__info'>
<a href={`/@${status.getIn(['account', 'acct'])}/${status.get('id')}`} className='status__relative-time' target='_blank' rel='noopener noreferrer'>
<span className='status__visibility-icon'><Icon id={visibilityIcon.icon} title={visibilityIcon.text} /></span>
Expand Down
25 changes: 25 additions & 0 deletions app/javascript/mastodon/components/verified_badge.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react';
import PropTypes from 'prop-types';
import Icon from 'mastodon/components/icon';

class VerifiedBadge extends React.PureComponent {

static propTypes = {
link: PropTypes.string.isRequired,
verifiedAt: PropTypes.string.isRequired,
};

render () {
const { link } = this.props;

return (
<span className='verified-badge'>
<Icon id='check' className='verified-badge__mark' />
<span dangerouslySetInnerHTML={{ __html: link }} />
</span>
);
}

}

export default VerifiedBadge;
Loading

0 comments on commit fbe23e2

Please sign in to comment.