|
2 | 2 |
|
3 | 3 | module ReactOnRails |
4 | 4 | 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 | | - |
9 | 5 | # Generates the complete component specification script tag. |
10 | 6 | # Handles both immediate hydration (Pro feature) and standard cases. |
11 | 7 | def generate_component_script(render_options) |
@@ -71,36 +67,5 @@ def generate_store_script(redux_store_data) |
71 | 67 | "#{pro_warning_badge}\n#{store_hydration_scripts}".html_safe |
72 | 68 | end |
73 | 69 |
|
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 |
105 | 70 | end |
106 | 71 | end |
0 commit comments