Commit 373db714 authored by Shane Eckenrode's avatar Shane Eckenrode

refactor(responsive): Restructure logic

parent fa71fa98
Pipeline #85045 passed with stages
in 3 minutes and 55 seconds
......@@ -28,32 +28,10 @@ export class ResponsiveDirective implements OnInit, OnDestroy {
takeUntil(this.destroyed$)
)
.subscribe((size: ScreenSize) => {
switch (size) {
case ScreenSize.DESKTOP:
this.isDesktop = true;
this.isTablet = false;
this.isSmallTablet = false;
this.isMobile = false;
break;
case ScreenSize.TABLET:
this.isDesktop = false;
this.isTablet = true;
this.isSmallTablet = false;
this.isMobile = false;
break;
case ScreenSize.TABLET_SM:
this.isDesktop = false;
this.isTablet = false;
this.isSmallTablet = true;
this.isMobile = false;
break;
case ScreenSize.MOBILE:
this.isDesktop = false;
this.isTablet = false;
this.isSmallTablet = false;
this.isMobile = true;
break;
}
this.isMobile = size === ScreenSize.MOBILE;
this.isSmallTablet = size === ScreenSize.TABLET_SM;
this.isTablet = size === ScreenSize.TABLET;
this.isDesktop = size === ScreenSize.DESKTOP;
});
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment