summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorrohan09-raj <rajrohan1914@gmail.com>2022-08-25 11:52:33 +0530
committerrohan09-raj <rajrohan1914@gmail.com>2022-08-25 11:55:12 +0530
commit54a27fb52551069fa6d40c6f5941c5d49c0f0506 (patch)
tree8aff7da60822a847ea081c981da904880d6fb807 /client
parent772fc663fd31bc247dcc7da31090234b5b89f155 (diff)
admin UI improvement and back button added
Diffstat (limited to 'client')
-rw-r--r--client/src/components/AudioAutoplay/AudioAutoplay.jsx26
-rw-r--r--client/src/pages/Enrollment/FormOne/FormOne.jsx2
2 files changed, 28 insertions, 0 deletions
diff --git a/client/src/components/AudioAutoplay/AudioAutoplay.jsx b/client/src/components/AudioAutoplay/AudioAutoplay.jsx
new file mode 100644
index 0000000..285aeb6
--- /dev/null
+++ b/client/src/components/AudioAutoplay/AudioAutoplay.jsx
@@ -0,0 +1,26 @@
+import React from 'react'
+
+const AudioAutoplay = ({ audio }) => {
+ const language = localStorage.getItem('i18nextLng')
+
+ const audioLanguage = () => {
+ if (language === 'en') {
+ return `${audio}-english.mp3`
+ } else if (language === 'hi') {
+ return `${audio}-hindi.mp3`
+ } else {
+ return `${audio}-english.mp3`
+ }
+ }
+
+ return (
+ <iframe
+ src={audioLanguage()}
+ allow="autoplay"
+ style={{ display: 'none' }}
+ id="iframeAudio"
+ />
+ )
+}
+
+export default AudioAutoplay
diff --git a/client/src/pages/Enrollment/FormOne/FormOne.jsx b/client/src/pages/Enrollment/FormOne/FormOne.jsx
index 4fd2d41..f34a2ea 100644
--- a/client/src/pages/Enrollment/FormOne/FormOne.jsx
+++ b/client/src/pages/Enrollment/FormOne/FormOne.jsx
@@ -6,6 +6,7 @@ import LabelCard from '../../../components/LabelCard/LabelCard'
import styles from './FormOne.module.css'
import { userContext } from '../../../context/User'
import PopUpModal from '../../../components/Modal/Modal'
+import AudioAutoplay from '../../../components/AudioAutoplay/AudioAutoplay'
const FormOne = () => {
const { t } = useTranslation()
@@ -36,6 +37,7 @@ const FormOne = () => {
return (
<>
<Header subheading={t('ENROLLMENT')} />
+ <AudioAutoplay audio={`${process.env.PUBLIC_URL}/assets/audios/iris`} />
<PopUpModal
title="FILL_YOUR_INFORMATION"
image={`${process.env.PUBLIC_URL}/assets/images/id.svg`}