-
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
Changes from all commits
1dcfe45
31850a0
d1dbb54
9bd6a37
6094b52
cd1369c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import resolvePathname from 'resolve-pathname' | ||
import { GU } from '@aragon/ui' | ||
|
||
export function pollEvery(fn, delay) { | ||
let timer = -1 | ||
|
@@ -132,23 +131,9 @@ export function shuffleArray(original) { | |
return array | ||
} | ||
|
||
// 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` | ||
}) | ||
} | ||
Comment on lines
-135
to
-145
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe 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). |
||
|
||
// Email validation regex from https://stackoverflow.com/questions/46155/how-to-validate-an-email-address-in-javascript | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. Quite the simplification! |
||
} | ||
|
||
export const iOS = | ||
|
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 :)