-
Notifications
You must be signed in to change notification settings - Fork 275
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
Updates from Court Dashboard #1426
Conversation
// Makes “gu” a CSS unit in a string, e.g. | ||
// cssgu`10px 2gu 4gu` | ||
export function cssgu(strings, ...substitutions) { | ||
return strings | ||
.map((str, i) => str + (substitutions[i] || '')) | ||
.join('') | ||
.replace(/([0-9]+(?:\.[0-9]+)?)gu/g, (match, value) => { | ||
value = parseFloat(value) | ||
return isNaN(value) ? match : `${value * GU}px` | ||
}) | ||
} |
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.
👋 👯
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.
is that something that you used before having the grid unit?
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.
Yes, this was just before the grid unit was introduced (we released the activity panel late April, and began introducing the GU in mid May).
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.
🔥
export function validateEmail(email) { | ||
// eslint-disable-next-line no-useless-escape | ||
var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ | ||
return re.test(String(email).toLowerCase()) | ||
return /^.+\@.+\..+$/.test(email) |
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.
Quite the simplification!
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.
LGTM!
<IconCheck | ||
css={` | ||
opacity: 0; | ||
opacity: ${inputEmail.trim() ? '1' : '0'}; |
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.
@bpierre hand was around here :)
// Makes “gu” a CSS unit in a string, e.g. | ||
// cssgu`10px 2gu 4gu` | ||
export function cssgu(strings, ...substitutions) { | ||
return strings | ||
.map((str, i) => str + (substitutions[i] || '')) | ||
.join('') | ||
.replace(/([0-9]+(?:\.[0-9]+)?)gu/g, (match, value) => { | ||
value = parseFloat(value) | ||
return isNaN(value) ? match : `${value * GU}px` | ||
}) | ||
} |
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.
is that something that you used before having the grid unit?
Fixes some of #1425 (will repurpose that issue with the single remaining item):
And a few other small items:
transformAddresses()