From 6a616a0c331e92ad462774b3931388d670bc947b Mon Sep 17 00:00:00 2001 From: Baptiste Lemoine Date: Thu, 16 Jan 2020 17:10:18 +0100 Subject: [PATCH] :zap: save stuff --- .../components/conversation.js | 2 +- .../mastodon/features/following/index.js | 10 +- .../features/ui/components/columns_area.js | 5 +- .../features/ui/components/link_footer.js | 11 +- .../ui/components/messaging/contacts-list.js | 9 +- .../components/messaging/conversation-item.js | 3 +- .../messaging/conversation-stream.js | 5 +- .../components/messaging/instantMessaging.js | 28 +++- .../messaging/mocks/mockConversation.js | 14 +- app/javascript/mastodon/features/ui/index.js | 3 +- app/javascript/styles/bliss/_mixins.scss | 10 ++ .../messaging/messaging-conversation.scss | 151 +++++++++--------- app/views/auth/passwords/new.html.haml | 2 +- app/views/auth/sessions/new.html.haml | 6 +- 14 files changed, 154 insertions(+), 105 deletions(-) diff --git a/app/javascript/mastodon/features/direct_timeline/components/conversation.js b/app/javascript/mastodon/features/direct_timeline/components/conversation.js index 4e04dc633..f1ab5f950 100644 --- a/app/javascript/mastodon/features/direct_timeline/components/conversation.js +++ b/app/javascript/mastodon/features/direct_timeline/components/conversation.js @@ -236,7 +236,7 @@ class Conversation extends ImmutablePureComponent { className='status__action-bar-button conversation_reply' title={intl.formatMessage(messages.reply)} icon='reply' - size='15em' + size={40} onClick={this.handleReply} /> diff --git a/app/javascript/mastodon/features/following/index.js b/app/javascript/mastodon/features/following/index.js index fc13aa7d3..304935902 100644 --- a/app/javascript/mastodon/features/following/index.js +++ b/app/javascript/mastodon/features/following/index.js @@ -72,13 +72,13 @@ class Following extends ImmutablePureComponent { ); } - const emptyMessage = blockedBy ? : ) : (; + />); return ( @@ -98,11 +98,11 @@ class Following extends ImmutablePureComponent { bindToDocument={!multiColumn} > {blockedBy ? [] : accountIds.map(id => - , + />), )} diff --git a/app/javascript/mastodon/features/ui/components/columns_area.js b/app/javascript/mastodon/features/ui/components/columns_area.js index 8899a08e2..2f825547e 100644 --- a/app/javascript/mastodon/features/ui/components/columns_area.js +++ b/app/javascript/mastodon/features/ui/components/columns_area.js @@ -240,7 +240,10 @@ class ColumnsArea extends ImmutablePureComponent { {floatingActionButton} - +
+ + +
); } diff --git a/app/javascript/mastodon/features/ui/components/link_footer.js b/app/javascript/mastodon/features/ui/components/link_footer.js index f3fd69e47..1c102ac28 100644 --- a/app/javascript/mastodon/features/ui/components/link_footer.js +++ b/app/javascript/mastodon/features/ui/components/link_footer.js @@ -165,8 +165,15 @@ class LinkFooter extends React.PureComponent { )} {isStaff && ( - - + + + example link + -
+
{ return ( -
  • +
  • {message.text}

  • diff --git a/app/javascript/mastodon/features/ui/components/messaging/instantMessaging.js b/app/javascript/mastodon/features/ui/components/messaging/instantMessaging.js index 4d2709c50..774cf150d 100644 --- a/app/javascript/mastodon/features/ui/components/messaging/instantMessaging.js +++ b/app/javascript/mastodon/features/ui/components/messaging/instantMessaging.js @@ -1,16 +1,33 @@ import React from 'react'; + +import ImmutablePureComponent from 'react-immutable-pure-component'; +import PropTypes from 'prop-types'; +import ImmutablePropTypes from 'react-immutable-proptypes'; import ContactsList from './contacts-list'; import ConversationStack from './conversationStack'; +const mapStateToProps = (state, props) => ({ + isAccount : !!state.getIn(['accounts', props.params.accountId]), + accountIds: state.getIn(['user_lists', 'following', props.params.accountId, 'items']), + hasMore : !!state.getIn(['user_lists', 'following', props.params.accountId, 'next']), + blockedBy : state.getIn(['relationships', props.params.accountId, 'blocked_by'], false), +}); +// @connect(mapStateToProps) /** * main component for IM, gathers contact list and list of conversations */ -export default class InstantMessaging extends React.PureComponent { +export default class InstantMessaging extends ImmutablePureComponent { - // static propTypes = { - // following : PropTypes.array, - // conversations: PropTypes.array, - // }; + static propTypes = { + // params : PropTypes.object.isRequired, + dispatch : PropTypes.func.isRequired, + shouldUpdateScroll: PropTypes.func, + accountIds : ImmutablePropTypes.list, + hasMore : PropTypes.bool, + blockedBy : PropTypes.bool, + isAccount : PropTypes.bool, + multiColumn : PropTypes.bool, + }; // static defaultProps = { // threadsCompile: true, // }; @@ -30,6 +47,7 @@ export default class InstantMessaging extends React.PureComponent { // }; render() { + return (
    diff --git a/app/javascript/mastodon/features/ui/components/messaging/mocks/mockConversation.js b/app/javascript/mastodon/features/ui/components/messaging/mocks/mockConversation.js index bf4fab9ce..b8ceb709f 100644 --- a/app/javascript/mastodon/features/ui/components/messaging/mocks/mockConversation.js +++ b/app/javascript/mastodon/features/ui/components/messaging/mocks/mockConversation.js @@ -1,14 +1,14 @@ export const mockMessages = [ - { text: 'oh hello there! 😋 ', who: 'theirs' }, - { text: 'General Emoji', who: 'ours' }, - { text: 'we just achieved comedy', who: 'theirs' }, + { id: 0, text: 'oh hello there! 😋 ', who: 'theirs' }, + { id: 1, text: 'General Emoji', who: 'ours' }, + { id: 2, text: 'we just achieved comedy', who: 'theirs' }, ] ; export const mockMessages2 = [ - { text: 'oh oh oh ', who: 'theirs' }, - { text: 'General Emoji', who: 'ours' }, - { text: 'DANGER!!', who: 'theirs' }, - { text: 'JUST KIDDING WILL ROBINSON.', who: 'theirs' }, + { id: 0, text: 'oh oh oh ', who: 'theirs' }, + { id: 1, text: 'General Emoji', who: 'ours' }, + { id: 2, text: 'DANGER!!', who: 'theirs' }, + { id: 3, text: 'JUST KIDDING WILL ROBINSON.', who: 'theirs' }, ] ; diff --git a/app/javascript/mastodon/features/ui/index.js b/app/javascript/mastodon/features/ui/index.js index d0b450074..8fab1ee7d 100644 --- a/app/javascript/mastodon/features/ui/index.js +++ b/app/javascript/mastodon/features/ui/index.js @@ -57,6 +57,7 @@ import { previewState as previewVideoState } from './components/video_modal'; // Dummy import, to make sure that ends up in the application bundle. // Without this it ends up in ~8 very commonly used bundles. import '../../components/status'; +import InstantMessaging from './components/messaging/instantMessaging'; const messages = defineMessages({ beforeUnload: { id: 'ui.beforeunload', defaultMessage: 'Your draft will be lost if you leave Mastodon.' }, @@ -192,7 +193,7 @@ class SwitchingColumnsArea extends React.PureComponent { {redirect} t('simple_form.labels.defaults.email') }, hint: false + = f.input :email, autofocus: true, wrapper: :with_label, label: t('simple_form.labels.defaults.email'), input_html: { 'aria-label' => t('simple_form.labels.defaults.email') }, hint: false .actions = f.button :button, t('auth.reset_password'), type: :submit diff --git a/app/views/auth/sessions/new.html.haml b/app/views/auth/sessions/new.html.haml index ca291124e..ceb169408 100644 --- a/app/views/auth/sessions/new.html.haml +++ b/app/views/auth/sessions/new.html.haml @@ -7,11 +7,11 @@ = simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| .fields-group - if use_seamless_external_login? - = f.not-a-real-input :email, autofocus: true, wrapper: :with_label, label: t('simple_form.labels.defaults.username_or_email'), input_html: { 'aria-label' => t('simple_form.labels.defaults.username_or_email') }, hint: false + = f.input :email, autofocus: true, wrapper: :with_label, label: t('simple_form.labels.defaults.username_or_email'), input_html: { 'aria-label' => t('simple_form.labels.defaults.username_or_email') }, hint: false - else - = f.not-a-real-input :email, autofocus: true, wrapper: :with_label, label: t('simple_form.labels.defaults.email'), input_html: { 'aria-label' => t('simple_form.labels.defaults.email') }, hint: false + = f.input :email, autofocus: true, wrapper: :with_label, label: t('simple_form.labels.defaults.email'), input_html: { 'aria-label' => t('simple_form.labels.defaults.email') }, hint: false .fields-group - = f.not-a-real-input :password, wrapper: :with_label, label: t('simple_form.labels.defaults.password'), input_html: { 'aria-label' => t('simple_form.labels.defaults.password'), :autocomplete => 'off' }, hint: false + = f.input :password, wrapper: :with_label, label: t('simple_form.labels.defaults.password'), input_html: { 'aria-label' => t('simple_form.labels.defaults.password'), :autocomplete => 'off' }, hint: false .actions = f.button :button, t('auth.login'), type: :submit