-
Notifications
You must be signed in to change notification settings - Fork 752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactored ProfilePicture to use React component #876
Conversation
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
* This file contains the color palette for the Kujali interface. | ||
*/ | ||
|
||
$theme-color-1: #6d0839; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename as $theme-color-primary
? Really though it should be colour 🌈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can call it primary, that's fine too. It's possible in the future that a theme has more than 2 colors, so that's why I just used straight up numbers. In the future, you can then assign variables:
$text-highlight: $theme-color-secondary;
mark { color: $text-highlight }
"Colour"? Haha, I would say CSS use of "color" makes things more consistent, but, if you really want, I can make the change. 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if there's more than two colours in the future, we should just give them straight up names
*/ | ||
|
||
$theme-color-1: #6d0839; | ||
$theme-color-2: #d0e799; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename as $theme-color-secondary
?
.add('With name', withSource( | ||
<Row style={{ backgroundColor: '#aaa' }}> | ||
<Col span={8}> | ||
<Avatar src={photoJulia} name="Julia “Fleurchild” Nguyen" displayname /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOL 🌷👧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, I'm just testing to see what the component looks like when the line length exceeds the width of the image. Honest!
return specList.split(','); | ||
} else { | ||
return [ | ||
{ pattern: 'app/**/*.spec.js', watched: true }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm not 100% sure why it's broken up like this, can you explain? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the client/README.md
I documented a way to run specific tests. I looked up on Stackoverflow on how to do this, and this was the best answer I could find so far. So if you specify a list in the environment properties, it will run those, otherwise falling back to all tests.
@@ -593,22 +586,30 @@ img { | |||
} | |||
|
|||
.small_profile_picture_div { | |||
width: 100px; | |||
height: 100px; | |||
width: 1px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this 1px?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a div element made to behave like a table cell. Since we want to control the width by way of the content's width (which in this case is the Avatar component), we can reduce the number of places to update width information from two places to one.
} | ||
} | ||
|
||
.profile_picture_div { | ||
width: 150px; | ||
height: 150px; | ||
width: 1px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar question as above ^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto as above 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a million for working on this <3
I have a handful of questions that need answering, but overall, LGTM! Excited that we're starting to see put together the React and Rails sides.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for answering my questions and working on this! LGTM!
@@ -1,3 +1,8 @@ | |||
/** | |||
* TODO: Split up development configuration from production configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is a bit more involved than that sadly, we will need to move react_on_rails to v9 and bump us up to webpacker instead of webpacker_lite gem
@@ -35,11 +40,13 @@ const config = Object.assign(baseConfig, { | |||
context: resolve(__dirname), | |||
|
|||
entry: { | |||
'webpack-bundle': [ | |||
'moments-app_bundle': glob.sync('./app/bundles/momentsApp/startup/*'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will we be separating bundles for momentsApp / alliesApp and etc going forward? Or only moments app due to the chart.js requirements?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should let webpack determine chunking. If we use UI routing, then this becomes far more feasible. Right now we're manually creating chunk entries, but that's not scalable. So we should move away from this. But in all honesty, I think the concept of a bundle makes more sense if it was Origin UI vs Kujali UI. When you have a MomentCard in the momentsApp bundle needing a component from the shared bundle, you can achieve the same effect if we put all components into a single folder and make two registration files, one for MomentsApp and one more Common. Or, well, like I said first, let webpack determine the chunking per route.
<%= stylesheet_pack_tag 'shared_bundle' %> | ||
|
||
<!-- TODO: Need a way to load this bundle only on Moments pages --> | ||
<%= javascript_pack_tag 'moments-app_bundle' %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my thoughts here is that once we move the entirety of the app to React, we can just inject one bundle. This feels like a transition code atm.
Addresses #874
Change overview:
PR checklist: