<?php
/**
 * Displays top navigation
 *
 * @package Nonprofit Foundation
 */
?>

<div class="container">
    <div class="row">
        <div class="offset-lg-2 col-lg-7 col-md-7 col-6 align-self-center">
            <div class="toggle-nav mobile-menu">
                <button onclick="charity_zone_openNav()"><i class="fas fa-th"></i></button>
            </div>
            <div id="mySidenav" class="nav sidenav">
                <nav id="site-navigation" class="main-navigation navbar navbar-expand-xl" aria-label="<?php esc_attr_e( 'Top Menu', 'nonprofit-foundation' ); ?>">
                    <?php {
                        wp_nav_menu(
                            array(
                                'theme_location' => 'primary',
                                'menu_class'     => 'menu', 
                                'items_wrap'     => '<ul id="%1$s" class="%2$s">%3$s</ul>',
                                'fallback_cb' => 'wp_page_menu',
                            )
                        );
                    } ?>
                </nav>
                <a href="javascript:void(0)" class="closebtn mobile-menu" onclick="charity_zone_closeNav()"><i class="fas fa-times"></i></a>
            </div>
        </div>
        <div class="col-lg-1 col-md-1 col-sm-1 col-6 align-self-center">
            <?php if(class_exists('woocommerce')){ ?>
                <?php if ( is_user_logged_in() ) { ?>
                    <a class="account-btn" href="<?php echo esc_url( get_permalink( get_option('woocommerce_myaccount_page_id') ) ); ?>" title="<?php esc_attr_e('My Account','nonprofit-foundation'); ?>"><i class="fas fa-user"></i></a>
                <?php } 
                else { ?>
                    <a class="account-btn" href="<?php echo esc_url( get_permalink( get_option('woocommerce_myaccount_page_id') ) ); ?>" title="<?php esc_attr_e('Login / Register','nonprofit-foundation'); ?>"><i class="fas fa-user"></i></a>
                <?php } ?>
            <?php }?>
        
        </div>
        <div class="col-lg-2 col-md-4 col-8 donate-btn align-self-center">
            <?php if(get_theme_mod('charity_zone_donate_button') != ''){ ?>
                <a href="<?php echo esc_url(get_theme_mod('charity_zone_donate_button','')); ?>"><?php esc_html_e('Donate Now','nonprofit-foundation'); ?></a>
            <?php }?>
        </div>
    </div>
</div>
