List Buddypress Groups Of Current Logged In User

    /* Is the user in any teams */
    $user_id =get_current_user_id();
    $args = array(
    'user_id' => $user_id
    if ( bp_has_groups( $args) ) :


    <?php while ( bp_groups() ) : bp_the_group(); ?>

        <div class="t-m-list">
          <a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( 'type=full' ); ?>
          <h5><?php bp_group_name(); ?></h5>

    <?php endwhile; ?>


  <?php else: /* If the user is not in any teams */?>

      <p>No teams</p>

  <?php endif; ?>

Returns a list of the groups the current logged in user is a member of