diff --git a/assets/styles/global/modifiers/_theming.scss b/assets/styles/global/modifiers/_theming.scss index 81067b49..d15b1b29 100644 --- a/assets/styles/global/modifiers/_theming.scss +++ b/assets/styles/global/modifiers/_theming.scss @@ -188,6 +188,10 @@ border-top: 1px solid var(--primary-invert-color-80) !important; } +.ok-has-border-accent { + border: 1px solid var(--accent-color) !important; +} + .ok-has-border-bottom-accent { border-bottom: 1px solid var(--accent-color) !important; } diff --git a/components/menus/OkUserMenu.vue b/components/menus/OkUserMenu.vue index caff6dbf..5789a407 100644 --- a/components/menus/OkUserMenu.vue +++ b/components/menus/OkUserMenu.vue @@ -109,7 +109,11 @@
  • - + @@ -117,7 +121,7 @@ {{$t('components.user_dropdown.themes')}} - +
  • @@ -170,6 +174,7 @@ import { OkAvatarSize } from "~/components/avatars/lib/OkAvatarSize"; import { OkAvatarBorderRadius } from '~/components/avatars/lib/OkAvatarBorderRadius'; import { BehaviorSubject } from '~/node_modules/rxjs'; + import { IModalService } from "../../services/modal/IModalService"; @Component({ name: "OkUserMenu", @@ -191,6 +196,7 @@ }; private userService: IUserService = okunaContainer.get(TYPES.UserService); + private modalService: IModalService = okunaContainer.get(TYPES.ModalService); tooltipOptions = { placement: 'bottom-end' @@ -199,5 +205,12 @@ get profileUrl(){ return `/${this.$observables.loggedInUser.value.username}`; } + + async onThemesClick() { + this.$emit('leaveMenu'); + await this.modalService.openThemesModal({ + title: this.$t('components.user_dropdown.themes').toString() + }); + } } - \ No newline at end of file + diff --git a/pages/home/components/header/components/user-menu-dropdown/OkUserMenuDropdown.vue b/pages/home/components/header/components/user-menu-dropdown/OkUserMenuDropdown.vue index 9bfbf179..55cc6c7f 100644 --- a/pages/home/components/header/components/user-menu-dropdown/OkUserMenuDropdown.vue +++ b/pages/home/components/header/components/user-menu-dropdown/OkUserMenuDropdown.vue @@ -21,7 +21,7 @@
    - +
    @@ -72,5 +72,9 @@ // Close tooltip this.dropdownIsOpen = false; } + + handleLeaveMenu() { + this.dropdownIsOpen = false; + } } diff --git a/pages/home/components/modals/OkModals.vue b/pages/home/components/modals/OkModals.vue index 5987e7e9..d7e6d7b3 100644 --- a/pages/home/components/modals/OkModals.vue +++ b/pages/home/components/modals/OkModals.vue @@ -49,6 +49,9 @@ + + + @@ -82,6 +85,7 @@ import OkConnectionsCirclesPickerModal from '~/pages/home/components/modals/components/OkConnectionsCirclesPickerModal.vue'; import OkPostCommentActionsModal from '~/pages/home/components/modals/components/OkPostCommentActionsModal.vue'; + import OkThemesModal from '~/pages/home/components/modals/components/OkThemesModal.vue'; @Component({ name: "OkModals", @@ -91,7 +95,8 @@ OkUserActionsModal, OkReportObjectModal, OkPostActionsModal, - OkCommunitiesListModal, OkPostCommentReactionsModal, OkPostReactionsModal, OkPostModal + OkCommunitiesListModal, OkPostCommentReactionsModal, OkPostReactionsModal, OkPostModal, + OkThemesModal }, subscriptions: function () { return { @@ -116,6 +121,7 @@ communitiesListModalOpen: boolean = false; reportObjectModalOpen: boolean = false; connectionsCirclesPickerOpen: boolean = false; + themesModalOpen: boolean = false; private modalService: IModalService = okunaContainer.get(TYPES.ModalService); @@ -148,6 +154,7 @@ this.postCommentActionsModalOpened = activeModalValue === ModalType.postCommentActions; this.reportObjectModalOpen = activeModalValue === ModalType.reportObject; this.connectionsCirclesPickerOpen = activeModalValue === ModalType.connectionsCirclesPicker; + this.themesModalOpen = activeModalValue === ModalType.themes; } } - \ No newline at end of file + diff --git a/pages/home/components/modals/components/OkThemesModal.vue b/pages/home/components/modals/components/OkThemesModal.vue new file mode 100644 index 00000000..d380416d --- /dev/null +++ b/pages/home/components/modals/components/OkThemesModal.vue @@ -0,0 +1,112 @@ + + + + + diff --git a/services/modal/IModalService.ts b/services/modal/IModalService.ts index 48801cc0..0af4e5cd 100644 --- a/services/modal/IModalService.ts +++ b/services/modal/IModalService.ts @@ -36,6 +36,8 @@ export interface IModalService { openConnectionsCirclesPickerModal(params: ConnectionsCirclesPickerModalParams): Promise; + openThemesModal(params: ThemeModalParams): Promise; + // Methods for OkModals component activeModal: BehaviorSubject @@ -57,7 +59,8 @@ export type ModalParams = | CommunityActionsModalParams | PostCommentActionsModalParams | HashtagActionsModalParams - | ConnectionsCirclesPickerModalParams; + | ConnectionsCirclesPickerModalParams + | ThemeModalParams; export interface HttpListModalParams { refresher: OkHttpListRefresher; @@ -127,3 +130,7 @@ export interface ReportObjectModalParams { extraData?: {[key: string]: any}; onObjectReported: (object: any) => void; } + +export interface ThemeModalParams { + title: string; +} diff --git a/services/modal/ModalService.ts b/services/modal/ModalService.ts index 2736d64f..8d9dfe6b 100644 --- a/services/modal/ModalService.ts +++ b/services/modal/ModalService.ts @@ -5,7 +5,7 @@ import { IModalService, ModalParams, PostActionsModalParams, PostCommentActionsModalParams, PostCommentReactionsModalParams, PostModalParams, - PostReactionsModalParams, ReportObjectModalParams, UserActionsModalParams + PostReactionsModalParams, ReportObjectModalParams, UserActionsModalParams, ThemeModalParams } from '~/services/modal/IModalService'; // From outside Vue instance import { BehaviorSubject } from '~/node_modules/rxjs'; @@ -104,6 +104,11 @@ export class ModalService implements IModalService { this.historyService.setPathSilently(originalPath); } + async openThemesModal(params: ThemeModalParams): Promise { + this.ensureHasNoActiveModal(); + return this.openModal(ModalType.themes, params); + } + notifyModalClosed(): void { this.ensureHasActiveModal(); @@ -163,4 +168,4 @@ export class ModalService implements IModalService { } -} \ No newline at end of file +} diff --git a/services/modal/lib/ModalType.ts b/services/modal/lib/ModalType.ts index c83e4a11..418890b2 100644 --- a/services/modal/lib/ModalType.ts +++ b/services/modal/lib/ModalType.ts @@ -10,6 +10,7 @@ export class ModalType { static hashtagActions = new ModalType('HashtagActions'); static postCommentActions = new ModalType('PostCommentActions'); static connectionsCirclesPicker = new ModalType('ConnectionsCirclesPicker'); + static themes = new ModalType('Themes'); static _values: ModalType[] = [ @@ -22,6 +23,7 @@ export class ModalType { ModalType.communityActions, ModalType.postCommentActions, ModalType.connectionsCirclesPicker, + ModalType.themes, ]; static values() {