| 1 |
<?php |
| 2 |
if (!defined('ABSPATH')) { |
| 3 |
exit; // Exit if accessed directly. |
| 4 |
} |
| 5 |
/** |
| 6 |
* @var $menuItems |
| 7 |
* @var $profileData |
| 8 |
*/ |
| 9 |
?> |
| 10 |
|
| 11 |
<div id="fct-customer-dashboard-navs-wrap" class="fct-customer-dashboard-navs-wrap" role="navigation" aria-label="<?php esc_attr_e('Customer Dashboard', 'fluent-cart'); ?>"> |
| 12 |
<div class="fct-nav-compact-toggle-wrap"> |
| 13 |
<button |
| 14 |
type="button" |
| 15 |
aria-label="<?php esc_attr_e('Toggle navigation menu', 'fluent-cart'); ?>" |
| 16 |
id="fct-customer-nav-compact-toggle" |
| 17 |
> |
| 18 |
<svg class="fct-compact-toggle-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none"> |
| 19 |
<path d="M12.1329 5.08936L13.115 6.07145L9.88108 9.30539L16.2505 9.30546L16.2504 10.6943L9.88108 10.6943L13.115 13.9282L12.133 14.9103L7.22246 9.99983L12.1329 5.08936ZM4.44482 14.8609V5.13867H5.83371V14.8609H4.44482Z" fill="#565865"/> |
| 20 |
</svg> |
| 21 |
</button> |
| 22 |
</div> |
| 23 |
|
| 24 |
<?php if($profileData): ?> |
| 25 |
<div class="fct-customer-dashboard-customer-info" role="banner"> |
| 26 |
<img src="<?php echo esc_url($profileData['photo']); ?>" alt="<?php echo esc_attr($profileData['full_name']); ?>" /> |
| 27 |
<div class="fct-customer-dashboard-customer-info-content"> |
| 28 |
<h3><?php echo esc_attr($profileData['full_name']); ?></h3> |
| 29 |
<p><?php echo esc_attr($profileData['email']); ?></p> |
| 30 |
</div> |
| 31 |
</div> |
| 32 |
<?php endif; ?> |
| 33 |
|
| 34 |
<div id="fct-customer-menu-container"> |
| 35 |
<button |
| 36 |
id="fct-customer-menu-toggle" |
| 37 |
type="button" |
| 38 |
aria-expanded="false" |
| 39 |
aria-controls="fct-customer-menu-holder" |
| 40 |
aria-label="<?php esc_attr_e('Toggle navigation menu', 'fluent-cart'); ?>" |
| 41 |
> |
| 42 |
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 4H21V6H3V4ZM3 11H21V13H3V11ZM3 18H21V20H3V18Z"></path></svg> |
| 43 |
</button> |
| 44 |
|
| 45 |
<div id="fct-customer-menu-holder" aria-hidden="false"> |
| 46 |
<div class="fct-customer-navs-wrap"> |
| 47 |
<ul class="fct-customer-navs" role="list"> |
| 48 |
<?php foreach ($menuItems as $itemSlug => $menuItem): ?> |
| 49 |
<li class="fct-customer-nav-item fct-customer-nav-item-<?php echo esc_attr($itemSlug); ?>" role="listitem"> |
| 50 |
<a |
| 51 |
class="fct-customer-nav-link <?php echo esc_attr(\FluentCart\Framework\Support\Arr::get($menuItem, 'css_class')); ?>" |
| 52 |
aria-label="<?php echo esc_attr($menuItem['label']) ?>" |
| 53 |
href="<?php echo esc_url($menuItem['link']); ?>" |
| 54 |
> |
| 55 |
<span class="fct-customer-nav-link-icon"> |
| 56 |
<?php |
| 57 |
if (!empty($menuItem['icon_svg'])) { |
| 58 |
echo wp_kses( |
| 59 |
$menuItem['icon_svg'], |
| 60 |
apply_filters('fct_allowed_svg_tags', []) |
| 61 |
); |
| 62 |
} elseif (!empty($menuItem['icon_url'])) { |
| 63 |
echo '<img src="' . esc_url($menuItem['icon_url']) . '" alt="" />'; |
| 64 |
} |
| 65 |
?> |
| 66 |
</span> |
| 67 |
|
| 68 |
<span class="fct-customer-nav-link-text"> |
| 69 |
<?php echo esc_html($menuItem['label']); ?> |
| 70 |
</span> |
| 71 |
</a> |
| 72 |
|
| 73 |
<span class="fct-customer-nav-tooltip"> |
| 74 |
<?php echo esc_html($menuItem['label']); ?> |
| 75 |
</span> |
| 76 |
</li> |
| 77 |
<?php endforeach; ?> |
| 78 |
</ul> |
| 79 |
</div> |
| 80 |
|
| 81 |
<!-- Logout Button --> |
| 82 |
<div id="fct-customer-logout-button"> |
| 83 |
<a href="<?php echo esc_url(wp_logout_url(home_url())); ?>" title="<?php echo esc_attr__('Logout', 'fluent-cart'); ?>" class="fct-customer-logout-btn" aria-label="<?php esc_attr_e('Logout', 'fluent-cart'); ?>"> |
| 84 |
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 22C4.44772 22 4 21.5523 4 21V3C4 2.44772 4.44772 2 5 2H19C19.5523 2 20 2.44772 20 3V6H18V4H6V20H18V18H20V21C20 21.5523 19.5523 22 19 22H5ZM18 16V13H11V11H18V8L23 12L18 16Z"></path></svg> |
| 85 |
|
| 86 |
<span class="button-text"><?php esc_html_e('Logout', 'fluent-cart'); ?></span> |
| 87 |
</a> |
| 88 |
</div> |
| 89 |
</div> |
| 90 |
</div> |
| 91 |
</div> |
| 92 |
|
| 93 |
|