Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions assets/icons/back-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/kids/back-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/src/js/v3/shared/icons/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const icons = [
'audio',
'avi',
'back',
'back2',
'badge',
'badgeCheck',
'badgeInfo',
Expand Down
6 changes: 6 additions & 0 deletions assets/src/scss/frontend/dashboard/layout/_nav-mobile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@
margin: 0;
padding: 0;

&.tutor-dashboard-nav-mobile-more-back {
border-top: 1px solid $tutor-border-idle;
margin-top: $tutor-spacing-1;
padding-top: $tutor-spacing-1;
}

a {
@include tutor-typography(tiny, regular);
@include tutor-flex(row, center);
Expand Down
1 change: 1 addition & 0 deletions classes/Icon.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ final class Icon {
const AUDIO = 'audio';
const AVI = 'avi';
const BACK = 'back';
const BACK_2 = 'back-2';
const BADGE = 'badge';
const BADGE_CHECK = 'badge-check';
const BADGE_INFO = 'badge-info';
Expand Down
28 changes: 23 additions & 5 deletions templates/dashboard/components/sidebar-nav-mobile.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
use Tutor\Components\SvgIcon;
use TUTOR\Dashboard;

$dashboard_pages = $dashboard_pages ?? array();
$dashboard_page_slug = $dashboard_page_slug ?? '';

if ( ! tutor_utils()->count( $dashboard_pages ) ) {
return;
}
Expand Down Expand Up @@ -44,8 +47,10 @@
$key = '';
}

$menu_title = $item;
$menu_link = tutor_utils()->get_tutor_dashboard_page_permalink( $key );
$menu_title = $item;
$menu_link = tutor_utils()->get_tutor_dashboard_page_permalink( $key );
$menu_icon_name = '';
$active_icon_name = '';

if ( is_array( $item ) ) {
$menu_title = tutor_utils()->array_get( 'title', $item );
Expand Down Expand Up @@ -121,8 +126,10 @@ class="tutor-popover tutor-dashboard-nav-mobile-more-popover"
<ul>
<?php
foreach ( $more_nav_items as $key => $item ) {
$menu_title = $item;
$menu_link = tutor_utils()->get_tutor_dashboard_page_permalink( $key );
$menu_title = $item;
$menu_link = tutor_utils()->get_tutor_dashboard_page_permalink( $key );
$menu_icon_name = '';
$active_icon_name = '';

if ( is_array( $item ) ) {
$menu_title = tutor_utils()->array_get( 'title', $item );
Expand All @@ -144,7 +151,7 @@ class="tutor-popover tutor-dashboard-nav-mobile-more-popover"
<?php
SvgIcon::make()
->name( ( $is_active_menu && ! tutor_utils()->is_kids_mode() ) ? $active_icon_name : $menu_icon_name )
->size( tutor_utils()->is_kids_mode() ? Size::SIZE_24 : Size::SIZE_20 )
->size( tutor_utils()->is_kids_mode() ? Size::SIZE_20 : Size::SIZE_16 )
->render();
?>
<span class="tutor-tiny"><?php echo esc_html( $menu_title ); ?></span>
Expand All @@ -153,6 +160,17 @@ class="tutor-popover tutor-dashboard-nav-mobile-more-popover"
<?php
}
?>
<li class="tutor-dashboard-nav-mobile-more-back" role="none">
<a role="menuitem" href="<?php echo esc_url( home_url( '/' ) ); ?>" @click="open = false">
<?php
SvgIcon::make()
->name( Icon::BACK_2 )
->size( tutor_utils()->is_kids_mode() ? Size::SIZE_20 : Size::SIZE_16 )
->render();
?>
<span class="tutor-tiny"><?php esc_html_e( 'Back to Site', 'tutor' ); ?></span>
</a>
</li>
</nav>
</div>
</li>
Expand Down
Loading