-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(NcAppContent): add mobileLayout
prop
#6364
base: master
Are you sure you want to change the base?
feat(NcAppContent): add mobileLayout
prop
#6364
Conversation
Signed-off-by: Devlin Junker <[email protected]>
Signed-off-by: Devlin Junker <[email protected]>
7635b2e
to
9b6f558
Compare
mobileLayout
prop to NcAppContentmobileLayout
prop to NcAppContent
Any thoughts or feedback here? @ShGKme @raimund-schluessler |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6364 +/- ##
==========================================
+ Coverage 42.26% 42.50% +0.23%
==========================================
Files 155 156 +1
Lines 3996 4028 +32
Branches 1001 1038 +37
==========================================
+ Hits 1689 1712 +23
- Misses 2199 2200 +1
- Partials 108 116 +8 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, can be useful.
Please, fix linting issues like trailing spaces and commas.
@media only screen and (width < $breakpoint-mobile) { | ||
display: none; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ESLint error
} | |
} |
@media only screen and (width < $breakpoint-mobile) { | ||
display: none; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default: 'no-split', | ||
validator(value) { | ||
return ['no-split', 'horizontal-split'].includes(value) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
}, |
validator(value) { | ||
return ['no-split', 'horizontal-split'].includes(value) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
}, |
&.splitpanes--horizontal-mobile { | ||
.splitpanes__pane-details{ | ||
@media only screen and (width < $breakpoint-mobile) { | ||
min-height:30%; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
min-height:30%; | |
min-height: 30%; |
} | ||
|
||
&.splitpanes--horizontal-mobile { | ||
.splitpanes__pane-details{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.splitpanes__pane-details{ | |
.splitpanes__pane-details { |
@@ -60,22 +60,23 @@ The list size must be between the min and the max width value. | |||
|
|||
<template v-if="hasList"> | |||
<!-- Mobile view does not allow resizeable panes --> | |||
<div v-if="isMobile || layout === 'no-split'" | |||
<div v-if="(isMobile && mobileLayout === 'no-split') || layout === 'no-split' " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conditions are quire complicated now.
What about making a new computed property, for instance, currentLayout
, that returns corresponding layout depending on isMobile
.
Then we can always just check one property value without complex expressions.
@@ -175,7 +176,7 @@ export default { | |||
}, | |||
|
|||
/** | |||
* When in mobile view, only the list or the details are shown | |||
* When in 'no-split' mobile view, only the list or the details are shown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this line then. It's now covered by the new prop
@@ -400,6 +412,22 @@ export default { | |||
scrollbar-width: auto; | |||
} | |||
|
|||
&:not(.splitpanes--horizontal-mobile) { | |||
.splitpanes__pane-list{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.splitpanes__pane-list{ | |
.splitpanes__pane-list { |
&:not(.splitpanes--horizontal-mobile) { | ||
.splitpanes__pane-list{ | ||
@media only screen and (width < $breakpoint-mobile) { | ||
display: none; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's control it in JS instead as it was.
mobileLayout
prop to NcAppContentmobileLayout
prop
Thanks for taking a look! Will do! |
☑️ Resolves
horizontal-split
layout for mobile devices. This can be useful if you want to still see the list and details at the same timeno-split
still so no change for callers that don't pass in themobileLayout
property🖼️ Screenshots
🚧 Tasks
mobileLayout
propertyhorizontal-split
option formobileLayout
property🏁 Checklist
- [ ] 3️⃣ Backport tonext
requested with a Vue 3 upgrade