Skip to content

Commit

Permalink
feat: fix design qa 2 (#144)
Browse files Browse the repository at this point in the history
* fix remove loading text in loading overlay

* feat: change deck card detail to carousel
  • Loading branch information
yungjurick authored Aug 12, 2023
1 parent 889e95f commit df3518f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
14 changes: 11 additions & 3 deletions packages/service-frontend/app/deck/[id]/DeckDetail.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import { useRef, useState } from 'react'
import { useMemo, useRef, useState } from 'react'

import { useQuery } from '@tanstack/react-query'
import { AnimatePresence, motion, useInView } from 'framer-motion'
Expand Down Expand Up @@ -75,6 +75,14 @@ export default function DeckDetail({ params }: Props): JSX.Element {
redirect('/404')
}

const previewDeckList = useMemo(() => {
if (cardListData?.result) {
return cardListData.result.slice(0, 3)
}

return []
}, [cardListData?.result])

return (
<div className="bg-light">
{data?.result && cardListData?.result && (
Expand Down Expand Up @@ -156,8 +164,8 @@ export default function DeckDetail({ params }: Props): JSX.Element {
{/* --- Deck Detail Card Section --- */}
<div className="pb-[40px]">
{/* Deck Card List */}
<div className="flex gap-x-[8px] px-[24px] -mt-[26px] overflow-x-hidden snap-x pb-[24px]">
{cardListData.result.map(card => {
<div className="flex gap-x-[8px] px-[24px] -mt-[26px] overflow-x-auto pb-[24px] scrollbar-hide">
{previewDeckList.map(card => {
return (
<div
key={card.id}
Expand Down
3 changes: 1 addition & 2 deletions packages/service-frontend/app/loading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import loginLottie from '@/public/lottie/loginLottie.json'
export default function Loading(): JSX.Element {
return (
<ContentWrapper>
<div className='min-h-screen px-[16px] flex flex-col gap-[20px] justify-center items-center'>
Loading...
<div className="min-h-screen px-[16px] flex flex-col gap-[20px] justify-center items-center">
<Lottie animationData={loginLottie} />
</div>
</ContentWrapper>
Expand Down

0 comments on commit df3518f

Please sign in to comment.