From dabde183b81d0b015831ee5f5a6c77068188fe66 Mon Sep 17 00:00:00 2001 From: happyman125 Date: Fri, 22 Jan 2021 17:44:56 +0200 Subject: [PATCH 01/33] Fix search bar issue on small device --- src/app/mail/mail-header/mail-header.component.html | 9 ++++++--- src/app/mail/mail-header/mail-header.component.scss | 4 ++-- .../mail-sidebar/compose-mail/compose-mail.component.ts | 1 - 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/app/mail/mail-header/mail-header.component.html b/src/app/mail/mail-header/mail-header.component.html index 8852f8b01..286f9b281 100644 --- a/src/app/mail/mail-header/mail-header.component.html +++ b/src/app/mail/mail-header/mail-header.component.html @@ -24,7 +24,7 @@
-
@@ -76,7 +75,6 @@
- @@ -88,7 +86,6 @@
- @@ -100,7 +97,6 @@
-
 
diff --git a/src/app/mail/mail-settings/mail-autoresponder/mail-autoresponder.component.html b/src/app/mail/mail-settings/mail-autoresponder/mail-autoresponder.component.html index 1cdd477f5..87553d333 100644 --- a/src/app/mail/mail-settings/mail-autoresponder/mail-autoresponder.component.html +++ b/src/app/mail/mail-settings/mail-autoresponder/mail-autoresponder.component.html @@ -48,11 +48,11 @@
- +
- +
diff --git a/src/app/mail/mail-settings/mail-settings.component.html b/src/app/mail/mail-settings/mail-settings.component.html index d94b02a47..36457ee19 100644 --- a/src/app/mail/mail-settings/mail-settings.component.html +++ b/src/app/mail/mail-settings/mail-settings.component.html @@ -498,91 +498,93 @@
-
-
-
- -
-
-
-
-
- - +
+
+
+
+ +
+
+
+
+
+ + +
-
-
-
- - +
+
+ + +
-
-
-
- - +
+
+ + +
-
-
-
-
- -
-
-
-
-
- - +
+
+
+ +
+
+
+
+
+ + +
-
-
-
- - +
+
+ + +
-
-
-
-
- -
-
-
-
-
- - +
+
+
+ +
+
+
+
+
+ + +
-
-
-
- - +
+
+ + +
-
-
-
-
- -
- - - -
-

You can write the custom css here in order to customize the display of your mailbox.

+
+
+
+ +
+
+ +
+
+

You can write the custom css here in order to customize the display of your mailbox.

+
diff --git a/src/app/mail/mail-sidebar/mail-sidebar.component.html b/src/app/mail/mail-sidebar/mail-sidebar.component.html index c0d81dfc4..59142e67a 100644 --- a/src/app/mail/mail-sidebar/mail-sidebar.component.html +++ b/src/app/mail/mail-sidebar/mail-sidebar.component.html @@ -174,7 +174,7 @@ - + warranty-canary
diff --git a/src/app/mail/mail-sidebar/mail-sidebar.component.scss b/src/app/mail/mail-sidebar/mail-sidebar.component.scss index 03848e85b..39744324c 100644 --- a/src/app/mail/mail-sidebar/mail-sidebar.component.scss +++ b/src/app/mail/mail-sidebar/mail-sidebar.component.scss @@ -152,3 +152,9 @@ .mail-allemails { opacity: 0.7; } + +.mailbox-sidebar-footer .warranty-canary-image { + height: 25px; + width: 26px; + margin-top: 6px; +} diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index a51e7483f..5429b5d91 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -354,6 +354,8 @@ "restrict": "Restrict to time range", "start_time": "Start Time", "end_time": "End Time", + "start_date": "Start Date", + "end_date": "End Date", "auto_message": "Email autoresponse message", "message": "Message", "vac_autoresponder": "Vacation Autoresponder", From 0106a70435ecbda43041669836660b3b4a19fa81 Mon Sep 17 00:00:00 2001 From: happyman125 Date: Wed, 27 Jan 2021 11:48:01 +0200 Subject: [PATCH 08/33] make consistent pricing wording and features --- .../pricing-plans.component.html | 64 +++++++++---------- .../pricing-plans.component.scss | 4 ++ src/app/store/datatypes.ts | 4 ++ src/assets/i18n/en.json | 32 ++++++---- src/assets/static/pricing-plans.json | 38 +++++++++-- 5 files changed, 86 insertions(+), 56 deletions(-) diff --git a/src/app/shared/components/pricing-plans/pricing-plans.component.html b/src/app/shared/components/pricing-plans/pricing-plans.component.html index 507462d5e..c088a3cfa 100644 --- a/src/app/shared/components/pricing-plans/pricing-plans.component.html +++ b/src/app/shared/components/pricing-plans/pricing-plans.component.html @@ -22,33 +22,30 @@

Packages

-
Messages per day
-
Attachment limit (MB)
-
Storage (GB)
+
Sending limits
+
Attachments limit
+
Storage
Aliases
Custom domains
+
Folders

Features

-
Encryption in transit (SSL/TLS)
-
Encrypted attachments
-
Encrypted content
-
Encrypted contacts
-
Encrypted subjects
-
Encrypted metadata (Coming soon)
-
Virus detection tool
-
2 Factor authentication
-
Anti phishing
-
Brute force protection
-
Zero knowledge passwords
-
Strips IP from headers
-
Unhackable by others with SRI
-
Unhackable by us with checksums
-
Multi user support
-
Self destructing emails
-
Dead man timer
+
Encryption in transit
+
Encryption at rest
+
Encrypted attachments
+
Encrypted subject
+
Encrypted body
+
Virus protection
+
2FA security
+
Anti-phishing phrase
+
Brute-force proof
+
Zero-knowledge privacy
+
Anonymized IP
+
Self-destructing emails
+
Dead-man timer
Delayed delivery
-
Catch all emails
-
Unlimited folders
-
Exclusive access to new features
+
Catch-all domains
+
Remote encrypted link
+
Exclusive beta access
@@ -82,32 +79,29 @@

Features

Click here to switch to {{ selectedPaymentType === paymentTypeEnum.ANNUALLY ? 'monthly' : 'yearly' }}

-
{{ plan.messages_per_day }}
-
{{ plan.attachment_upload_limit }}
-
{{ plan.gb }}
+
{{ plan.messages_per_day }}
+
{{ plan.attachment_upload_limit }}/MB
+
{{ plan.gb }}GB
{{ plan.aliases }}
{{ plan.custom_domains }}
+
Unlimited

- + + - - - + - - - - + - +
diff --git a/src/app/shared/components/pricing-plans/pricing-plans.component.scss b/src/app/shared/components/pricing-plans/pricing-plans.component.scss index ce71878c2..030fc70fc 100644 --- a/src/app/shared/components/pricing-plans/pricing-plans.component.scss +++ b/src/app/shared/components/pricing-plans/pricing-plans.component.scss @@ -90,6 +90,10 @@ overflow: hidden; text-overflow: ellipsis; text-align: center; + + label { + margin-bottom: 0; + } } } diff --git a/src/app/store/datatypes.ts b/src/app/store/datatypes.ts index a2f146a44..77aa60083 100644 --- a/src/app/store/datatypes.ts +++ b/src/app/store/datatypes.ts @@ -613,6 +613,8 @@ export interface PricingPlan { domain_count: number; email_count: number; encrypted_attachments: boolean; + encryption_at_rest: boolean; + encrypted_body: boolean; encrypted_contacts: boolean; encrypted_content: boolean; encrypted_metadata: boolean; @@ -632,7 +634,9 @@ export interface PricingPlan { two_fa: boolean; unlimited_folders: boolean; virus_detection_tool: boolean; + anonymized_ip: boolean; zero_knowledge_password: boolean; + remote_encrypted_link: boolean; } export enum TransactionStatus { diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 33e180106..08320e221 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -579,33 +579,36 @@ "sending_spam": "**CTemplar can not be used for sending spam or bulk emails", "plan_price": "Plan & Price", "packages": "Packages", - "messages_per_day": "Messages per day", + "messages_per_day": "Sending limits", "page_pricing": "Attachment limit (MB)", - "attachment_limit": "Attachment limit (MB)", - "storage": "Storage (GB)", + "attachment_limit": "Attachments limit", + "storage": "Storage", "aliases": "Aliases", "custom_domains": "Custom domains", "features": "Features", - "encryption_in_transit": "Encryption in transit(SSL/TLS)", + "encryption_in_transit": "Encryption in transit", + "encryption_at_rest": "Encryption at rest", "encrypted_attachments": "Encrypted attachments", "encrypted_contact": "Encrypted contacts", - "encrypted_subjects": "Encrypted subjects", + "encrypted_subjects": "Encrypted subject", + "encrypted_body": "Encrypted body", "encypted_metadata": "Encrypted metadata (Coming soon)", - "virus_detection": "Virus detection tool (Coming soon)", - "anti_phishing": "Anti phishing", - "zero_knowledge": "Zero knowledge passwords", + "virus_protection": "Virus protection", + "anti_phishing": "Anti-phishing phrase", + "zero_knowledge": "Zero-knowledge privacy", "stripes_ip": "Strips IP from headers", "unhackable_by_siri": "Unhackable by others with SRI", "unhackable_by_checksum": "Unhackable by us with checksums", "multi_user": "Multi user support", - "self_destructing": "Self destructing emails", - "dead_man_timer": "Dead man timer", + "anonymized_ip": "Anonymized IP", + "self_destructing": "Self-destructing emails", + "dead_man_timer": "Dead-man timer", "delayed_delivery": "Delayed delivery", - "catch_all_emails": "Catch all emails", + "catch_all_emails": "Catch-all domains", "unlimited_folders": "Unlimited folders", - "exclusive_access": "Exclusive access to new features", + "exclusive_access": "Exclusive beta access", "two_factore_auth": "2 Factor authentication", - "brute_force": "Brute force protection", + "brute_force": "Brute-force proof", "encrypted_content": "Encrypted content", "upgrade_anytime": "Upgrade
anytime", "select": "Select", @@ -628,8 +631,9 @@ "upload_limit_MB": "Attachment upload limit in MB", "storage_in_GB": "Storage in GB", "mail_aliases": "Email aliases", - "two_fac_authentication": "Two factor authentication", + "2fa_security": "2FA security", "support_custom_domains": "Multi user support under custom domains", + "remote_encrypted_link": "Remote encrypted link", "mails_of_custom_dom": "Catch all emails of a custom domain" }, "login": { diff --git a/src/assets/static/pricing-plans.json b/src/assets/static/pricing-plans.json index 5e0d22704..df752fc52 100644 --- a/src/assets/static/pricing-plans.json +++ b/src/assets/static/pricing-plans.json @@ -10,16 +10,20 @@ "gb": 1, "aliases": 0, "custom_domains": 0, - "ssl_tls": true, + "encryption_in_transit": true, + "encryption_at_rest": true, "encrypted_attachments": true, "encrypted_content": true, "encrypted_contacts": true, "encrypted_subjects": true, + "encrypted_body": true, "encrypted_metadata": false, "two_fa": true, "anti_phishing": true, "attachment_upload_limit": 10, "brute_force_protection": true, + "anonymized_ip": true, + "remote_encrypted_link": false, "zero_knowledge_password": true, "strip_ips": true, "sri": true, @@ -29,7 +33,7 @@ "dead_man_timer": false, "delayed_delivery": false, "four_data_deletion_methods": false, - "virus_detection_tool": false, + "virus_detection_tool": true, "catch_all_email": false, "unlimited_folders": true, "exclusive_access": false @@ -45,16 +49,20 @@ "gb": 5, "aliases": 10, "custom_domains": 1, - "ssl_tls": true, + "encryption_in_transit": true, + "encryption_at_rest": true, "encrypted_attachments": true, "encrypted_content": true, "encrypted_contacts": true, "encrypted_subjects": true, + "encrypted_body": true, "encrypted_metadata": true, "two_fa": true, "anti_phishing": true, "attachment_upload_limit": 50, "brute_force_protection": true, + "anonymized_ip": true, + "remote_encrypted_link": true, "zero_knowledge_password": true, "strip_ips": true, "sri": true, @@ -80,16 +88,20 @@ "gb": 10, "aliases": 30, "custom_domains": 5, - "ssl_tls": true, + "encryption_in_transit": true, + "encryption_at_rest": true, "encrypted_attachments": true, "encrypted_content": true, "encrypted_contacts": true, "encrypted_subjects": true, + "encrypted_body": true, "encrypted_metadata": true, "two_fa": true, "anti_phishing": true, "attachment_upload_limit": 50, "brute_force_protection": true, + "anonymized_ip": true, + "remote_encrypted_link": true, "zero_knowledge_password": true, "strip_ips": true, "sri": true, @@ -115,16 +127,20 @@ "gb": 20, "aliases": 60, "custom_domains": 10, - "ssl_tls": true, + "encryption_in_transit": true, + "encryption_at_rest": true, "encrypted_attachments": true, "encrypted_content": true, "encrypted_contacts": true, "encrypted_subjects": true, + "encrypted_body": true, "encrypted_metadata": true, "two_fa": true, "anti_phishing": true, "attachment_upload_limit": 50, "brute_force_protection": true, + "anonymized_ip": true, + "remote_encrypted_link": true, "zero_knowledge_password": true, "strip_ips": true, "sri": true, @@ -150,16 +166,20 @@ "gb": 50, "aliases": 100, "custom_domains": 25, - "ssl_tls": true, + "encryption_in_transit": true, + "encryption_at_rest": true, "encrypted_attachments": true, "encrypted_content": true, "encrypted_contacts": true, "encrypted_subjects": true, + "encrypted_body": true, "encrypted_metadata": true, "two_fa": true, "anti_phishing": true, "attachment_upload_limit": 50, "brute_force_protection": true, + "anonymized_ip": true, + "remote_encrypted_link": true, "zero_knowledge_password": true, "strip_ips": true, "sri": true, @@ -185,16 +205,20 @@ "gb": 50, "aliases": 200, "custom_domains": 100, - "ssl_tls": true, + "encryption_in_transit": true, + "encryption_at_rest": true, "encrypted_attachments": true, "encrypted_content": true, "encrypted_contacts": true, "encrypted_subjects": true, + "encrypted_body": true, "encrypted_metadata": true, "two_fa": true, "anti_phishing": true, "attachment_upload_limit": 50, "brute_force_protection": true, + "anonymized_ip": true, + "remote_encrypted_link": true, "zero_knowledge_password": true, "strip_ips": true, "sri": true, From 359748df956aea034290deeaace3d290aee199c7 Mon Sep 17 00:00:00 2001 From: Kostya Yelskiy Date: Wed, 27 Jan 2021 22:07:48 -0400 Subject: [PATCH 09/33] Update dark mode refactoring including light mode (updating bootstrap, variables) --- .../mail-footer/mail-footer.component.scss | 4 +- .../mail-header/mail-header.component.scss | 14 ++-- .../custom-domains.component.scss | 4 +- .../folders/folders.component.scss | 4 +- .../mail-settings.component.scss | 12 ++-- .../organization-users.component.scss | 4 +- .../mail-sidebar/mail-sidebar.component.scss | 1 + .../mail-sidebar/mail-sidebar.component.ts | 7 +- src/app/mail/mail.component.scss | 20 +++--- .../shared/services/theme-toggle-service.ts | 58 ++++++++++++++++ src/app/shared/shared.module.ts | 4 +- .../decrypt/decrypt-message.component.scss | 2 +- .../display-secure-message.component.scss | 2 +- .../reply-secure-message.component.scss | 2 +- .../users-sign-in.component.scss | 2 +- src/index.html | 4 +- src/styles.scss | 4 ++ src/styles/_theme-variables-collection.scss | 46 +++++++++++++ src/styles/_themes.scss | 11 +++ src/styles/base/_dark-variables.scss | 68 +++++++++++++++++++ src/styles/base/_light-variables.scss | 11 +++ src/styles/components.styles.scss | 2 +- src/styles/modules/_blocks.scss | 4 +- .../modules/bootstrap-overrides/_form.scss | 6 +- src/styles/modules/cards/_package.scss | 6 +- src/styles/modules/cards/_post.scss | 8 ++- .../modules/mail-composer/_mail-composer.scss | 18 ++--- .../modules/utilities/_form-fields.scss | 30 ++++---- .../pages/user-actions/_form-pages.scss | 8 ++- src/styles/vendors/bootstrap/_close.scss | 7 +- src/styles/vendors/bootstrap/_dropdown.scss | 12 ++-- src/styles/vendors/bootstrap/_reboot.scss | 7 +- .../vendors/bootstrap/mixins/_alert.scss | 4 +- .../vendors/bootstrap/mixins/_forms.scss | 2 +- 34 files changed, 318 insertions(+), 80 deletions(-) create mode 100644 src/app/shared/services/theme-toggle-service.ts create mode 100644 src/styles/_theme-variables-collection.scss create mode 100644 src/styles/_themes.scss create mode 100644 src/styles/base/_dark-variables.scss create mode 100644 src/styles/base/_light-variables.scss diff --git a/src/app/mail/mail-footer/mail-footer.component.scss b/src/app/mail/mail-footer/mail-footer.component.scss index 17ac0bf52..5b2eae7c0 100644 --- a/src/app/mail/mail-footer/mail-footer.component.scss +++ b/src/app/mail/mail-footer/mail-footer.component.scss @@ -32,7 +32,7 @@ > a { position: relative; display: block; - color: $brand-gray; + color: var(--brand-gray); &:hover { color: $brand-primary; } @@ -42,7 +42,7 @@ top: 50%; right: -0.5rem; content: ''; - border-right: 1px solid $brand-gray; + border-right: 1px solid var(--brand-gray); height: 10px; transform: translateY(-50%); } diff --git a/src/app/mail/mail-header/mail-header.component.scss b/src/app/mail/mail-header/mail-header.component.scss index 5111cebe0..ecd58632f 100644 --- a/src/app/mail/mail-header/mail-header.component.scss +++ b/src/app/mail/mail-header/mail-header.component.scss @@ -2,13 +2,15 @@ @import '../../../styles/vendors/include-media/include-media'; @import '../../../styles/config/include-media-config'; @import '../../../styles/vendors/ceaser/ceaser-easing'; +@import '../../../styles/theme-variables-collection'; +@import '../../../styles/themes'; // == Mailbox navbar .mailbox-navbar { position: relative; padding: 0.5rem 0.938rem; - background-color: $brand-faded; - border: 1px solid $dropdown-border-color; + background-color: var(--brand-faded); + border: 1px solid var(--dropdown-border-color); border-right: 0; border-left: 0; @@ -120,8 +122,8 @@ @include media('>sm') { padding: 0.438rem 0.813rem; background: $brand-white; - border: 1px solid $dropdown-border-color; - color: $brand-light-gray; + border: 1px solid var(--dropdown-border-color); + color: var(--brand-light-gray); font-size: 1.25rem; &.active, @@ -156,7 +158,7 @@ a:hover, .dropdown-toggle:hover { - background: $brand-faded; + background: var(--brand-faded); // TODO: add scss variables files in refactor color: #8a9095; border-color: #8a9095; @@ -179,7 +181,7 @@ .dropdown-toggle { padding-top: 0.938rem; padding-bottom: 0.938rem; - color: $brand-light-gray; + color: var(--brand-light-gray); font-size: 0.875rem; height: 3rem; width: 4.625rem; diff --git a/src/app/mail/mail-settings/custom-domains/custom-domains.component.scss b/src/app/mail/mail-settings/custom-domains/custom-domains.component.scss index 89aeff9bb..66e8c83ce 100644 --- a/src/app/mail/mail-settings/custom-domains/custom-domains.component.scss +++ b/src/app/mail/mail-settings/custom-domains/custom-domains.component.scss @@ -2,6 +2,8 @@ @import '~styles/vendors/include-media/include-media'; @import '~styles/config/include-media-config'; @import '~styles/vendors/ceaser/ceaser-easing'; +@import '~styles/theme-variables-collection'; +@import '~styles/themes'; .domain-body { padding-left: 1.563rem; @@ -126,7 +128,7 @@ &:hover { opacity: 1; - background-color: $brand-faded; + background-color: var(--brand-faded); color: #949494; } } diff --git a/src/app/mail/mail-settings/folders/folders.component.scss b/src/app/mail/mail-settings/folders/folders.component.scss index 4874c0f52..f1ed9d164 100644 --- a/src/app/mail/mail-settings/folders/folders.component.scss +++ b/src/app/mail/mail-settings/folders/folders.component.scss @@ -22,8 +22,8 @@ .folders-list { height: auto; - border-top: 1px solid $dropdown-border-color; - border-bottom: 1px solid $dropdown-border-color; + border-top: 1px solid var(--dropdown-border-color); + border-bottom: 1px solid var(--dropdown-border-color); } .sort-alphabetic-btn { diff --git a/src/app/mail/mail-settings/mail-settings.component.scss b/src/app/mail/mail-settings/mail-settings.component.scss index de66c77f4..3af790f9e 100644 --- a/src/app/mail/mail-settings/mail-settings.component.scss +++ b/src/app/mail/mail-settings/mail-settings.component.scss @@ -2,6 +2,8 @@ @import '../../../styles/vendors/include-media/include-media'; @import '../../../styles/config/include-media-config'; @import '../../../styles/vendors/ceaser/ceaser-easing'; +@import '../../../styles/theme-variables-collection'; +@import '../../../styles/themes'; $error-red: #e94e4c; @@ -31,9 +33,9 @@ $error-red: #e94e4c; } .info-list-detail { - background: white; + background: var(--brand-faded); i { - color: $body-color; + color: var(--body-color); } .info-list-action { margin-top: 1.5rem; @@ -51,7 +53,7 @@ $error-red: #e94e4c; align-items: center; flex-wrap: wrap; padding: 1.188rem 0.938rem; - background: $brand-faded; + background: var(--brand-faded); border: 1px solid darken($brand-faded, 3%); font-size: 0.875rem; line-height: 1.14; @@ -80,7 +82,7 @@ $error-red: #e94e4c; .info-list-val { width: calc(100% - 140px - 1.25rem); //~calc(100% - 65px - 1.25rem); i { - color: $body-color; + color: var(--body-color); } } @@ -291,7 +293,7 @@ $error-red: #e94e4c; padding-left: 0.563rem; .icon { - color: $brand-light-gray; + color: var(--brand-light-gray); font-size: 1.063rem; line-height: 1.188; } diff --git a/src/app/mail/mail-settings/organization/organization-users/organization-users.component.scss b/src/app/mail/mail-settings/organization/organization-users/organization-users.component.scss index 498a1749f..8868a54af 100644 --- a/src/app/mail/mail-settings/organization/organization-users/organization-users.component.scss +++ b/src/app/mail/mail-settings/organization/organization-users/organization-users.component.scss @@ -1,4 +1,6 @@ @import '~styles/base/variables'; +@import '~styles/theme-variables-collection'; +@import '~styles/themes'; .users-body { padding-left: 1.563rem; @@ -69,7 +71,7 @@ padding: 10px 15px; &:hover { - background-color: $brand-faded; + background-color: var(--brand-faded); } } diff --git a/src/app/mail/mail-sidebar/mail-sidebar.component.scss b/src/app/mail/mail-sidebar/mail-sidebar.component.scss index 03848e85b..604b01b79 100644 --- a/src/app/mail/mail-sidebar/mail-sidebar.component.scss +++ b/src/app/mail/mail-sidebar/mail-sidebar.component.scss @@ -92,6 +92,7 @@ } .mailbox-sidebar { + border-right: var(--width-0-2) solid var(--sidebar-border-right); @include media('>sm', ' { this.forceLightMode = parameters.lightMode; if (this.forceLightMode) { - this.handleDarkMode(false); + // this.handleDarkMode(false); + this.themeToggleService.forceUpdateTheme(false); } }); } diff --git a/src/app/mail/mail.component.scss b/src/app/mail/mail.component.scss index bb82cd752..d928743a3 100644 --- a/src/app/mail/mail.component.scss +++ b/src/app/mail/mail.component.scss @@ -2,6 +2,8 @@ @import '../../styles/vendors/include-media/include-media'; @import '../../styles/config/include-media-config'; @import '../../styles/vendors/ceaser/ceaser-easing'; +@import '../../styles/theme-variables-collection'; +@import '../../styles/themes'; // == Mailbox content .app-outer-mailbox { @@ -47,7 +49,7 @@ top: 0; bottom: 0; left: 0; - background-color: #34495e; + background-color: var(--brand-secondary); width: 220px; @include media('(ThemeMode.LIGHT); + + constructor( + private store: Store + ) { + /** + * Get user settings + */ + this.store + .select(state => state.user) + .pipe(untilDestroyed(this)) + .subscribe((user: UserState) => { + const isDarkMode = user.settings.is_night_mode; + if (this.isDarkMode !== isDarkMode) { + this.isDarkMode = isDarkMode; + this.updateTheme(this.isDarkMode); + } + }); + } + + private updateTheme(isDarkMode) { + if (isDarkMode) { + document.body.classList.add(this.DARK_THEME_CLASS_NAME); + document.body.classList.remove(this.LIGHT_THEME_CLASS_NAME); + this.theme$.next(ThemeMode.DARK); + } else { + document.body.classList.add(this.LIGHT_THEME_CLASS_NAME); + document.body.classList.remove(this.DARK_THEME_CLASS_NAME); + this.theme$.next(ThemeMode.LIGHT); + } + } + + public forceUpdateTheme(isDarkMode) { + this.updateTheme(isDarkMode); + } + + ngOnDestroy(): void {} +} diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index de09861b3..9a7be4635 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -34,6 +34,7 @@ import { CreditCardNumberPipe } from './pipes/creditcard-number.pipe'; import { EmailFormatPipe } from './pipes/email-formatting.pipe'; import { LineBreakToBrTag } from './pipes/replace-linebreak-brtag.pipe'; import { CircleBarSpinnerComponent } from './circle-bar-spinner/circle-bar-spinner.component'; +import { ThemeToggleService } from './services/theme-toggle-service'; @NgModule({ imports: [CommonModule, FormsModule, ReactiveFormsModule, TranslateModule, TagInputModule, MatIconModule, NgbModule], @@ -99,7 +100,8 @@ import { CircleBarSpinnerComponent } from './circle-bar-spinner/circle-bar-spinn FilenamePipe, CreditCardNumberPipe, LineBreakToBrTag, - EmailFormatPipe + EmailFormatPipe, + ThemeToggleService ], entryComponents: [CreateFolderComponent, PaymentFailureNoticeComponent], }) diff --git a/src/app/users/decrypt/decrypt-message.component.scss b/src/app/users/decrypt/decrypt-message.component.scss index 78a6a4d97..69433043f 100644 --- a/src/app/users/decrypt/decrypt-message.component.scss +++ b/src/app/users/decrypt/decrypt-message.component.scss @@ -44,7 +44,7 @@ .form-control { &:focus, &:focus + .input-group-addon { - border-color: $dropdown-border-color !important; + border-color: var(--dropdown-border-color) !important; } } diff --git a/src/app/users/display-secure-message/display-secure-message.component.scss b/src/app/users/display-secure-message/display-secure-message.component.scss index 903706fce..c6de52b06 100644 --- a/src/app/users/display-secure-message/display-secure-message.component.scss +++ b/src/app/users/display-secure-message/display-secure-message.component.scss @@ -164,7 +164,7 @@ } .actions-btn.actions-btn-inline { - color: $brand-light-gray; + color: var(--brand-light-gray); font-size: 0.625rem; min-width: 4.125rem; width: inherit; diff --git a/src/app/users/reply-secure-message/reply-secure-message.component.scss b/src/app/users/reply-secure-message/reply-secure-message.component.scss index 903706fce..c6de52b06 100644 --- a/src/app/users/reply-secure-message/reply-secure-message.component.scss +++ b/src/app/users/reply-secure-message/reply-secure-message.component.scss @@ -164,7 +164,7 @@ } .actions-btn.actions-btn-inline { - color: $brand-light-gray; + color: var(--brand-light-gray); font-size: 0.625rem; min-width: 4.125rem; width: inherit; diff --git a/src/app/users/users-sign-in/users-sign-in.component.scss b/src/app/users/users-sign-in/users-sign-in.component.scss index a7c17c39d..64c6846b8 100644 --- a/src/app/users/users-sign-in/users-sign-in.component.scss +++ b/src/app/users/users-sign-in/users-sign-in.component.scss @@ -43,7 +43,7 @@ $error-red: #e94e4c; .form-control { &:focus, &:focus + .input-group-addon { - border-color: $dropdown-border-color !important; + border-color: var(--dropdown-border-color) !important; } &[type='text'] { + span .fa-eye { diff --git a/src/index.html b/src/index.html index e4ac4dbd7..bb97ed93a 100644 --- a/src/index.html +++ b/src/index.html @@ -22,7 +22,7 @@ - +