-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a type sample component and mentioned in the sample create scre…
…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
1 parent
f2919f3
commit 7752193
Showing
5 changed files
with
304 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
frontend/micro-ui/web/micro-ui-internals/packages/Mukta/src/components/SampleComponent.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.