Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Commit

Permalink
fix(site): change bitcoin button size
Browse files Browse the repository at this point in the history
  • Loading branch information
horacioh committed Oct 4, 2023
1 parent 542cc84 commit f721cbc
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 23 deletions.
11 changes: 1 addition & 10 deletions frontend/apps/site/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import {PageSection, SizableText} from '@mintter/ui'
import {NextLink} from 'next-link'
import {useRouter} from 'next/router'

export default function Footer({hmUrl}: {hmUrl?: string}) {
let router = useRouter()
export default function Footer() {
return (
<PageSection.Root tag="footer">
<PageSection.Side />
Expand All @@ -14,14 +13,6 @@ export default function Footer({hmUrl}: {hmUrl?: string}) {
MintterHypermedia
</NextLink>
</SizableText>
{hmUrl ? (
<SizableText size="$2">
Open in{' '}
<NextLink href={hmUrl} target="_blank">
Mintter App
</NextLink>
</SizableText>
) : null}
</PageSection.Content>
<PageSection.Side />
</PageSection.Root>
Expand Down
25 changes: 20 additions & 5 deletions frontend/apps/site/publication-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
EmbedBlock,
FileBlock,
HMBlockChildrenType,
HYPERMEDIA_SCHEME,
HeadingBlock,
ImageBlock,
InlineContent,
Expand All @@ -30,11 +29,11 @@ import {
File,
FontSizeTokens,
PageSection,
Share,
SideSection,
SideSectionTitle,
SizableText,
Spinner,
Text,
Tooltip,
XStack,
YStack,
Expand All @@ -45,13 +44,13 @@ import {NextLink} from 'next-link'
import Head from 'next/head'
import {useRouter} from 'next/router'
import {useMemo, useState} from 'react'
import {DimensionValue} from 'react-native'
import {WebTipping} from 'web-tipping'
import Footer from './footer'
import {PublicationMetadata} from './publication-metadata'
import {HMBlock, HMBlockNode, HMGroup, HMPublication} from './server/json-hm'
import {SiteHead} from './site-head'
import {trpc} from './trpc'
import {DimensionValue} from 'react-native'

export type PublicationPageProps = {
// documentId: string
Expand Down Expand Up @@ -141,15 +140,31 @@ export default function PublicationPage({
<WebTipping
docId={documentId}
editors={pub?.document?.editors || []}
/>
>
<Button
onPress={() =>
window.open(
createHmDocLink(documentId, pub?.version),
'_blank',
)
}
size="$2"
chromeless
iconAfter={Share}
>
<XStack flex={1} alignItems="center">
<SizableText size="$1">Open in Mintter app</SizableText>
</XStack>
</Button>
</WebTipping>
{/*
// TODO: CRITICAL: add more actions here (open in mintter app)
// TODO: CRITICAL: make the web tipping button less "prominent"
*/}
</YStack>
</PageSection.Side>
</PageSection.Root>
<Footer hmUrl={createHmDocLink(documentId, pub?.version)} />
<Footer />
</>
)
}
Expand Down
27 changes: 19 additions & 8 deletions frontend/apps/site/web-tipping.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ import {
import {Check, MinusCircle, PlusCircle, X, Zap} from '@tamagui/lucide-icons'
import {AccountRow} from 'components/account-row'
import Link from 'next/link'
import React, {useEffect, useMemo, useReducer, useRef, useState} from 'react'
import React, {
PropsWithChildren,
useEffect,
useMemo,
useReducer,
useRef,
useState,
} from 'react'
import {toast} from 'react-hot-toast'
import QRCode from 'react-qr-code'
import {HMAccount} from '@mintter/ui'
Expand Down Expand Up @@ -47,10 +54,11 @@ const isTouchDevice =
export function WebTipping({
docId,
editors = [],
}: {
children,
}: PropsWithChildren<{
docId?: string
editors: Array<HMAccount | string | null>
}) {
}>) {
const [open, onOpenChange] = useState<boolean>(false)

return (
Expand All @@ -64,14 +72,17 @@ export function WebTipping({
/>
)}
<Button
icon={Zap}
onPress={() => onOpenChange(true)}
size="$2"
chromeless
iconAfter={Zap}
theme="green"
onPress={() => {
onOpenChange(true)
}}
>
Donate Bitcoin
<XStack flex={1}>
<SizableText size="$1">Donate Bitcoin</SizableText>
</XStack>
</Button>
{children}
</SideSection>
)
}
Expand Down

0 comments on commit f721cbc

Please sign in to comment.