Skip to content

Commit

Permalink
Added a type sample component and mentioned in the sample create scre…
Browse files Browse the repository at this point in the history
…en (#90)

* Added the environment file of UPYOG

* Update index.html

* Added a type sample component and mentioned in the sample create screen
  • Loading branch information
jagankumar-egov authored Jun 6, 2023
1 parent f2919f3 commit 7752193
Show file tree
Hide file tree
Showing 5 changed files with 304 additions and 205 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { CustomisedHooks } from "./hooks";
import { UICustomizations } from "./configs/UICustomizations";
import HRMSCard from "./components/HRMSCard";
import MuktaCard from "./components/MuktaCard";

import SampleComponent from "./components/SampleComponent";


const MuktaModule = ({ stateCode, userType, tenants }) => {
Expand All @@ -32,7 +32,9 @@ const componentsToRegister = {
MuktaCard,
DSSCard:null, // TO HIDE THE DSS CARD IN HOME SCREEN as per MUKTA
AttendenceMgmtCard:null , // TO HIDE THE Attendance Mgmt CARD IN HOME SCREEN as per MUKTA
HRMSCard // Overridden the HRMS card as per MUKTA
HRMSCard ,// Overridden the HRMS card as per MUKTA

SampleComponent
};

const overrideHooks = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";

const SampleComponent = (props) => {
const [data, updateData] = useState({});
const { t } = useTranslation();
useEffect(() => {
updateData(props?.formData || {});
}, [props, props?.formData]);
return (
<div>
<h3>View Entered Data(SampleComponent)</h3>
<div className="sample-component-style">
{Object.keys(data).map((key) => {
return (
data?.[key] && (
<div>
{key} : {JSON.stringify(data?.[key])}
</div>
)
);
})}
</div>
</div>
);
};

export default SampleComponent;
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export const newConfig = [
disable: false,
populators: { name: "additionalDetails", error: "sample error message", validation: { pattern: /^[A-Za-z]+$/i } },
},

// {
// isMandatory: true,
// key: "genders",
Expand Down Expand Up @@ -173,7 +174,12 @@ export const newConfig = [
],
},
},

{
"type": "component",
"component": "SampleComponent",
"withoutLabel": true,
"key": "comments"
},
],
},
];
Expand Down
Loading

0 comments on commit 7752193

Please sign in to comment.