From cb613705e901eb50a3112140452e78571ec1fdf6 Mon Sep 17 00:00:00 2001 From: mantikoros <95266179+mantikoros@users.noreply.github.com> Date: Sat, 1 Oct 2022 15:51:08 -0500 Subject: [PATCH] Consistent tips (#984) * consistent tip button * hide tips for self * prettier --- web/components/button.tsx | 4 +- .../contract/like-market-button.tsx | 57 +++--------- web/components/contract/tip-button.tsx | 57 ++++++++++++ web/components/feed/feed-comments.tsx | 8 +- web/components/tipper.tsx | 90 ++++--------------- web/posts/post-comments.tsx | 2 +- 6 files changed, 94 insertions(+), 124 deletions(-) create mode 100644 web/components/contract/tip-button.tsx diff --git a/web/components/button.tsx b/web/components/button.tsx index 51e25ea1..ecd8e1c7 100644 --- a/web/components/button.tsx +++ b/web/components/button.tsx @@ -46,7 +46,6 @@ export function Button(props: { - + ) } diff --git a/web/components/contract/tip-button.tsx b/web/components/contract/tip-button.tsx new file mode 100644 index 00000000..79059195 --- /dev/null +++ b/web/components/contract/tip-button.tsx @@ -0,0 +1,57 @@ +import { HeartIcon } from '@heroicons/react/outline' +import { Button } from 'web/components/button' +import { formatMoney } from 'common/util/format' +import clsx from 'clsx' +import { Col } from 'web/components/layout/col' +import { Tooltip } from '../tooltip' + +export function TipButton(props: { + tipAmount: number + totalTipped: number + onClick: () => void + userTipped: boolean + isCompact?: boolean + disabled?: boolean +}) { + const { tipAmount, totalTipped, userTipped, isCompact, onClick, disabled } = + props + + return ( + + + + ) +} diff --git a/web/components/feed/feed-comments.tsx b/web/components/feed/feed-comments.tsx index 20d124f8..b9387a03 100644 --- a/web/components/feed/feed-comments.tsx +++ b/web/components/feed/feed-comments.tsx @@ -177,10 +177,6 @@ export function FeedComment(props: { smallImage /> - {tips && } - {(contract.openCommentBounties ?? 0) > 0 && ( - - )} {onReplyClick && ( - - ) -} - -function UpTip(props: { onClick?: () => void; value: number }) { - const { onClick, value } = props - const IconKind = value > TIP_SIZE ? ChevronDoubleRightIcon : ChevronRightIcon - return ( - - - - ) -} diff --git a/web/posts/post-comments.tsx b/web/posts/post-comments.tsx index f1d50a29..74fbb300 100644 --- a/web/posts/post-comments.tsx +++ b/web/posts/post-comments.tsx @@ -154,7 +154,6 @@ export function PostComment(props: { smallImage /> - {onReplyClick && (