Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let hexArr = hex.match(/[A-Za-z0-9]{2}/g).map(v => parseInt(v, 16));
return `rgba(${hexArr[0]},${hexArr[1]},${hexArr[2]},`;
}
export const rgbaColors = {
primary: hexToRGBArray(colors.primary),
secondary: hexToRGBArray(colors.secondary),
dark_gray: hexToRGBArray(colors.dark_gray),
light_gray: hexToRGBArray(colors.light_gray),
exlight_gray: hexToRGBArray(colors.exlight_gray),
exexlight_gray: hexToRGBArray(colors.exexlight_gray),
white: hexToRGBArray(colors.white)
};
import Hyperlink from "react-native-hyperlink";
const customLinkify = require("linkify-it")()
.add("@", {
validate: function(text, pos, self) {
var tail = text.slice(pos);
if (!self.re.twitter) {
self.re.twitter = new RegExp(
"^([a-zA-Z0-9_]){1,15}(?!_)(?=$|" + self.re.src_ZPCc + ")"
);
}
if (self.re.twitter.test(tail)) {
// Linkifier allows punctuation chars before prefix,
// but we additionally disable `@` ("@@mention" is invalid)
if (pos >= 2 && tail[pos - 2] === "@") {
return false;
}
return tail.match(self.re.twitter)[0].length;
import React from "react";
// @ts-ignore
import Hyperlink from "react-native-hyperlink";
import {colors} from "./theme";
import {Text} from "native-base";
const first_linkify = require("linkify-it")()
.add("@", {
validate: function(text:any, pos:any, self:any) {
var tail = text.slice(pos);
if (!self.re.twitter) {
self.re.twitter = new RegExp(
"^([a-zA-Z0-9_]){1,15}(?!_)(?=$|" + self.re.src_ZPCc + ")"
);
}
if (self.re.twitter.test(tail)) {
if (pos >= 2 && tail[pos - 2] === "@") {
return false;
}
return tail.match(self.re.twitter)[0].length;
}