diff --git a/src/App.tsx b/src/App.tsx index 9399d08..7518aa3 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -4,6 +4,7 @@ import HomePage from './components/pages/HomePage'; import DocsPage from './components/pages/DocsPage'; import OwnerPage from './components/pages/OwnerPage'; import UserPage from './components/pages/UserPage'; +import CardDisplayPage from './components/pages/CardDisplayPage'; function App() { useEffect(() => { @@ -28,6 +29,7 @@ function App() { } /> } /> } /> + } /> } /> diff --git a/src/components/pages/CardDisplayPage.tsx b/src/components/pages/CardDisplayPage.tsx new file mode 100644 index 0000000..c984046 --- /dev/null +++ b/src/components/pages/CardDisplayPage.tsx @@ -0,0 +1,62 @@ +import { useParams } from 'react-router-dom'; +import { useQuery } from '@tanstack/react-query'; +import { fetchCardById } from '../../utils/api'; +import '../../styles/card-effects.css'; +import '../../styles/card-fullscreen.css'; + +export default function CardDisplayPage() { + const { id } = useParams<{ id: string }>(); + const cardId = parseInt(id || '0'); + + const { data: card, isLoading } = useQuery({ + queryKey: ['card', cardId], + queryFn: () => fetchCardById(cardId), + enabled: cardId > 0, + }); + + if (isLoading) { + return ( +
+ +
+ ); + } + + if (!card) { + return null; + } + + const isSpecialStatus = ['yui', 'first', 'second', 'third', 'fourth', 'fifth', 'sixth', 'seven'].includes(card.status); + + return ( +
+
+
+
+
+
+ {`Card +
+ {isSpecialStatus && ( + <> +
+
+ + )} +
+
+
+
+
+ ); +} \ No newline at end of file diff --git a/src/styles/card-fullscreen.css b/src/styles/card-fullscreen.css new file mode 100644 index 0000000..16f104b --- /dev/null +++ b/src/styles/card-fullscreen.css @@ -0,0 +1,7 @@ +/* Fullscreen Card Display Styles */ +.card-wrapper-fullscreen { + display: grid; + place-items: center; + position: relative; + overflow: hidden; +} \ No newline at end of file