From 920bd05081903c52a2521da5ea86714dfc82b452 Mon Sep 17 00:00:00 2001 From: Exilat Date: Sat, 3 Aug 2019 13:55:05 +0000 Subject: [PATCH 01/24] Update for Interactions, new search, sticker picker, update copy. --- src/i18n/oc.json | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/i18n/oc.json b/src/i18n/oc.json index 6100a4d276..2b2bd88a51 100644 --- a/src/i18n/oc.json +++ b/src/i18n/oc.json @@ -65,6 +65,7 @@ "timeline": "Flux d’actualitat", "twkn": "Lo malhum conegut", "user_search": "Cèrca d’utilizaires", + "search": "Cercar", "who_to_follow": "Qual seguir", "preferences": "Preferéncias" }, @@ -91,7 +92,15 @@ "expires_in": "Lo sondatge s’acabarà {0}", "expired": "Sondatge acabat {0}", "not_enough_options": "I a pas pro d’opcions" - }, + }, + "stickers": { + "add_sticker": "Add Sticker" + }, + "interactions": { + "favs_repeats": "Repeticions e favorits", + "follows": "Nòus seguidors", + "load_older": "Cargar d’interaccions anterioras" + }, "post_status": { "new_status": "Publicar d’estatuts novèls", "account_not_locked_warning": "Vòstre compte es pas {0}. Qual que siá pòt vos seguir per veire vòstras publicacions destinadas pas qu’a vòstres seguidors.", @@ -269,7 +278,7 @@ "streaming": "Activar lo cargament automatic dels novèls estatus en anar amont", "text": "Tèxte", "theme": "Tèma", - "theme_help_v2_1": "You can also override certain component's colors and opacity by toggling the checkbox, use \"Clear all\" button to clear all overrides.", + "theme_help_v2_1": "Podètz tanben remplaçar la color d’unes compausants en clicant la case, utilizatz lo boton \"O escafar tot\" per escafar totes las subrecargadas.", "theme_help_v2_2": "Icons underneath some entries are background/text contrast indicators, hover over for detailed info. Please keep in mind that when using transparency contrast indicators show the worst possible case.", "theme_help": "Emplegatz los còdis de color hex (#rrggbb) per personalizar vòstre tèma de color.", "tooltipRadius": "Astúcias/alèrtas", @@ -280,12 +289,12 @@ "true": "òc" }, "notifications": "Notificacions", - "notification_setting": "Receber las notificacions de :", + "notification_setting": "Recebre las notificacions de :", "notification_setting_follows": "Utilizaires que seguissètz", "notification_setting_non_follows": "Utilizaires que seguissètz pas", "notification_setting_followers": "Utilizaires que vos seguisson", "notification_setting_non_followers": "Utilizaires que vos seguisson pas", - "notification_mutes": "Per receber pas mai d’un utilizaire en particular, botatz-lo en silenci.", + "notification_mutes": "Per recebre pas mai d’un utilizaire en particular, botatz-lo en silenci.", "notification_blocks": "Blocar un utilizaire arrèsta totas las notificacions tan coma quitar de los seguir.", "enable_web_push_notifications": "Activar las notificacions web push", "style": { @@ -477,6 +486,8 @@ "per_day": "per jorn", "remote_follow": "Seguir a distància", "statuses": "Estatuts", + "subscribe": "S’abonar", + "unsubscribe": "Se desabonar", "unblock": "Desblocar", "unblock_progress": "Desblocatge...", "block_progress": "Blocatge...", @@ -532,5 +543,12 @@ "GiB": "Gio", "TiB": "Tio" } + }, + "search": { + "people": "Gent", + "hashtags": "Etiquetas", + "person_talking": "{count} persona ne parla", + "people_talking": "{count} personas ne parlan", + "no_results": "Cap de resultats" } } \ No newline at end of file From 39106dc5450d4a927848477764bed2e31fe435c4 Mon Sep 17 00:00:00 2001 From: Exilat Date: Sat, 3 Aug 2019 14:04:49 +0000 Subject: [PATCH 02/24] Update oc.json --- src/i18n/oc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/oc.json b/src/i18n/oc.json index 2b2bd88a51..54f42294e1 100644 --- a/src/i18n/oc.json +++ b/src/i18n/oc.json @@ -94,7 +94,7 @@ "not_enough_options": "I a pas pro d’opcions" }, "stickers": { - "add_sticker": "Add Sticker" + "add_sticker": "Ajustar un pegasolet" }, "interactions": { "favs_repeats": "Repeticions e favorits", From f48d12b4bcf022d25d731d8b21bb8904cd09285e Mon Sep 17 00:00:00 2001 From: tarteka Date: Fri, 6 Sep 2019 14:24:37 +0200 Subject: [PATCH 03/24] update eu translate --- src/i18n/eu.json | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/i18n/eu.json b/src/i18n/eu.json index 1efaa31043..d39251266d 100644 --- a/src/i18n/eu.json +++ b/src/i18n/eu.json @@ -508,7 +508,9 @@ "pinned": "Ainguratuta", "delete_confirm": "Mezu hau benetan ezabatu nahi duzu?", "reply_to": "Erantzun", - "replies_list": "Erantzunak:" + "replies_list": "Erantzunak:", + "mute_conversation": "Elkarrizketa isilarazi", + "unmute_conversation": "Elkarrizketa aktibatu" }, "user_card": { "approve": "Onartu", @@ -606,5 +608,16 @@ "person_talking": "{count} pertsona hitzegiten", "people_talking": "{count} gende hitzegiten", "no_results": "Emaitzarik ez" + }, + "password_reset": { + "forgot_password": "Pasahitza ahaztua?", + "password_reset": "Pasahitza berrezarri", + "instruction": "Idatzi zure helbide elektronikoa edo erabiltzaile izena. Pasahitza berrezartzeko esteka bidaliko dizugu.", + "placeholder": "Zure e-posta edo erabiltzaile izena", + "check_email": "Begiratu zure posta elektronikoa pasahitza berrezarri ahal izateko.", + "return_home": "Itzuli hasierara", + "not_found": "Ezin izan dugu helbide elektroniko edo erabiltzaile hori aurkitu.", + "too_many_requests": "Saiakera gehiegi burutu ditzu, saiatu berriro geroxeago.", + "password_reset_disabled": "Pasahitza berrezartzea debekatuta dago. Mesedez, jarri harremanetan instantzia administratzailearekin." } } \ No newline at end of file From 1167bafb1977ddbd24536878d36798965f7c41a9 Mon Sep 17 00:00:00 2001 From: tarteka Date: Fri, 6 Sep 2019 14:58:20 +0200 Subject: [PATCH 04/24] Update es translate --- src/i18n/es.json | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/i18n/es.json b/src/i18n/es.json index 009599f5a4..91c7f38330 100644 --- a/src/i18n/es.json +++ b/src/i18n/es.json @@ -508,7 +508,9 @@ "pinned": "Fijado", "delete_confirm": "¿Realmente quieres borrar la publicación?", "reply_to": "Respondiendo a", - "replies_list": "Respuestas:" + "replies_list": "Respuestas:", + "mute_conversation": "Silenciar la conversación", + "unmute_conversation": "Mostrar la conversación" }, "user_card": { "approve": "Aprobar", @@ -606,5 +608,16 @@ "person_talking": "{count} personas hablando", "people_talking": "{count} gente hablando", "no_results": "Sin resultados" + }, + "password_reset": { + "forgot_password": "¿Contraseña olvidada?", + "password_reset": "Restablecer la contraseña", + "instruction": "Ingrese su dirección de correo electrónico o nombre de usuario. Le enviaremos un enlace para restablecer su contraseña.", + "placeholder": "Su correo electrónico o nombre de usuario", + "check_email": "Revise su correo electrónico para obtener un enlace para restablecer su contraseña.", + "return_home": "Volver a la página de inicio", + "not_found": "No pudimos encontrar ese correo electrónico o nombre de usuario.", + "too_many_requests": "Has alcanzado el límite de intentos, vuelve a intentarlo más tarde.", + "password_reset_disabled": "El restablecimiento de contraseñas está deshabilitado. Póngase en contacto con el administrador de su instancia." } } \ No newline at end of file From 17a97ee6f5bc60c19be0d9d9e9e8e2f1c28be672 Mon Sep 17 00:00:00 2001 From: tarteka Date: Sat, 7 Sep 2019 09:00:25 +0200 Subject: [PATCH 05/24] fix some translates --- src/i18n/eu.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/i18n/eu.json b/src/i18n/eu.json index d39251266d..6cbdb1156c 100644 --- a/src/i18n/eu.json +++ b/src/i18n/eu.json @@ -88,7 +88,7 @@ "followed_you": "Zu jarraitzen zaitu", "load_older": "Kargatu jakinarazpen zaharragoak", "notifications": "Jakinarazpenak", - "read": "Irakurri!", + "read": "Irakurrita!", "repeated_you": "zure mezua errepikatu du", "no_more_notifications": "Ez dago jakinarazpen gehiago" }, @@ -116,7 +116,7 @@ }, "post_status": { "new_status": "Mezu berri bat idatzi", - "account_not_locked_warning": "Zure kontua ez dago {0}. Edozeinek jarraitzen hastearekin, zure mezuak irakur dezake.", + "account_not_locked_warning": "Zure kontua ez dago {0}. Edozeinek jarraitzen hastearekin, zure mezuak irakur ditzake.", "account_not_locked_warning_link": "Blokeatuta", "attachments_sensitive": "Nabarmendu eranskinak hunkigarri gisa ", "content_type": { @@ -136,10 +136,10 @@ "unlisted": "Mezu hau ez da argitaratuko Denbora-lerro Publikoan ezta Ezagutzen den Sarean" }, "scope": { - "direct": "Zuzena - Bidali aipatutako erabiltzaileei besterik ez", - "private": "Jarraitzaileentzako bakarrik- Bidali jarraitzaileentzat bakarrik", - "public": "Publickoa - Bistaratu denbora-lerro publikoetan", - "unlisted": "Zerrendatu gabea - ez bidali denbora-lerro publikoetan" + "direct": "Zuzena: Bidali aipatutako erabiltzaileei besterik ez", + "private": "Jarraitzaileentzako bakarrik: Bidali jarraitzaileentzat bakarrik", + "public": "Publikoa: Bistaratu denbora-lerro publikoetan", + "unlisted": "Zerrendatu gabea: ez bidali denbora-lerro publikoetara" } }, "registration": { @@ -276,7 +276,7 @@ "no_blocks": "Ez daude erabiltzaile blokeatutak", "no_mutes": "Ez daude erabiltzaile mututuak", "hide_follows_description": "Ez erakutsi nor jarraitzen ari naizen", - "hide_followers_description": "Ez erakutsi nor ari de ni jarraitzen", + "hide_followers_description": "Ez erakutsi nor ari den ni jarraitzen", "show_admin_badge": "Erakutsi Administratzaile etiketa nire profilan", "show_moderator_badge": "Erakutsi Moderatzaile etiketa nire profilan", "nsfw_clickthrough": "Gaitu klika hunkigarri eranskinak ezkutatzeko", @@ -456,8 +456,8 @@ "time": { "day": "{0} egun", "days": "{0} egun", - "day_short": "{0}d", - "days_short": "{0}d", + "day_short": "{0}e", + "days_short": "{0}e", "hour": "{0} ordu", "hours": "{0} ordu", "hour_short": "{0}o", @@ -492,7 +492,7 @@ "conversation": "Elkarrizketa", "error_fetching": "Errorea eguneraketak eskuratzen", "load_older": "Kargatu mezu zaharragoak", - "no_retweet_hint": "Mezu hau jarraitzailentzko bakarrik markatuta dago eta ezin da errepikatu", + "no_retweet_hint": "Mezu hau jarraitzailentzako bakarrik markatuta dago eta ezin da errepikatu", "repeated": "Errepikatuta", "show_new": "Berriena erakutsi", "up_to_date": "Eguneratuta", @@ -507,7 +507,7 @@ "unpin": "Aingura ezeztatu profilatik", "pinned": "Ainguratuta", "delete_confirm": "Mezu hau benetan ezabatu nahi duzu?", - "reply_to": "Erantzun", + "reply_to": "Erantzuten", "replies_list": "Erantzunak:", "mute_conversation": "Elkarrizketa isilarazi", "unmute_conversation": "Elkarrizketa aktibatu" @@ -583,7 +583,7 @@ }, "tool_tip": { "media_upload": "Multimedia igo", - "repeat": "Erreplikatu", + "repeat": "Errepikatu", "reply": "Erantzun", "favorite": "Gogokoa", "user_settings": "Erabiltzaile ezarpenak" From 5026d3719ad4605fd24e8961be8b0fbeab5f4796 Mon Sep 17 00:00:00 2001 From: tarteka Date: Sat, 7 Sep 2019 09:07:34 +0200 Subject: [PATCH 06/24] fix some translates --- src/i18n/eu.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/eu.json b/src/i18n/eu.json index 6cbdb1156c..0120acc533 100644 --- a/src/i18n/eu.json +++ b/src/i18n/eu.json @@ -228,7 +228,7 @@ "avatar_size_instruction": "Avatar irudien gomendatutako gutxieneko tamaina 150x150 pixel dira.", "export_theme": "Gorde aurre-ezarpena", "filtering": "Iragazten", - "filtering_explanation": "Hitz hauek dituzten muzu guztiak isilduak izango dira. Lerro bakoitzeko bat", + "filtering_explanation": "Hitz hauek dituzten mezu guztiak isilduak izango dira. Lerro bakoitzeko bat", "follow_export": "Jarraitzen dituzunak esportatu", "follow_export_button": "Esportatu zure jarraitzaileak csv fitxategi batean", "follow_import": "Jarraitzen dituzunak inportatu", From 6217ef4718ae6241bad7be04054dc062821cba5f Mon Sep 17 00:00:00 2001 From: tarteka Date: Tue, 10 Sep 2019 10:09:07 +0200 Subject: [PATCH 07/24] fix some translates --- src/i18n/eu.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/i18n/eu.json b/src/i18n/eu.json index 0120acc533..ad8f4c0536 100644 --- a/src/i18n/eu.json +++ b/src/i18n/eu.json @@ -603,10 +603,10 @@ } }, "search": { - "people": "Gendea", + "people": "Erabiltzaileak", "hashtags": "Traolak", "person_talking": "{count} pertsona hitzegiten", - "people_talking": "{count} gende hitzegiten", + "people_talking": "{count} jende hitzegiten", "no_results": "Emaitzarik ez" }, "password_reset": { From 8618857aa36574f52a23106cd0d57fd96782435b Mon Sep 17 00:00:00 2001 From: taehoon Date: Fri, 6 Sep 2019 11:15:22 -0400 Subject: [PATCH 08/24] collapse fav/repeat notifications from muted users --- src/components/notification/notification.js | 14 +- src/components/notification/notification.vue | 202 ++++++++++-------- .../notifications/notifications.scss | 5 +- 3 files changed, 128 insertions(+), 93 deletions(-) diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js index 896c6d52d2..181f771584 100644 --- a/src/components/notification/notification.js +++ b/src/components/notification/notification.js @@ -9,7 +9,8 @@ const Notification = { data () { return { userExpanded: false, - betterShadow: this.$store.state.interface.browserSupport.cssFilter + betterShadow: this.$store.state.interface.browserSupport.cssFilter, + unmuted: false } }, props: [ 'notification' ], @@ -23,11 +24,14 @@ const Notification = { toggleUserExpanded () { this.userExpanded = !this.userExpanded }, - userProfileLink (user) { + generateUserProfileLink (user) { return generateProfileLink(user.id, user.screen_name, this.$store.state.instance.restrictedNicknames) }, getUser (notification) { return this.$store.state.users.usersObject[notification.from_profile.id] + }, + toggleMute () { + this.unmuted = !this.unmuted } }, computed: { @@ -47,6 +51,12 @@ const Notification = { return this.userInStore } return this.notification.from_profile + }, + userProfileLink () { + return this.generateUserProfileLink(this.notification.from_profile) + }, + needMute () { + return this.notification.from_profile.muted } } } diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue index bafcd02656..1f192c7709 100644 --- a/src/components/notification/notification.vue +++ b/src/components/notification/notification.vue @@ -4,104 +4,126 @@ :compact="true" :statusoid="notification.status" /> -
- +
- - -
- - -
- - - - {{ notification.from_profile.name }} - - - {{ $t('notifications.favorited_you') }} - - - + + {{ notification.from_profile.screen_name }} + + + +
+
+ + + +
+ + +
+ + - {{ $t('notifications.repeated_you') }} - - - - {{ $t('notifications.followed_you') }} - -
+ + {{ notification.from_profile.name }} + + + {{ $t('notifications.favorited_you') }} + + + + {{ $t('notifications.repeated_you') }} + + + + {{ $t('notifications.followed_you') }} + +
+
+ + + +
+
+ + + +
+ +
- - - -
-
- - + + @{{ notification.from_profile.screen_name }}
- - -
diff --git a/src/components/notifications/notifications.scss b/src/components/notifications/notifications.scss index 622d12f477..71876b1451 100644 --- a/src/components/notifications/notifications.scss +++ b/src/components/notifications/notifications.scss @@ -33,7 +33,6 @@ .notification { box-sizing: border-box; - display: flex; border-bottom: 1px solid; border-color: $fallback--border; border-color: var(--border, $fallback--border); @@ -47,6 +46,10 @@ } } + .muted { + padding: .25em .6em; + } + .non-mention { display: flex; flex: 1; From f8139e369c0ca4ae90cca78c5d1fee69b88375d6 Mon Sep 17 00:00:00 2001 From: taehoon Date: Tue, 10 Sep 2019 16:21:52 -0400 Subject: [PATCH 09/24] wire up user state with global store --- src/components/notification/notification.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js index 181f771584..8e817f3beb 100644 --- a/src/components/notification/notification.js +++ b/src/components/notification/notification.js @@ -53,10 +53,10 @@ const Notification = { return this.notification.from_profile }, userProfileLink () { - return this.generateUserProfileLink(this.notification.from_profile) + return this.generateUserProfileLink(this.user) }, needMute () { - return this.notification.from_profile.muted + return this.user.muted } } } From 5ff899b455e07e41eb1b89985177655279f8263f Mon Sep 17 00:00:00 2001 From: taehoon Date: Tue, 17 Sep 2019 15:59:17 -0400 Subject: [PATCH 10/24] add mention button --- src/components/user_card/user_card.js | 3 +++ src/components/user_card/user_card.vue | 9 +++++++++ src/i18n/en.json | 1 + 3 files changed, 13 insertions(+) diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js index e3bd769789..d42be9fc8f 100644 --- a/src/components/user_card/user_card.js +++ b/src/components/user_card/user_card.js @@ -168,6 +168,9 @@ export default { } this.$store.dispatch('setMedia', [attachment]) this.$store.dispatch('setCurrent', attachment) + }, + mentionUser () { + } } } diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index 0b83cf168d..f25d16d364 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -188,6 +188,15 @@
+
+ +
+
Date: Thu, 19 Sep 2019 13:27:37 -0400 Subject: [PATCH 12/24] add new module and modal to post new status --- src/App.js | 4 +- src/App.vue | 1 + .../post_status_modal/post_status_modal.js | 25 +++++++++++ .../post_status_modal/post_status_modal.vue | 42 +++++++++++++++++++ src/components/user_card/user_card.js | 2 +- src/main.js | 4 +- src/modules/postStatus.js | 25 +++++++++++ 7 files changed, 100 insertions(+), 3 deletions(-) create mode 100644 src/components/post_status_modal/post_status_modal.js create mode 100644 src/components/post_status_modal/post_status_modal.vue create mode 100644 src/modules/postStatus.js diff --git a/src/App.js b/src/App.js index e9cd5917d3..40f362d2c8 100644 --- a/src/App.js +++ b/src/App.js @@ -11,6 +11,7 @@ import SideDrawer from './components/side_drawer/side_drawer.vue' import MobilePostStatusModal from './components/mobile_post_status_modal/mobile_post_status_modal.vue' import MobileNav from './components/mobile_nav/mobile_nav.vue' import UserReportingModal from './components/user_reporting_modal/user_reporting_modal.vue' +import PostStatusModal from './components/post_status_modal/post_status_modal.vue' import { windowWidth } from './services/window_utils/window_utils' export default { @@ -28,7 +29,8 @@ export default { SideDrawer, MobilePostStatusModal, MobileNav, - UserReportingModal + UserReportingModal, + PostStatusModal }, data: () => ({ mobileActivePanel: 'timeline', diff --git a/src/App.vue b/src/App.vue index 719e00a4d7..46d3ac42cf 100644 --- a/src/App.vue +++ b/src/App.vue @@ -109,6 +109,7 @@ /> +
diff --git a/src/components/post_status_modal/post_status_modal.js b/src/components/post_status_modal/post_status_modal.js new file mode 100644 index 0000000000..86a4e1d8b2 --- /dev/null +++ b/src/components/post_status_modal/post_status_modal.js @@ -0,0 +1,25 @@ +import PostStatusForm from '../post_status_form/post_status_form.vue' + +const PostStatusModal = { + components: { + PostStatusForm + }, + computed: { + isLoggedIn () { + return !!this.$store.state.users.currentUser + }, + isOpen () { + return this.isLoggedIn && this.$store.state.postStatus.modalActivated + }, + params () { + return this.$store.state.postStatus.params + } + }, + methods: { + closeModal () { + this.$store.dispatch('closePostStatusModal') + } + } +} + +export default PostStatusModal diff --git a/src/components/post_status_modal/post_status_modal.vue b/src/components/post_status_modal/post_status_modal.vue new file mode 100644 index 0000000000..85a5401cff --- /dev/null +++ b/src/components/post_status_modal/post_status_modal.vue @@ -0,0 +1,42 @@ + + + + + diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js index d42be9fc8f..0c200ad11b 100644 --- a/src/components/user_card/user_card.js +++ b/src/components/user_card/user_card.js @@ -170,7 +170,7 @@ export default { this.$store.dispatch('setCurrent', attachment) }, mentionUser () { - + this.$store.dispatch('openPostStatusModal', { replyTo: true, repliedUser: this.user }) } } } diff --git a/src/main.js b/src/main.js index b3256e8ed7..a43d31e24a 100644 --- a/src/main.js +++ b/src/main.js @@ -15,6 +15,7 @@ import mediaViewerModule from './modules/media_viewer.js' import oauthTokensModule from './modules/oauth_tokens.js' import reportsModule from './modules/reports.js' import pollsModule from './modules/polls.js' +import postStatusModule from './modules/postStatus.js' import VueI18n from 'vue-i18n' @@ -76,7 +77,8 @@ const persistedStateOptions = { mediaViewer: mediaViewerModule, oauthTokens: oauthTokensModule, reports: reportsModule, - polls: pollsModule + polls: pollsModule, + postStatus: postStatusModule }, plugins: [persistedState, pushNotifications], strict: false // Socket modifies itself, let's ignore this for now. diff --git a/src/modules/postStatus.js b/src/modules/postStatus.js new file mode 100644 index 0000000000..638c1fb202 --- /dev/null +++ b/src/modules/postStatus.js @@ -0,0 +1,25 @@ +const postStatus = { + state: { + params: null, + modalActivated: false + }, + mutations: { + openPostStatusModal (state, params) { + state.params = params + state.modalActivated = true + }, + closePostStatusModal (state) { + state.modalActivated = false + } + }, + actions: { + openPostStatusModal ({ commit }, params) { + commit('openPostStatusModal', params) + }, + closePostStatusModal ({ commit }) { + commit('closePostStatusModal') + } + } +} + +export default postStatus From a9f33272a860fd95def54c7dafa863056324122d Mon Sep 17 00:00:00 2001 From: taehoon Date: Thu, 19 Sep 2019 13:52:20 -0400 Subject: [PATCH 13/24] refactor MobilePostStatusModal using new PostStatusModal --- .../mobile_post_status_modal.js | 21 ++--------- .../mobile_post_status_modal.vue | 36 +------------------ 2 files changed, 4 insertions(+), 53 deletions(-) diff --git a/src/components/mobile_post_status_modal/mobile_post_status_modal.js b/src/components/mobile_post_status_modal/mobile_post_status_modal.js index 3cec23c64f..3be4a1d8dc 100644 --- a/src/components/mobile_post_status_modal/mobile_post_status_modal.js +++ b/src/components/mobile_post_status_modal/mobile_post_status_modal.js @@ -1,14 +1,9 @@ -import PostStatusForm from '../post_status_form/post_status_form.vue' import { debounce } from 'lodash' const MobilePostStatusModal = { - components: { - PostStatusForm - }, data () { return { hidden: false, - postFormOpen: false, scrollingDown: false, inputActive: false, oldScrollPos: 0, @@ -28,8 +23,8 @@ const MobilePostStatusModal = { window.removeEventListener('resize', this.handleOSK) }, computed: { - currentUser () { - return this.$store.state.users.currentUser + isLoggedIn () { + return !!this.$store.state.users.currentUser }, isHidden () { return this.autohideFloatingPostButton && (this.hidden || this.inputActive) @@ -57,17 +52,7 @@ const MobilePostStatusModal = { window.removeEventListener('scroll', this.handleScrollEnd) }, openPostForm () { - this.postFormOpen = true - this.hidden = true - - const el = this.$el.querySelector('textarea') - this.$nextTick(function () { - el.focus() - }) - }, - closePostForm () { - this.postFormOpen = false - this.hidden = false + this.$store.dispatch('openPostStatusModal') }, handleOSK () { // This is a big hack: we're guessing from changed window sizes if the diff --git a/src/components/mobile_post_status_modal/mobile_post_status_modal.vue b/src/components/mobile_post_status_modal/mobile_post_status_modal.vue index b6d7d3ba10..38c5fce0ee 100644 --- a/src/components/mobile_post_status_modal/mobile_post_status_modal.vue +++ b/src/components/mobile_post_status_modal/mobile_post_status_modal.vue @@ -1,23 +1,5 @@ - +