Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Fixes #4741 - Update color in text tool for localized sites #4749

Merged

Conversation

punamdahiya
Copy link
Contributor

No description provided.

@punamdahiya punamdahiya requested a review from ianb August 6, 2018 18:19
@punamdahiya
Copy link
Contributor Author

@ianb Please review PR that fixes color selection inside Text tool for localized sites. Thanks

@codecov-io
Copy link

codecov-io commented Aug 6, 2018

Codecov Report

Merging #4749 into master will decrease coverage by 0.02%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #4749      +/-   ##
=========================================
- Coverage   41.72%   41.7%   -0.03%     
=========================================
  Files          43      43              
  Lines        1898    1899       +1     
  Branches      353     353              
=========================================
  Hits          792     792              
- Misses       1106    1107       +1
Impacted Files Coverage Δ
server/src/pages/shot/color-picker.js 15.68% <0%> (-0.32%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f7fb6a4...553f81d. Read the comment docs.

@punamdahiya punamdahiya requested a review from chenba August 8, 2018 15:58
@chenba
Copy link
Collaborator

chenba commented Aug 8, 2018

Fixes #4741

@@ -108,9 +108,11 @@ exports.ColorPicker = class ColorPicker extends React.Component {

onClickSwatch(e) {
const color = e.target.style.backgroundColor;
const colorName = e.target.dataset.colorName.toLowerCase().replace(/\s/g, "-");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to use regex here.

Copy link
Collaborator

@chenba chenba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A nit aboot using regex when a plain old string function would work. Otherwise WFM.

@punamdahiya
Copy link
Contributor Author

@chenba Updated PR with the feedback. Thanks

@chenba
Copy link
Collaborator

chenba commented Aug 8, 2018

Hmm is there any reason that the data attributes aren't just the value we need? I don't see why they need to be user friendly strings.

@punamdahiya
Copy link
Contributor Author

for now data values are used to point to correct css class and setting values to classnames can work.

@punamdahiya
Copy link
Contributor Author

Updated to pick colorName directly from data values.

@punamdahiya punamdahiya merged commit 919a116 into mozilla-services:master Aug 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants