From cb42dd8497a88523b4a1395a61027f0ee9af78d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Tue, 8 Aug 2017 21:42:29 +0200 Subject: [PATCH] Fix onboarding modal & add re-open button (#129) * Added a button to open the onboarding modal * Fixed onboarding modal * added a show-me-around getting-started menu button --- app/javascript/glitch/locales/en.json | 1 + .../compose/components/compose_form.js | 2 +- .../features/getting_started/index.js | 22 +++++++++++++++++-- .../ui/components/onboarding_modal.js | 4 ++-- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/app/javascript/glitch/locales/en.json b/app/javascript/glitch/locales/en.json index 7ec381de12..18e412356f 100644 --- a/app/javascript/glitch/locales/en.json +++ b/app/javascript/glitch/locales/en.json @@ -5,6 +5,7 @@ "layout.desktop": "Desktop", "layout.mobile": "Mobile", "navigation_bar.app_settings": "App settings", + "getting_started.onboarding": "Show me around", "onboarding.page_one.federation": "{domain} is an 'instance' of Mastodon. Mastodon is a network of independent servers joining up to make one larger social network. We call these servers instances.", "onboarding.page_one.welcome": "Welcome to {domain}!", "onboarding.page_six.github": "{domain} runs on Glitchsoc. Glitchsoc is a friendly {fork} of {Mastodon}, and is compatible with any Mastodon instance or app. Glitchsoc is entirely free and open-source. You can report bugs, request features, or contribute to the code on {github}.", diff --git a/app/javascript/mastodon/features/compose/components/compose_form.js b/app/javascript/mastodon/features/compose/components/compose_form.js index 0027783b4e..000e414fef 100644 --- a/app/javascript/mastodon/features/compose/components/compose_form.js +++ b/app/javascript/mastodon/features/compose/components/compose_form.js @@ -150,7 +150,7 @@ export default class ComposeForm extends ImmutablePureComponent { render () { const { intl, onPaste, showSearch } = this.props; const disabled = this.props.is_submitting; - const maybeEye = this.props.advanced_options.get('do_not_federate') ? ' 👁️' : ''; + const maybeEye = (this.props.advanced_options && this.props.advanced_options.do_not_federate) ? ' 👁️' : ''; const text = [this.props.spoiler_text, countableText(this.props.text), maybeEye].join(''); let publishText = ''; diff --git a/app/javascript/mastodon/features/getting_started/index.js b/app/javascript/mastodon/features/getting_started/index.js index 684612b1c4..2efab66f50 100644 --- a/app/javascript/mastodon/features/getting_started/index.js +++ b/app/javascript/mastodon/features/getting_started/index.js @@ -25,6 +25,7 @@ const messages = defineMessages({ blocks: { id: 'navigation_bar.blocks', defaultMessage: 'Blocked users' }, mutes: { id: 'navigation_bar.mutes', defaultMessage: 'Muted users' }, info: { id: 'navigation_bar.info', defaultMessage: 'Extended information' }, + show_me_around: { id: 'getting_started.onboarding', defaultMessage: 'Show me around' }, }); const mapStateToProps = state => ({ @@ -48,6 +49,11 @@ export default class GettingStarted extends ImmutablePureComponent { this.props.dispatch(openModal('SETTINGS', {})); } + openOnboardingModal = (e) => { + e.preventDefault(); + this.props.dispatch(openModal('ONBOARDING')); + } + render () { const { intl, me, columns, multiColumn } = this.props; @@ -92,6 +98,7 @@ export default class GettingStarted extends ImmutablePureComponent { {navItems} + @@ -100,13 +107,24 @@ export default class GettingStarted extends ImmutablePureComponent {

- + + +  •  + + +  •  + + +

glitch-soc/mastodon, Mastodon: Mastodon }} + values={{ + github: glitch-soc/mastodon, + Mastodon: Mastodon, + }} />

diff --git a/app/javascript/mastodon/features/ui/components/onboarding_modal.js b/app/javascript/mastodon/features/ui/components/onboarding_modal.js index 1b1cb00dab..0c872f40df 100644 --- a/app/javascript/mastodon/features/ui/components/onboarding_modal.js +++ b/app/javascript/mastodon/features/ui/components/onboarding_modal.js @@ -44,7 +44,7 @@ const PageTwo = ({ me }) => (
- +
( />
- +