Skip to content
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

LessonResourceSelection: Add margin to bottom controls when isAppContext & touch device #13215

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@
v-if="$route.name !== PageNames.LESSON_SELECT_RESOURCES_SEARCH"
#bottomNavigation
>
<div class="bottom-nav-container">
<div
class="bottom-nav-container"
:style="{
marginBottom: isAppContextAndTouchDevice ? '56px' : '0px',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defenitely non blocking, and speaking from ignorance, could this condition to render the botton menu change, for any reason, in the future? If so, I think remember to update also this specific component in this specific context will be a little hard. Just wondering if should we have something like a showAppNavView variable inside the useUser perhaps? To control the exact conditions to render the app nav, and replace them in the AppBarPage too, and ensuring that if they change in the future, all places that depends on it will be updated accordingly.

If this condition is something we dont foresee can change, and this is over-engineering 😅, i think its okay then.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having it available in useUser would be nice to have - I think it'd be useful in a few others places too. I think it might be a good follow-up tech-debt issue to consolidate the conditionals that ask "is app context && is touch device" into useUser, then update wherever we're using it to get that info from useUser.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good! <3

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd probably prefer it to be somewhere other than useUser (even if it depends on useUser) as it's not about the user per se - and yes, we had a similar concern when this was first implemented, so doing something to consolidate it would be helpful.

}"
>
<KButtonGroup>
<KRouterLink
v-if="
Expand Down Expand Up @@ -103,6 +108,8 @@
import { coreStrings } from 'kolibri/uiText/commonCoreStrings';
import bytesForHumans from 'kolibri/uiText/bytesForHumans';
import useSnackbar from 'kolibri/composables/useSnackbar';
import { isTouchDevice } from 'kolibri/utils/browserInfo';
import useUser from 'kolibri/composables/useUser';
import { PageNames } from '../../../../../constants';
import { coachStrings } from '../../../../common/commonCoachStrings';
import { SelectionTarget } from '../../../../common/resourceSelection/contants';
Expand Down Expand Up @@ -170,8 +177,13 @@
deselectResources($evt);
sendPoliteMessage(numberOfSelectedResources$({ count: selectedResources?.value.length }));
}
const { isAppContext } = useUser();
const isAppContextAndTouchDevice = computed(() => {
return isAppContext.value && isTouchDevice;
});

return {
isAppContextAndTouchDevice,
defaultTitle,
subpageLoading,
selectedResources,
Expand Down
Loading