Skip to content

Commit d7a5159

Browse files
committed
Cover photo added to users profile
1 parent 08619ea commit d7a5159

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

assets/src/scss/frontend/dashboard/_profile.scss

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,19 @@
1111
.tutor-profile-card-header {
1212
@include tutor-flex(row, center, center);
1313
background-color: $tutor-surface-brand-tertiary;
14+
background-size: cover;
15+
background-position: center center;
16+
background-repeat: no-repeat;
1417
border-radius: $tutor-radius-lg;
15-
margin-bottom: $tutor-spacing-7;
18+
margin-bottom: $tutor-spacing-14;
1619
position: relative;
1720
height: 184px;
1821

22+
.tutor-avatar {
23+
border: 4px solid $tutor-border-inverse;
24+
transform: translateY(92px);
25+
}
26+
1927
.tutor-edit-profile-btn {
2028
@include tutor-button-base();
2129
@include tutor-button-variant(outline);
@@ -44,8 +52,7 @@
4452
}
4553

4654
.tutor-profile-card-body {
47-
@include tutor-grid(2);
48-
gap: $tutor-spacing-6;
55+
@include tutor-grid(2, $tutor-spacing-21);
4956
position: relative;
5057

5158
@include tutor-breakpoint-down(sm) {
@@ -117,11 +124,6 @@
117124

118125
&-right {
119126
@include tutor-flex(column, flex-start, space-between);
120-
121-
@include tutor-breakpoint-up(sm) {
122-
max-width: 240px;
123-
margin-left: auto;
124-
}
125127
}
126128

127129
.tutor-profile-member-since {

templates/user-profile.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
$user_id = Input::get( 'student_id', get_current_user_id(), Input::TYPE_INT );
2121
$student_details = get_userdata( $user_id );
2222
$student_meta = get_user_meta( $user_id );
23+
$cover_photo_url = tutor_utils()->get_cover_photo_url( $user_id );
2324
$edit_profile_url = Dashboard::get_account_page_url( 'settings' ) . '?tab=account';
2425
$website_url = $student_meta['_tutor_profile_website'][0] ?? '#';
2526
$github_url = $student_meta['_tutor_profile_github'][0] ?? '#';
@@ -30,7 +31,7 @@
3031
?>
3132

3233
<div class="tutor-profile-card">
33-
<div class="tutor-profile-card-header">
34+
<div class="tutor-profile-card-header" style="background-image: url(<?php echo esc_attr( $cover_photo_url ); ?>);">
3435
<?php Avatar::make()->user( $user_id )->size( Size::SIZE_104 )->render(); ?>
3536
<?php if ( tutor_utils()->is_dashboard_page( 'account/profile' ) ) : ?>
3637
<a href="<?php echo esc_url( $edit_profile_url ); ?>" class="tutor-edit-profile-btn">

0 commit comments

Comments
 (0)