Backfill dark theme for iOS app compatibility (#20269)
This commit is contained in:
parent
549a7bd9d0
commit
c6377ab607
3 changed files with 5 additions and 1 deletions
|
|
@ -80,6 +80,9 @@ class UserDecorator < ApplicationDecorator
|
|||
"trusted-status-#{trusted?}",
|
||||
"#{setting.config_navbar.tr('_', '-')}-header",
|
||||
]
|
||||
|
||||
# Backfill ten-x-hacker-theme because the ios app looks for it to render native dark shell.
|
||||
body_class << "ten-x-hacker-theme" if setting.config_theme == "dark_theme"
|
||||
body_class.join(" ")
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ RSpec.describe UserDecorator, type: :decorator do
|
|||
dark-theme sans-serif-article-body
|
||||
mod-status-#{user.admin? || !user.moderator_for_tags.empty?}
|
||||
trusted-status-#{user.trusted?} #{user.setting.config_navbar}-header
|
||||
ten-x-hacker-theme
|
||||
].join(" ")
|
||||
expect(user.decorate.config_body_class).to eq(expected_result)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -656,7 +656,7 @@ RSpec.describe User do
|
|||
user.setting.config_theme = "dark_theme"
|
||||
|
||||
# rubocop:disable Layout/LineLength
|
||||
classes = "dark-theme sans-serif-article-body mod-status-#{user.admin? || !user.moderator_for_tags.empty?} trusted-status-#{user.trusted?} #{user.setting.config_navbar}-header"
|
||||
classes = "dark-theme sans-serif-article-body mod-status-#{user.admin? || !user.moderator_for_tags.empty?} trusted-status-#{user.trusted?} #{user.setting.config_navbar}-header ten-x-hacker-theme"
|
||||
# rubocop:enable Layout/LineLength
|
||||
expect(user.decorate.config_body_class).to eq(classes)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue