Skip to content
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

bugfix: coreContainer not rendering issue resolved #47

Merged
merged 2 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 25 additions & 31 deletions package/config.js
Original file line number Diff line number Diff line change
@@ -1,50 +1,44 @@
/**
* @todo file to be reved merged config from core to be used
*/
// import { ENV_DEV_MODE } from "./constants";
// import { ENV_STAGE_MODE } from "./constants";
// import { ENV_PROD_MODE } from "./constants";

var config = {
// environment: ENV_DEV_MODE,
// environment: ENV_STAGE_MODE,
// environment: ENV_PROD_MODE,

let config = {
// Dev URL
// adminUrl: "http://localhost:8080",
// scraperDBUrl: "http://localhost:5001",
backendUrl: "http://localhost:8080",

color: {
contrastBackgroundColor : "#FB607F",
contrastBackgroundColorDark : "#FA385F",
contrastBackgroundColorLight : "#FDAFBF",
contrastBackgroundColorVeryLight: "#fee7ec",
defaultBackgroundColor : "#ffffff",
errorColor : "#b71c1c",
labelColor : "#b3b3b3",
lightBackgroundColor : "#fafafa",
primaryTextColor : "#6D6C6C",
primaryTextColorLight : "#eeeeee",
secondaryTextColor : "#FB607F",
successColor : "#557c11",
},

// snack message
drawerWidth: 240,

miniDrawerWidth: 56,

otpLength: 6,

snackMessage: false,
// Stage URL
// adminUrl: "http://localhost:8080",
// scraperDBUrl: "http://localhost:5001",
// backendUrl: "https://stageapi.rxefy.com",

// adminUrl: "http://rxefy-admin.ap-southeast-1.elasticbeanstalk.com",
// scraperDBUrl: "http://medicine-data.ap-southeast-1.elasticbeanstalk.com",
// backendUrl: "http://prescription-env.eba-4nj3rccj.ap-southeast-1.elasticbeanstalk.com",

webUrl: "webapp.rxefy.com/",

// snack message
drawerWidth: 240,
miniDrawerWidth: 56,
snackMessage: false,
otpLength: 6,
color: {
secondaryTextColor: "#FB607F",
primaryTextColor: "#6D6C6C",
primaryTextColorLight: "#eeeeee",
defaultBackgroundColor: "#ffffff",
lightBackgroundColor: "#fafafa",
contrastBackgroundColor: "#FB607F",
contrastBackgroundColorDark: "#FA385F",
contrastBackgroundColorLight: "#FDAFBF",
contrastBackgroundColorVeryLight: "#fee7ec",
errorColor: "#b71c1c",
successColor: "#557c11",
labelColor: "#b3b3b3",
},
webUrl : "webapp.rxefy.com/",
};

export default config;
13 changes: 4 additions & 9 deletions package/form/SCFormControlLabel.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import React from "react";
import styled from "styled-components/native";
import { Text } from "react-native-paper";
// eslint-disable-next-line import/no-unresolved
import { getEffectiveStyle, StyledComponentsClasses } from "@wrappid/styles";
import { Text } from "react-native-paper";
import styled from "styled-components/native";

const defaultStyleClasses = [StyledComponentsClasses.FORM.FORM_CONTROL_LABEL];

export const SCFormGroup = styled(
Text,
{}
)((props) => ({
...getEffectiveStyle([
...defaultStyleClasses,
...(props?.styleClasses || []),
]),
}));
)((props) => ({ ...getEffectiveStyle([...defaultStyleClasses, ...(props?.styleClasses || [])]) }));
13 changes: 4 additions & 9 deletions package/form/SCFormGroup.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import React from "react";
import styled from "styled-components/native";
import { Text } from "react-native-paper";
// eslint-disable-next-line import/no-unresolved
import { getEffectiveStyle, StyledComponentsClasses } from "@wrappid/styles";
import { Text } from "react-native-paper";
import styled from "styled-components/native";

const defaultStyleClasses = [StyledComponentsClasses.FORM.FORM_GROUP];

export const SCFormGroup = styled(
Text,
{}
)((props) => ({
...getEffectiveStyle([
...defaultStyleClasses,
...(props?.styleClasses || []),
]),
}));
)((props) => ({ ...getEffectiveStyle([...defaultStyleClasses, ...(props?.styleClasses || [])]) }));
10 changes: 5 additions & 5 deletions package/form/nativeFormConstants.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const FORM_XS_DEFAULT_GRID_SIZE = 12;
export const FORM_SM_DEFAULT_GRID_SIZE = 6;
export const FORM_MD_DEFAULT_GRID_SIZE = 4;
export const FORM_LG_DEFAULT_GRID_SIZE = 3;
export const FORM_XL_DEFAULT_GRID_SIZE = 3;
export const FORM_XS_DEFAULT_GRID_SIZE = 12;
export const FORM_SM_DEFAULT_GRID_SIZE = 6;
export const FORM_MD_DEFAULT_GRID_SIZE = 4;
export const FORM_LG_DEFAULT_GRID_SIZE = 3;
export const FORM_XL_DEFAULT_GRID_SIZE = 3;
14 changes: 8 additions & 6 deletions package/helper/appUtils.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
export const getUUID = () => {
var dt = new Date().getTime();
var uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
let date = new Date().getTime();
let uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
/[xy]/g,
function (c) {
var r = (dt + Math.random() * 16) % 16 | 0;
dt = Math.floor(dt / 16);
return (c === "x" ? r : (r & 0x3) | 0x8).toString(16);
function (cal) {
let rem = (date + Math.random() * 16) % 16 | 0;

date = Math.floor(date / 16);
return (cal === "x" ? rem : (rem & 0x3) | 0x8).toString(16);
}
);

return uuid;
// return window.self.crypto.randomUUID();
};
Expand Down
35 changes: 18 additions & 17 deletions package/helper/componentUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import {
FORM_MD_DEFAULT_GRID_SIZE,
FORM_SM_DEFAULT_GRID_SIZE,
FORM_XL_DEFAULT_GRID_SIZE,
FORM_XS_DEFAULT_GRID_SIZE,
} from '../form/nativeFormConstants';
FORM_XS_DEFAULT_GRID_SIZE
} from "../form/nativeFormConstants";

const XS_DEFAULT_GRID_SIZE = 12;
const SM_DEFAULT_GRID_SIZE = 12;
Expand All @@ -13,45 +13,46 @@ const LG_DEFAULT_GRID_SIZE = 12;
const XL_DEFAULT_GRID_SIZE = 12;

export function getGridSizeProps(gridSize, formFlag) {
var finalProps = {
xs: formFlag ? FORM_XS_DEFAULT_GRID_SIZE : XS_DEFAULT_GRID_SIZE,
sm: formFlag ? FORM_SM_DEFAULT_GRID_SIZE : SM_DEFAULT_GRID_SIZE,
md: formFlag ? FORM_MD_DEFAULT_GRID_SIZE : MD_DEFAULT_GRID_SIZE,
let finalProps = {
lg: formFlag ? FORM_LG_DEFAULT_GRID_SIZE : LG_DEFAULT_GRID_SIZE,
md: formFlag ? FORM_MD_DEFAULT_GRID_SIZE : MD_DEFAULT_GRID_SIZE,
sm: formFlag ? FORM_SM_DEFAULT_GRID_SIZE : SM_DEFAULT_GRID_SIZE,
xl: formFlag ? FORM_XL_DEFAULT_GRID_SIZE : XL_DEFAULT_GRID_SIZE,
xs: formFlag ? FORM_XS_DEFAULT_GRID_SIZE : XS_DEFAULT_GRID_SIZE,
};

if (gridSize && !isNaN(gridSize)) {
finalProps = {
xs: gridSize,
sm: gridSize,
md: gridSize,
lg: gridSize,
md: gridSize,
sm: gridSize,
xl: gridSize,
xs: gridSize,
};
} else if (gridSize) {
if (gridSize.xs) {
finalProps = {
xs: gridSize.xs,
sm: gridSize.xs,
md: gridSize.xs,
lg: gridSize.xs,
md: gridSize.xs,
sm: gridSize.xs,
xl: gridSize.xs,
xs: gridSize.xs,
};
}
if (gridSize.sm) {
finalProps = {
...finalProps,
sm: gridSize.sm,
md: gridSize.sm,
lg: gridSize.sm,
md: gridSize.sm,
sm: gridSize.sm,
xl: gridSize.sm,
};
}
if (gridSize.md) {
finalProps = {
...finalProps,
md: gridSize.md,
lg: gridSize.md,
md: gridSize.md,
xl: gridSize.md,
};
}
Expand All @@ -73,11 +74,11 @@ export function getGridSizeProps(gridSize, formFlag) {
return finalProps;
}

function nativeUseScrollTrigger(e) {
function nativeUseScrollTrigger() {
return null;
}

export {nativeUseScrollTrigger};
export { nativeUseScrollTrigger };

const variantMap = {
body1 : "bodyLarge",
Expand Down
41 changes: 19 additions & 22 deletions package/helper/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,50 @@ function nativeFilterOptions(options, params) {
/**
* @todo have to build async select filtering function
*/
// console.log('OPTIONS:', options, params);
let filteredOptions = options;

if (params?.inputValue && params?.inputValue?.length > 0) {
if (params?.getOptionLabel) {
filteredOptions = options.filter((op) =>
params?.getOptionLabel(op)?.includes(params?.inputValue)
filteredOptions = options.filter((oop) =>
params?.getOptionLabel(oop)?.includes(params?.inputValue)
);
} else if (options && options[0] && options[0].label) {
filteredOptions = options.filter((op) =>
op?.label?.includes(params?.inputValue)
filteredOptions = options.filter((oop) =>
oop?.label?.includes(params?.inputValue)
);
} else if (options && options[0] && options[0].name) {
filteredOptions = options.filter((op) =>
op?.name?.includes(params?.inputValue)
filteredOptions = options.filter((oop) =>
oop?.name?.includes(params?.inputValue)
);
}
}

// console.log('params.value', params?.value);
if (params?.value && Array.isArray(params?.value)) {
let values = [];
values = params.value?.map((v) => {
return getValue(params, v);

values = params.value?.map((val) => {
return getValue(params, val);
});
// console.log('\tvalue', values);

filteredOptions = filteredOptions.filter(
(op) => !values.includes(getValue(params, op))
(oop) => !values.includes(getValue(params, oop))
);
} else if (params?.value) {
filteredOptions = filteredOptions.filter(
(op) => getValue(params, op) !== getValue(params, params?.value)
(oop) => getValue(params, oop) !== getValue(params, params?.value)
);
}
return filteredOptions;
}

function getValue(params, ob) {
function getValue(params, oob) {
if (params.getOptionValue) {
return params.getOptionValue(ob);
} else if (ob?.value) {
return ob.value;
} else if (ob?.id) {
return ob.id;
return params.getOptionValue(oob);
} else if (oob?.value) {
return oob.value;
} else if (oob?.id) {
return oob.id;
}
}

export {
nativeFilterOptions,
};
export { nativeFilterOptions };
25 changes: 13 additions & 12 deletions package/helper/iconUtil.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { createIconSetFromIcoMoon } from "react-native-vector-icons";

export function overrideCustomIcons(customIconJsons) {
let iconOb = {};
let iconLibraries = Object.keys(customIconJsons);
for (let i = 0; i < iconLibraries.length; i++) {
iconOb[iconLibraries[i]] = createIconSetFromIcoMoon(
customIconJsons[iconLibraries[i]]
);
}
return iconOb;
}
import { createIconSetFromIcoMoon } from "react-native-vector-icons";

export function overrideCustomIcons(customIconJsons) {
let iconOb = {};
let iconLibraries = Object.keys(customIconJsons);

for (let i = 0; i < iconLibraries.length; i++) {
iconOb[iconLibraries[i]] = createIconSetFromIcoMoon(
customIconJsons[iconLibraries[i]]
);
}
return iconOb;
}
Loading
Loading