Skip to content

Commit

Permalink
Merge pull request #687 from dappforce/deploy/epic
Browse files Browse the repository at this point in the history
Deploy/epic
  • Loading branch information
mckrava authored Jul 10, 2024
2 parents dc0127a + 0759690 commit e13999a
Show file tree
Hide file tree
Showing 54 changed files with 1,666 additions and 371 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jobs:
GH_NEXT_PUBLIC_CONTEST_CHAT_ID=0x0106b70599fea6682ec0de3c6ab248d4
GH_NEXT_PUBLIC_CONTEST_NAME=MEMECOIN CONTEST
GH_NEXT_PUBLIC_CONTEST_END_TIME=1720796400739
GH_NEXT_PUBLIC_TIME_CONSTRAINT=300000
GH_NEXT_PUBLIC_AMP_ID=40d4174295c7edf657fc3bedf2748549
GH_NEXT_PUBLIC_COMMUNITY_HUB_ID=12455
GH_NEXT_PUBLIC_GA_ID=G-TP1XEFNHQD
Expand Down Expand Up @@ -113,6 +114,7 @@ jobs:
GH_NEXT_PUBLIC_CONTEST_CHAT_ID=0x850f0f5c0c244eba16425a464b0becfc
GH_NEXT_PUBLIC_CONTEST_NAME=MEMECOIN CONTEST
GH_NEXT_PUBLIC_CONTEST_END_TIME=1720796400739
GH_NEXT_PUBLIC_TIME_CONSTRAINT=5000
GH_NEXT_PUBLIC_TELEGRAM_NOTIFICATION_BOT=https://t.me/g_notif_staging_bot/
GH_TELEGRAM_BOT_TOKEN="7038999347:AAGBgXTWcXpR4vZPW9A8_ia9PkWOpeyDeWA"
# without base path
Expand Down
1 change: 1 addition & 0 deletions ci.env
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ NEXT_PUBLIC_MAIN_CHAT_ID='$GH_NEXT_PUBLIC_MAIN_CHAT_ID'
NEXT_PUBLIC_CONTEST_CHAT_ID='$GH_NEXT_PUBLIC_CONTEST_CHAT_ID'
NEXT_PUBLIC_CONTEST_NAME='$GH_NEXT_PUBLIC_CONTEST_NAME'
NEXT_PUBLIC_CONTEST_END_TIME='$GH_NEXT_PUBLIC_CONTEST_END_TIME'
NEXT_PUBLIC_TIME_CONSTRAINT='$GH_NEXT_PUBLIC_TIME_CONSTRAINT'
NEXT_PUBLIC_BASE_PATH='$GH_NEXT_PUBLIC_BASE_PATH'
NEXT_PUBLIC_NEYNAR_CLIENT_ID='$GH_NEXT_PUBLIC_NEYNAR_CLIENT_ID'
NEXT_PUBLIC_TELEGRAM_BOT_ID='$GH_NEXT_PUBLIC_TELEGRAM_BOT_ID'
Expand Down
4 changes: 4 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ARG GH_NEXT_PUBLIC_MAIN_CHAT_ID
ARG GH_NEXT_PUBLIC_CONTEST_CHAT_ID
ARG GH_NEXT_PUBLIC_CONTEST_NAME
ARG GH_NEXT_PUBLIC_CONTEST_END_TIME
ARG GH_NEXT_PUBLIC_TIME_CONSTRAINT
ARG GH_NEXT_PUBLIC_BASE_PATH
ARG GH_NEXT_PUBLIC_NEYNAR_CLIENT_ID
ARG GH_NEXT_PUBLIC_TELEGRAM_BOT_ID
Expand Down Expand Up @@ -42,6 +43,7 @@ ENV NEXTAUTH_URL=${GH_NEXTAUTH_URL} \
NEXT_PUBLIC_CONTEST_CHAT_ID=${GH_NEXT_PUBLIC_CONTEST_CHAT_ID} \
NEXT_PUBLIC_CONTEST_NAME=${GH_NEXT_PUBLIC_CONTEST_NAME} \
NEXT_PUBLIC_CONTEST_END_TIME=${GH_NEXT_PUBLIC_CONTEST_END_TIME} \
NEXT_PUBLIC_TIME_CONSTRAINT=${GH_NEXT_PUBLIC_TIME_CONSTRAINT} \
NEXT_PUBLIC_BASE_PATH=${GH_NEXT_PUBLIC_BASE_PATH} \
NEXT_PUBLIC_NEYNAR_CLIENT_ID=${GH_NEXT_PUBLIC_NEYNAR_CLIENT_ID} \
NEXT_PUBLIC_TELEGRAM_BOT_ID=${GH_NEXT_PUBLIC_TELEGRAM_BOT_ID} \
Expand Down Expand Up @@ -100,6 +102,7 @@ ARG GH_NEXT_PUBLIC_MAIN_CHAT_ID
ARG GH_NEXT_PUBLIC_CONTEST_CHAT_ID
ARG GH_NEXT_PUBLIC_CONTEST_NAME
ARG GH_NEXT_PUBLIC_CONTEST_END_TIME
ARG GH_NEXT_PUBLIC_TIME_CONSTRAINT
ARG GH_NEXT_PUBLIC_BASE_PATH
ARG GH_NEXT_PUBLIC_NEYNAR_CLIENT_ID
ARG GH_NEXT_PUBLIC_TELEGRAM_BOT_ID
Expand Down Expand Up @@ -128,6 +131,7 @@ ENV NEXTAUTH_URL=${GH_NEXTAUTH_URL} \
NEXT_PUBLIC_CONTEST_CHAT_ID=${GH_NEXT_PUBLIC_CONTEST_CHAT_ID} \
NEXT_PUBLIC_CONTEST_NAME=${GH_NEXT_PUBLIC_CONTEST_NAME} \
NEXT_PUBLIC_CONTEST_END_TIME=${GH_NEXT_PUBLIC_CONTEST_END_TIME} \
NEXT_PUBLIC_TIME_CONSTRAINT=${GH_NEXT_PUBLIC_TIME_CONSTRAINT} \
NEXT_PUBLIC_BASE_PATH=${GH_NEXT_PUBLIC_BASE_PATH} \
NEXT_PUBLIC_NEYNAR_CLIENT_ID=${GH_NEXT_PUBLIC_NEYNAR_CLIENT_ID} \
NEXT_PUBLIC_TELEGRAM_BOT_ID=${GH_NEXT_PUBLIC_TELEGRAM_BOT_ID} \
Expand Down
1 change: 1 addition & 0 deletions src/@types/subsocial.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ declare module '@subsocial/api/types' {
blockchainSyncFailed?: boolean
dataType?: 'persistent' | 'optimistic' | 'offChain'
parentPostId?: string | null
approvedInRootPost?: boolean
},
PostContent
> & { requestedId?: string }
Expand Down
Binary file modified src/assets/emojis/check.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/emojis/time.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export const buttonStyles = cva('relative transition', {
muted: 'bg-background-lightest !ring-background-lightest text-text-muted',
transparent: 'bg-transparent border border-transparent',
redOutline: 'bg-transparent border border-text-red !ring-text-red',
greenOutline:
'bg-transparent border border-green-500 !ring-green-500 text-green-500',
landingPrimary:
'bg-gradient-to-r from-[#DB4646] to-[#F9A11E] text-white hover:!ring-white/50 focus-visible:!ring-white/50',
landingPrimaryOutline:
Expand Down
3 changes: 2 additions & 1 deletion src/components/MediaLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,13 @@ export default function MediaLoader({
alt={props.alt || ''}
className={cx(
commonProps.className,
'absolute inset-0 m-0 h-full w-full p-0'
'absolute inset-0 m-0 h-full max-h-96 w-full scale-110 object-cover p-0 blur-lg'
)}
/>
<Image
{...commonProps}
loading='eager'
className={cx('max-h-96 object-contain', commonProps.className)}
style={{ backfaceVisibility: 'hidden', ...commonProps.style }}
width={commonProps.width || 500}
height={commonProps.height || 500}
Expand Down
52 changes: 24 additions & 28 deletions src/components/ProfilePreviewModalWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useProfilePostsModal } from '@/stores/profile-posts-modal'
import { cx } from '@/utils/class-names'
import { useState } from 'react'
import Name, { NameProps } from './Name'
Expand All @@ -14,7 +15,6 @@ export type ProfilePreviewModalWrapperProps = {

export default function ProfilePreviewModalWrapper({
address,
messageId,
children,
}: ProfilePreviewModalWrapperProps) {
const [isOpenAccountModal, setIsOpenAccountModal] = useState(false)
Expand All @@ -32,41 +32,37 @@ export default function ProfilePreviewModalWrapper({
closeModal={() => setIsOpenAccountModal(false)}
>
<ProfilePreview asLink address={address} className='mb-2' />
{/* {messageId && (
<ActionCard
className='mt-2'
actions={[
{
icon: RiCopperCoinLine,
text: 'Donate',
iconClassName: cx('text-text-muted'),
onClick: () => openDonateExtension(),
},
]}
/>
)} */}
</Modal>
</>
)
}

export function ProfilePreviewModalName({
messageId,
chatId,
hubId,
enableProfileModal = true,
...props
}: NameProps & { messageId?: string }) {
}: NameProps & {
messageId: string
chatId: string
hubId: string
enableProfileModal?: boolean
}) {
const { openModal } = useProfilePostsModal()

return (
<ProfilePreviewModalWrapper address={props.address} messageId={messageId}>
{(onClick) => (
<Name
{...props}
onClick={(e) => {
onClick(e)
props.onClick?.(e)
}}
className={cx('cursor-pointer', props.className)}
address={props.address}
/>
)}
</ProfilePreviewModalWrapper>
<Name
{...props}
onClick={(e) => {
if (enableProfileModal) {
e.preventDefault()
openModal({ messageId, chatId, hubId, address: props.address })
props.onClick?.(e)
}
}}
className={cx('cursor-pointer', props.className)}
address={props.address}
/>
)
}
51 changes: 26 additions & 25 deletions src/components/chats/ChatItem/ChatItem.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import AddressAvatar from '@/components/AddressAvatar'
import ProfilePreviewModalWrapper from '@/components/ProfilePreviewModalWrapper'
import { isMessageSent } from '@/services/subsocial/commentIds/optimistic'
import { useMessageData } from '@/stores/message'
import { useProfilePostsModal } from '@/stores/profile-posts-modal'
import { cx } from '@/utils/class-names'
import { PostData } from '@subsocial/api/types'
import { ComponentProps } from 'react'
import { ScrollToMessage } from '../ChatList/hooks/useScrollToMessage'
import ChatItemMenus from './ChatItemMenus'
import ChatItemWithExtension from './ChatItemWithExtension'
import Embed, { useCanRenderEmbed } from './Embed'
import { getMessageStatusById } from './MessageStatusIndicator'
import DefaultChatItem from './variants/DefaultChatItem'
import EmojiChatItem, {
shouldRenderEmojiChatItem,
Expand All @@ -21,9 +18,12 @@ export type ChatItemProps = Omit<ComponentProps<'div'>, 'children'> & {
messageBubbleId?: string
scrollToMessage?: ScrollToMessage
enableChatMenu?: boolean
enableProfileModal?: boolean
chatId: string
hubId: string
bg?: 'background-light' | 'background'
showApproveButton?: boolean
menuIdPrefix?: string
}

export default function ChatItem({
Expand All @@ -35,28 +35,24 @@ export default function ChatItem({
chatId,
hubId,
bg = 'background-light',
showApproveButton,
enableProfileModal = true,
menuIdPrefix,
...props
}: ChatItemProps) {
const setReplyTo = useMessageData((state) => state.setReplyTo)

const messageId = message.id
const { ownerId, dataType } = message.struct
const { ownerId, id: messageId } = message.struct
const { body, extensions, link } = message.content || {}

const setMessageAsReply = () => {
if (!isMessageSent(messageId, dataType)) return
setReplyTo(messageId)
}
const { openModal } = useProfilePostsModal()

const canRenderEmbed = useCanRenderEmbed(link ?? '')

if (showApproveButton && message.struct.approvedInRootPost) return null

if (!body && (!extensions || extensions.length === 0)) return null

const isEmojiOnly = shouldRenderEmojiChatItem(body ?? '')
const ChatItemContentVariant = isEmojiOnly ? EmojiChatItem : DefaultChatItem

const messageStatus = getMessageStatusById(message)

return (
<>
<div
Expand All @@ -68,17 +64,20 @@ export default function ChatItem({
)}
>
{!isMyMessage && (
<ProfilePreviewModalWrapper address={ownerId} messageId={message.id}>
{(onClick) => (
<AddressAvatar
onClick={onClick}
address={ownerId}
className='flex-shrink-0 cursor-pointer'
/>
)}
</ProfilePreviewModalWrapper>
<AddressAvatar
onClick={(e) => {
e.preventDefault()

if (enableProfileModal) {
openModal({ chatId, hubId, messageId, address: ownerId })
}
}}
address={ownerId}
className='flex-shrink-0 cursor-pointer'
/>
)}
<ChatItemMenus
menuIdPrefix={menuIdPrefix}
chatId={chatId}
messageId={message.id}
enableChatMenu={enableChatMenu}
Expand All @@ -94,7 +93,6 @@ export default function ChatItem({
e.preventDefault()
toggleDisplay?.(e)
}}
// onDoubleClick={() => setMessageAsReply()}
{...referenceProps}
id={messageBubbleId}
>
Expand All @@ -105,14 +103,17 @@ export default function ChatItem({
isMyMessage={isMyMessage}
chatId={chatId}
hubId={hubId}
enableProfileModal={enableProfileModal}
bg={bg}
showApproveButton={showApproveButton}
/>
) : (
<ChatItemContentVariant
message={message}
isMyMessage={isMyMessage}
scrollToMessage={scrollToMessage}
chatId={chatId}
enableProfileModal={enableProfileModal}
hubId={hubId}
bg={bg}
/>
Expand Down
Loading

0 comments on commit e13999a

Please sign in to comment.