forked from dappforce/grillchat
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from dappforce/dev/epic
Channels Integration
- Loading branch information
Showing
104 changed files
with
6,502 additions
and
1,549 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { cx } from '@/utils/class-names' | ||
import Button from './Button' | ||
|
||
export default function TabButtons({ | ||
className, | ||
selectedTab, | ||
setSelectedTab, | ||
tabs, | ||
}: { | ||
className?: string | ||
tabs: string[] | ||
selectedTab: string | ||
setSelectedTab: (tab: string) => void | ||
}) { | ||
return ( | ||
<div | ||
className={cx( | ||
'grid grid-cols-2 gap-px rounded-full bg-background-light text-sm font-medium', | ||
className | ||
)} | ||
> | ||
{tabs.map((tab) => ( | ||
<Button | ||
key={tab} | ||
variant={selectedTab === tab ? 'primary' : 'transparent'} | ||
className={cx( | ||
'h-10 py-0', | ||
selectedTab === tab | ||
? 'bg-background-primary/30' | ||
: 'bg-background-light' | ||
)} | ||
onClick={() => setSelectedTab(tab)} | ||
> | ||
{tab} | ||
</Button> | ||
))} | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
import Diamond from '@/assets/emojis/diamond.png' | ||
import Check from '@/assets/icons/check.svg' | ||
import Card from '@/components/Card' | ||
import { Skeleton } from '@/components/SkeletonFallback' | ||
import { cx } from '@/utils/class-names' | ||
import { formatNumber } from '@/utils/strings' | ||
import Image, { ImageProps } from 'next/image' | ||
import Link from 'next/link' | ||
import { CSSProperties } from 'react' | ||
import { FaChevronRight } from 'react-icons/fa6' | ||
|
||
export default function TaskCard({ | ||
completed, | ||
image, | ||
reward, | ||
title, | ||
customAction, | ||
onClick, | ||
href, | ||
openInNewTab, | ||
isLoadingReward, | ||
withoutDiamondIcon, | ||
topBanner, | ||
}: { | ||
image: ImageProps['src'] | ||
title: React.ReactNode | ||
reward: number | string | ||
completed: boolean | ||
customAction?: React.ReactNode | ||
onClick?: () => void | ||
href?: string | ||
openInNewTab?: boolean | ||
isLoadingReward?: boolean | ||
withoutDiamondIcon?: boolean | ||
topBanner?: { | ||
icon: JSX.Element | ||
text: string | ||
className?: string | ||
textStyle?: CSSProperties | ||
textClassName?: string | ||
} | ||
}) { | ||
const card = ( | ||
<Card className='flex cursor-pointer flex-col overflow-clip rounded-2xl p-0'> | ||
{topBanner && ( | ||
<div className='bg-background'> | ||
<div | ||
className={cx( | ||
'flex items-center justify-center gap-1 py-1.5 text-xs', | ||
topBanner.className | ||
)} | ||
> | ||
<span className='text-sm'>{topBanner.icon}</span> | ||
<span | ||
className={cx('font-medium', topBanner.textClassName)} | ||
style={topBanner.textStyle} | ||
> | ||
{topBanner.text} | ||
</span> | ||
</div> | ||
</div> | ||
)} | ||
<div | ||
className='flex items-center gap-2.5 bg-background-light p-2.5 transition active:bg-background-lighter' | ||
onClick={onClick} | ||
> | ||
<Image src={image} alt='' className='h-14 w-14' /> | ||
<div className='flex flex-col gap-1'> | ||
<span className='font-bold'>{title}</span> | ||
<div className='flex items-center gap-0.5'> | ||
{!withoutDiamondIcon && ( | ||
<Image src={Diamond} alt='' className='relative top-px h-5 w-5' /> | ||
)} | ||
{isLoadingReward ? ( | ||
<Skeleton className='w-12' /> | ||
) : ( | ||
<span className='text-text-muted'> | ||
{typeof reward === 'number' | ||
? `+${formatNumber(reward)}` | ||
: reward} | ||
</span> | ||
)} | ||
</div> | ||
</div> | ||
<div className='ml-auto flex items-center justify-center pr-1'> | ||
{completed ? ( | ||
<Check /> | ||
) : customAction ? ( | ||
customAction | ||
) : ( | ||
<FaChevronRight className='text-text-muted' /> | ||
)} | ||
</div> | ||
</div> | ||
</Card> | ||
) | ||
if (href) { | ||
return ( | ||
<Link target={openInNewTab ? '_blank' : undefined} href={href}> | ||
{card} | ||
</Link> | ||
) | ||
} | ||
return card | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.