Skip to content

Commit cc6f86f

Browse files
claudejustin808
authored andcommitted
Remove pro_warning_badge helper methods and constant
Remove the visual warning badge HTML generation code: - Remove IMMEDIATE_HYDRATION_PRO_WARNING constant - Remove pro_warning_badge_if_needed method - Remove disabled_pro_features_message method These methods generated a red banner in the corner of the page when non-pro users tried to enable pro-only features. This functionality is being removed as part of the plan to separate pro features from the core gem. The calls to pro_warning_badge_if_needed will be removed in subsequent commits.
1 parent 7f38f00 commit cc6f86f

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

lib/react_on_rails/pro_helper.rb

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
module ReactOnRails
44
module ProHelper
5-
IMMEDIATE_HYDRATION_PRO_WARNING = "[REACT ON RAILS] The 'immediate_hydration' feature requires a " \
6-
"React on Rails Pro license. " \
7-
"Please visit https://shakacode.com/react-on-rails-pro to learn more."
8-
95
# Generates the complete component specification script tag.
106
# Handles both immediate hydration (Pro feature) and standard cases.
117
def generate_component_script(render_options)
@@ -71,36 +67,5 @@ def generate_store_script(redux_store_data)
7167
"#{pro_warning_badge}\n#{store_hydration_scripts}".html_safe
7268
end
7369

74-
def pro_warning_badge_if_needed(explicitly_disabled_pro_options)
75-
return "" unless explicitly_disabled_pro_options.any?
76-
77-
disabled_features_message = disabled_pro_features_message(explicitly_disabled_pro_options)
78-
warning_message = "[REACT ON RAILS] #{disabled_features_message}\n" \
79-
"Please visit https://shakacode.com/react-on-rails-pro to learn more."
80-
puts warning_message
81-
Rails.logger.warn warning_message
82-
83-
tooltip_text = "#{disabled_features_message} Click to learn more."
84-
85-
<<~HTML.strip
86-
<a href="https://shakacode.com/react-on-rails-pro" target="_blank" rel="noopener noreferrer" title="#{tooltip_text}">
87-
<div style="position: fixed; top: 0; right: 0; width: 180px; height: 180px; overflow: hidden; z-index: 9999; pointer-events: none;">
88-
<div style="position: absolute; top: 50px; right: -40px; transform: rotate(45deg); background-color: rgba(220, 53, 69, 0.85); color: white; padding: 7px 40px; text-align: center; font-weight: bold; font-family: sans-serif; font-size: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.3); pointer-events: auto;">
89-
React On Rails Pro Required
90-
</div>
91-
</div>
92-
</a>
93-
HTML
94-
end
95-
96-
def disabled_pro_features_message(explicitly_disabled_pro_options)
97-
return "".html_safe unless explicitly_disabled_pro_options.any?
98-
99-
feature_list = explicitly_disabled_pro_options.join(", ")
100-
feature_word = explicitly_disabled_pro_options.size == 1 ? "feature" : "features"
101-
"The '#{feature_list}' #{feature_word} " \
102-
"#{explicitly_disabled_pro_options.size == 1 ? 'requires' : 'require'} a " \
103-
"React on Rails Pro license. "
104-
end
10570
end
10671
end

0 commit comments

Comments
 (0)