Skip to content

Commit

Permalink
Merge pull request #85 from opherlabs/main
Browse files Browse the repository at this point in the history
add Cards Holder component
  • Loading branch information
mitch1009 authored Sep 19, 2024
2 parents 692caba + 725d59a commit 72332bf
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 25 deletions.
35 changes: 11 additions & 24 deletions components/src/app/cards/page.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,14 @@
import React from "react";
import { QuizCards } from "../../components";
import { files } from "@/components/QuizCards";
import { QuizCards } from "../../components";
import { CardsHolder, files } from "@/components/QuizCards";

function CardsComponent() {
return (
<div
style={{
backgroundImage: 'url("/cards/flag.svg")',
backgroundSize: 'cover',
backgroundPosition: 'center',
height: '100vh',
width: '100vw',
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
}}
>
<div className="p-4 m-6 rounded-lg shadow-md w-full bg-white">
<QuizCards url="cards" files={files} />
</div>
</div>
);
}

export default CardsComponent;

return (
<CardsHolder>
<QuizCards url="cards" files={files} />
</CardsHolder>

);
}

export default CardsComponent;
24 changes: 24 additions & 0 deletions components/src/components/QuizCards/CardsHolder.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react'

export const CardsHolder = ({ children }: { children: React.ReactNode }) => {
return (
<div>
<div
style={{
backgroundImage: 'url("/cards/flag.svg")',
backgroundSize: 'cover',
backgroundPosition: 'center',
height: '100vh',
width: '100vw',
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
}}
>
<div className="p-4 m-6 rounded-lg shadow-md w-full bg-white">
{children}
</div>
</div>
</div>
)
}
1 change: 1 addition & 0 deletions components/src/components/QuizCards/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export * from './QuizCards';
export * from './QuizComponent';
export * from './ScoreModal';
export * from './StaticData';
export * from './CardsHolder';
2 changes: 1 addition & 1 deletion components/src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export {QuizCards, QuizComponent, ScoreModal} from './QuizCards';
export {QuizCards, QuizComponent, ScoreModal,CardsHolder} from './QuizCards';
export {ExampleComponent} from './ExampleComponent'
export {CountdownComponent,AnimatedBackground} from './CountDown'
export {MainLandingPage } from './LandingPage'
Expand Down

0 comments on commit 72332bf

Please sign in to comment.