Skip to content

Commit

Permalink
data-name attribute added to slides
Browse files Browse the repository at this point in the history
  • Loading branch information
vinaymavi committed Nov 14, 2023
1 parent f9807d7 commit c00865e
Show file tree
Hide file tree
Showing 5 changed files with 803 additions and 11 deletions.
21 changes: 12 additions & 9 deletions app/auth/slides/[slide]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,6 @@ const Page = ({

return (
<>
<div style={{ fontSize: "30px" }}>
<h2 style={{ fontSize: "30px", padding: "5px" }} id="timer">
{time}, Current Slide time {currentSlideTime}
</h2>
</div>
<div
style={{
width: "100%",
Expand All @@ -142,8 +137,12 @@ const Page = ({
}}
>
<div className="slides">
<section data-slideid={"start-1"}>START 1</section>
<section data-slideid={"start-2"}>START 2</section>
<section data-slideid={"start-1"} data-name="start-1">
START 1
</section>
<section data-slideid={"start-2"} data-name="start-2">
START 2
</section>
{slides.map((slide, index) => (
<>
<Slide
Expand Down Expand Up @@ -172,8 +171,12 @@ const Page = ({
/>
</>
))}
<section data-slideid={"end-1"}>end 1</section>
<section data-slideid={"end-2"}>end 2</section>
<section data-slideid={"end-1"} data-name="end-1">
end 1
</section>
<section data-slideid={"end-2"} data-name="end-2">
end 2
</section>
</div>
</div>
</div>
Expand Down
11 changes: 9 additions & 2 deletions components/Slide/Slide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ export const Slide: FC<SlideProps> = ({
data-auto-animate-restart
data-background-color="white"
data-slideid={`${id}-question`}
data-audioUrl={slideMeta?.questionEn?.file}
data-name={slideMeta?.questionEn?.file}
data-audioUrl={[
slideMeta?.questionEn?.file,
slideMeta?.questionHi?.file,
]}
>
<div
data-id="question"
Expand All @@ -49,7 +53,8 @@ export const Slide: FC<SlideProps> = ({
data-transition="fade-in fade-out"
data-background-color="white"
data-slideid={`${id}-option-list`}
data-audioUrl={slideMeta?.questionEn?.file}
data-name={slideMeta?.options?.map((o: any) => o.file)[0]}
data-audioUrl={slideMeta?.options?.map((o: any) => o.file)}
>
<div className="flex h-screen w-full flex-col text-left">
<div
Expand Down Expand Up @@ -85,6 +90,7 @@ export const Slide: FC<SlideProps> = ({
data-transition="fade-in fade-out"
data-background-color="white"
data-slideid={`${id}-right-answer`}
data-name={slideMeta?.rightAnswer?.file}
data-audioUrl={slideMeta?.rightAnswer?.file}
>
<div className="flex h-screen w-full flex-col">
Expand Down Expand Up @@ -132,6 +138,7 @@ export const Slide: FC<SlideProps> = ({
data-transition="fade-in fade-out"
data-background-color="white"
data-slideid={`${id}-explation`}
data-name={slideMeta?.explanationEn?.file}
data-audioUrl={slideMeta?.explanationEn?.file}
>
<div className="flex h-screen w-full flex-col">
Expand Down
Loading

0 comments on commit c00865e

Please sign in to comment.