Skip to content

Commit

Permalink
Extract a <GradientHeader /> component
Browse files Browse the repository at this point in the history
  • Loading branch information
jessepinho committed May 16, 2024
1 parent 223544e commit dfb70e7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Card } from '@penumbra-zone/ui/components/ui/card';
import { cn } from '@penumbra-zone/ui/lib/utils';
import { GradientHeader } from '@penumbra-zone/ui/components/ui/gradient-header';
import { EduPanel, eduPanelContent } from './content';

interface HelperCardProps {
Expand All @@ -14,9 +15,7 @@ export const EduInfoCard = ({ src, label, className, content }: HelperCardProps)
<Card gradient className={cn('p-5 row-span-1', className)}>
<div className='flex gap-2'>
<img src={src} alt='icons' className='size-[30px] md:size-8' />
<p className='bg-text-linear bg-clip-text font-headline text-xl font-semibold leading-[30px] text-transparent md:text-2xl md:font-bold md:leading-9'>
{label}
</p>
<GradientHeader>{label}</GradientHeader>
</div>
<p className='mt-4 text-muted-foreground md:mt-2'>{eduPanelContent[content]}</p>
</Card>
Expand Down
7 changes: 4 additions & 3 deletions apps/minifront/src/components/swap/dutch-auction/auctions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
} from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb';
import { useStoreShallow } from '../../../utils/use-store-shallow';
import { bech32mAssetId } from '@penumbra-zone/bech32m/passet';
import { GradientHeader } from '@penumbra-zone/ui/components/ui/gradient-header';

const getMetadata = (metadataByAssetId: Record<string, Metadata>, assetId?: AssetId) => {
let metadata: Metadata | undefined;
Expand All @@ -30,9 +31,9 @@ export const Auctions = () => {

return (
<>
<p className='mb-2 bg-text-linear bg-clip-text font-headline text-xl font-semibold leading-[30px] text-transparent md:text-2xl md:font-bold md:leading-9'>
My auctions
</p>
<div className='mb-2'>
<GradientHeader>My Auctions</GradientHeader>
</div>

<div className='flex flex-col gap-2'>
{!auctionInfos.length && "You don't currently have any auctions running."}
Expand Down
5 changes: 2 additions & 3 deletions apps/minifront/src/components/swap/swap/unclaimed-swaps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useStore } from '../../../state';
import { unclaimedSwapsSelector } from '../../../state/unclaimed-swaps';
import { getSwapRecordCommitment } from '@penumbra-zone/getters/swap-record';
import { uint8ArrayToBase64 } from '@penumbra-zone/types/base64';
import { GradientHeader } from '@penumbra-zone/ui/components/ui/gradient-header';

export const UnclaimedSwaps = () => {
const { unclaimedSwaps } = useLoaderData() as SwapLoaderResponse;
Expand All @@ -27,9 +28,7 @@ const _UnclaimedSwaps = ({ unclaimedSwaps }: { unclaimedSwaps: UnclaimedSwapsWit

return (
<Card className='order-1 md:order-3 xl:order-1'>
<p className='bg-text-linear bg-clip-text font-headline text-xl font-semibold leading-[30px] text-transparent md:text-2xl md:font-bold md:leading-9'>
Unclaimed Swaps
</p>
<GradientHeader>Unclaimed Swaps</GradientHeader>
<p className='text-gray-400'>
Swaps on Penumbra are a two step process. The first transaction issues the request and the
second claims the result of the swap action. For some reason, these second transactions were
Expand Down
8 changes: 8 additions & 0 deletions packages/ui/components/ui/gradient-header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* A header with text whose color is a gradient of brand colors.
*/
export const GradientHeader = ({ children }: { children: string }) => (
<p className='bg-text-linear bg-clip-text font-headline text-xl font-semibold leading-[30px] text-transparent md:text-2xl md:font-bold md:leading-9'>
{children}
</p>
);

0 comments on commit dfb70e7

Please sign in to comment.