diff --git a/app/components/home-page/organization-dashboard/header/index.hbs b/app/components/home-page/organization-dashboard/header/index.hbs index 2308384c19..d1fcd36f6f 100644 --- a/app/components/home-page/organization-dashboard/header/index.hbs +++ b/app/components/home-page/organization-dashboard/header/index.hbs @@ -2,8 +2,8 @@ diff --git a/app/components/home-page/organization-dashboard/header/index.scss b/app/components/home-page/organization-dashboard/header/index.scss index 52501f76bf..9a813b7a44 100644 --- a/app/components/home-page/organization-dashboard/header/index.scss +++ b/app/components/home-page/organization-dashboard/header/index.scss @@ -1,9 +1,8 @@ .navbar-root { - width: calc(100% - 250px); - margin-left: 250px; padding: 0.65em 1em; background-color: var(--organization-dashboard-header-background-color); color: var(--organization-dashboard-header-text-color); + max-height: 4em; .navbar-btn { color: var(--organization-dashboard-header-text-color); diff --git a/app/components/home-page/organization-dashboard/header/index.ts b/app/components/home-page/organization-dashboard/header/index.ts index 08d7fe42b4..5e7b886dde 100644 --- a/app/components/home-page/organization-dashboard/header/index.ts +++ b/app/components/home-page/organization-dashboard/header/index.ts @@ -14,6 +14,7 @@ export interface HomePageOrganizationDashboardHeaderSignature { logoutAction: () => void; user: UserModel; }; + Element: HTMLElement; } export default class HomePageOrganizationDashboardHeaderComponent extends Component { diff --git a/app/components/home-page/organization-dashboard/index.hbs b/app/components/home-page/organization-dashboard/index.hbs index 6ddd462d57..1173ca1adb 100644 --- a/app/components/home-page/organization-dashboard/index.hbs +++ b/app/components/home-page/organization-dashboard/index.hbs @@ -1,11 +1,21 @@ -
+
diff --git a/app/components/home-page/organization-dashboard/index.scss b/app/components/home-page/organization-dashboard/index.scss index 09f0635d38..7ac87b6270 100644 --- a/app/components/home-page/organization-dashboard/index.scss +++ b/app/components/home-page/organization-dashboard/index.scss @@ -1,17 +1,37 @@ .organization-dashboard-root { width: 100%; + display: grid; + grid-template-areas: + "sidenav topnav" + "sidenav main"; + height: 100vh; + grid-template-rows: 4em auto; + + &.expanded, &.collapsed { + transition: grid-template-columns 0.2s ease-in-out; + } + + &.collapsed { + grid-template-columns: 56px auto; + } + + &.expanded { + grid-template-columns: 250px auto; + } .dashboard-main { - width: calc(100% - 250px); - min-height: 100vh; - margin-left: 250px; + grid-area: main; + max-height: 100vh; padding: 0.5em; box-sizing: border-box; + overflow-y: auto; + } + + .dashboard-header { + grid-area: topnav; + } - &::before { - content: ''; - display: block; - height: 56px; - } + .dashboard-sidenav { + grid-area: sidenav; } } diff --git a/app/components/home-page/organization-dashboard/index.ts b/app/components/home-page/organization-dashboard/index.ts index c593d1afda..b499e0d3c9 100644 --- a/app/components/home-page/organization-dashboard/index.ts +++ b/app/components/home-page/organization-dashboard/index.ts @@ -1,6 +1,10 @@ +import { action } from '@ember/object'; +import { inject as service } from '@ember/service'; import Component from '@glimmer/component'; +import { tracked } from '@glimmer/tracking'; import UserModel from 'irene/models/user'; +import { removeCrispListeners, scaleCrispChatbox } from 'irene/utils/chat'; export interface HomePageOrganizationDashboardSignature { Args: { @@ -14,7 +18,31 @@ export interface HomePageOrganizationDashboardSignature { }; } -export default class HomePageOrganizationDashboardComponent extends Component {} +export default class HomePageOrganizationDashboardComponent extends Component { + @tracked isSidebarCollapsed = false; + @service('browser/window') declare window: Window; + + constructor( + owner: unknown, + args: HomePageOrganizationDashboardSignature['Args'] + ) { + super(owner, args); + + if (this.window.$crisp) { + this.window.$crisp.on('session:loaded', scaleCrispChatbox); + } + } + + willDestroy() { + super.willDestroy(); + removeCrispListeners(); + } + + @action + toggleSidebar() { + this.isSidebarCollapsed = !this.isSidebarCollapsed; + } +} declare module '@glint/environment-ember-loose/registry' { export default interface Registry { diff --git a/app/components/home-page/organization-dashboard/side-nav/index.hbs b/app/components/home-page/organization-dashboard/side-nav/index.hbs index 52dffe305c..90aac9fafa 100644 --- a/app/components/home-page/organization-dashboard/side-nav/index.hbs +++ b/app/components/home-page/organization-dashboard/side-nav/index.hbs @@ -1,85 +1,135 @@ -