-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1911 from tactilenews/fix_signal_onboarding
Fix signal onboarding
- Loading branch information
Showing
38 changed files
with
4,935 additions
and
314 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 6 additions & 31 deletions
37
app/components/onboarding_signal_link/onboarding_signal_link.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,14 @@ | ||
<%= c 'stack', **attrs do %> | ||
|
||
<%= c 'stack', class: 'text-serif text-center', space: :xsmall do %> | ||
<%= c 'heading', tag: :h1 do %> | ||
<%= t('components.onboarding_signal_link.heading') %> | ||
<%= t 'components.onboarding_signal_link.heading' %> | ||
<% end %> | ||
|
||
<p> | ||
<%= t('components.onboarding_signal_link.text').html_safe %> | ||
</p> | ||
|
||
<p> | ||
<%= t('components.onboarding_signal_link.action', | ||
number: Setting.signal_server_phone_number.phony_formatted(spaces: ' ') | ||
).html_safe %> | ||
</p> | ||
<% end %> | ||
|
||
<%= c 'stack', space: :small do %> | ||
<%= c 'button', | ||
styles: [:block, :primary], | ||
link: "https://signal.me/#p/#{Setting.signal_server_phone_number}", | ||
label: t('components.onboarding_signal_link.link'), | ||
target: '_blank', | ||
rel: 'noopener noreferrer' | ||
%> | ||
|
||
<%= c 'copy_button', | ||
styles: [:block, :secondary], | ||
label: t('components.onboarding_signal_link.copy'), | ||
copy: Setting.signal_server_phone_number | ||
%> | ||
|
||
<p class="text-small text-light text-center"> | ||
<%= t('components.onboarding_signal_link.help') %> | ||
</p> | ||
<p><%= t 'components.onboarding_signal_link.text' %></p> | ||
<% end %> | ||
|
||
<%= c 'steps_list', | ||
class: 'text-serif', | ||
steps: fallback_steps.map(&:html_safe) | ||
%> | ||
<% end %> |
17 changes: 16 additions & 1 deletion
17
app/components/onboarding_signal_link/onboarding_signal_link.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,20 @@ | ||
# frozen_string_literal: true | ||
|
||
module OnboardingSignalLink | ||
class OnboardingSignalLink < ApplicationComponent; end | ||
class OnboardingSignalLink < ApplicationComponent | ||
def initialize(signal_onboarding_token:, **) | ||
super | ||
|
||
@signal_onboarding_token = signal_onboarding_token | ||
end | ||
|
||
private | ||
|
||
attr_reader :signal_onboarding_token | ||
|
||
def fallback_steps | ||
data = { signal_server_phone_number: Setting.signal_server_phone_number, token: signal_onboarding_token } | ||
I18n.t('components.onboarding_signal_link.steps', **data) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.