Skip to content

Commit d8c4a98

Browse files
authored
Refactored ProfilePicture to use React component (ifmeorg#876)
* Refactored ProfilePicture to use React component 1. Updated ProfilePicture class to use Avatar React component. 2. Enhanced Avatar component to use react-lazyload 3. Updated tests that assert on the ProfilePicture 4. Fixed some tests for language toggling involving page transitions * Fixing CodeClimate complaints * Fixing typo * Reorganizing MomentsApp bundle * Fixing lint errors and paths * Updating tests to asseto on Hash * Updating flow handling of assets * Fixing lint ignore * Adding ignore path for CodeClimate
1 parent 4d7b28f commit d8c4a98

File tree

76 files changed

+1068
-806
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1068
-806
lines changed

.codeclimate.yml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ engines:
2121
- public/javascripts/
2222
- vendor/assets/javascripts
2323
- client/karma.conf.js
24+
- client/flow/
2425
fixme:
2526
enabled: false
2627
rubocop:

Rakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# for example lib/tasks/capistrano.rake, and they will automatically be
55
# available to Rake.
66

7-
require File.expand_path('../config/application', __FILE__)
7+
require File.expand_path('config/application', __dir__)
88
Rails.application.load_tasks
99
require 'fileutils'
1010
require 'yaml'

app/assets/stylesheets/application.scss

+30-29
Original file line numberDiff line numberDiff line change
@@ -544,47 +544,40 @@ a.highlight:hover {
544544

545545
/* Images */
546546

547-
img {
548-
max-width: 100%;
547+
.avatar {
548+
margin: 0;
549+
550+
.portrait {
551+
border-color: $container-color;
552+
border-width: 2px;
553+
background-color: $background-color;
554+
}
549555
}
550556

551-
.mini_profile_picture {
557+
.mini_profile_picture .portrait {
552558
width: 100px;
553559
height: 100px;
554-
border-radius: 50%;
555-
border: 2px solid $container-color;
556-
object-fit: cover;
557560

558561
@media screen and (max-width: $small) {
559562
width: 50px;
560563
height: 50px;
561564
}
562565
}
563566

564-
.contributor_picture,
565-
.profile_picture {
567+
.contributor_picture .portrait,
568+
.profile_picture .portrait {
566569
width: 55px;
567570
height: 55px;
568-
border-radius: 50%;
569-
border: 2px solid $container-color;
570-
margin: 0 auto;
571-
object-fit: cover;
572571

573572
@media screen and (min-width: $small + 1) {
574573
width: 150px;
575574
height: 150px;
576575
}
577576
}
578577

579-
.home_picture {
578+
.home_picture .portrait {
580579
width: 50px;
581580
height: 50px;
582-
border-radius: 50%;
583-
border: 2px solid $container-color;
584-
margin: 0 auto;
585-
display: block;
586-
overflow: hidden;
587-
object-fit: cover;
588581

589582
@media screen and (min-width: $medium + 1) {
590583
width: 100px;
@@ -593,22 +586,30 @@ img {
593586
}
594587

595588
.small_profile_picture_div {
596-
width: 100px;
597-
height: 100px;
589+
width: 1px;
598590

599-
@media screen and (max-width: $small) {
600-
width: 50px;
601-
height: 50px;
591+
.portrait {
592+
width: 100px;
593+
height: 100px;
594+
595+
@media screen and (max-width: $small) {
596+
width: 50px;
597+
height: 50px;
598+
}
602599
}
603600
}
604601

605602
.profile_picture_div {
606-
width: 150px;
607-
height: 150px;
603+
width: 1px;
608604

609-
@media screen and (max-width: $small) {
610-
width: 55px;
611-
height: 55px;
605+
.portrait {
606+
width: 150px;
607+
height: 150px;
608+
609+
@media screen and (max-width: $small) {
610+
width: 55px;
611+
height: 55px;
612+
}
612613
}
613614
}
614615

0 commit comments

Comments
 (0)