Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

948 passvideo chatprofile #957

Merged
merged 4 commits into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ export const ChatProfileTest = () => {
return (
<div>
<ChatProfile
// chatId='0x455E5AA18469bC6ccEF49594645666C587A3a71B'
chatId='81a077fbec5d64802a0feaeb26647250eb9a20894124c7bc1b2e044f360bf59f'
// chatId='36baf37e441fdd94e23406c6c716fc4e91a93a9ee68e070cd5b054534dbe09a6'
component={<div>Some component</div>}
chatId='0x455E5AA18469bC6ccEF49594645666C587A3a71B'
// chatId='36baf37e441fdd94e23406c6c716fc4e91a93a9ee68e070cd5b054534dbe09a6'
style="Info"
/>
/>
</div>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const ChatViewComponentTest = () => {
<ChatView
onVerificationFail={() => console.log("BOIIII RETURNNNSSSSS")}
chatId='0xf8250D363BD1F25f52F10C21188fe82c68C049c4'

component={<div style={{height: "100px"}}><a href="https://github.com" target="_blank">Test</a></div>}
limit={10}
isConnected={true}
groupInfoModalBackground={MODAL_BACKGROUND_TYPE.OVERLAY}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,12 @@ export const AddWalletContent = ({
<Section flex="1" alignSelf="center">
<ModalConfirmButton
onClick={() => {
// console.log(groupMembers);
onSubmit()
}}
isLoading={isLoading}
memberListCount={memberList?.length > 0}
theme={theme}
disabled={isLoading || groupMembers.length === 0}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for making the create group button disable when the group is being created and to add a condition that there should be at least one more wallet address added here

>
{!isLoading && groupMembers ? (submitButtonTitle ? submitButtonTitle : 'Add To Group'): ''}
{isLoading && <Spinner size="30" color="#fff" />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const ChatProfile: React.FC<IChatProfile> = ({
style,
groupInfoModalBackground = MODAL_BACKGROUND_TYPE.OVERLAY,
groupInfoModalPositionType = MODAL_POSITION_TYPE.GLOBAL,
component=null,
}) => {
const theme = useContext(ThemeContext);
const { account, env } = useChatData();
Expand Down Expand Up @@ -127,6 +128,11 @@ export const ChatProfile: React.FC<IChatProfile> = ({
margin="0 20px 0 auto"
alignSelf="center"
>
{(component && !groupInfo) && (
<Section cursor='pointer' maxHeight='1.75rem' width='1.75rem' maxWidth='1.75rem' minWidth='1.75rem'>
{component}
</Section>
)}
{(groupInfo?.rules?.chat?.conditions ||
groupInfo?.rules?.entry?.conditions) && <TokenGatedSvg />}
{!!groupInfo?.isPublic && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const ChatViewComponent: React.FC<IChatViewComponentProps> = (
groupInfoModalPositionType = MODAL_POSITION_TYPE.GLOBAL,
verificationFailModalBackground = MODAL_BACKGROUND_TYPE.OVERLAY,
verificationFailModalPosition = MODAL_POSITION_TYPE.GLOBAL,
component=null
} = options || {};

const { env, signer, account, pgpPrivateKey } = useChatData();
Expand All @@ -62,7 +63,7 @@ export const ChatViewComponent: React.FC<IChatViewComponentProps> = (
padding="13px"
theme={theme}
>
{chatProfile && <ChatProfile chatId={chatId} style="Info" groupInfoModalBackground={groupInfoModalBackground} groupInfoModalPositionType={groupInfoModalPositionType}/>}
{chatProfile && <ChatProfile component={component} chatId={chatId} style="Info" groupInfoModalBackground={groupInfoModalBackground} groupInfoModalPositionType={groupInfoModalPositionType}/>}
<Section
flex="1 1 auto"
overflow="hidden"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface AddWalletsInCreateGroupProps {
}

const AddWalletsInCreateGroup = ({ handlePrevious, onClose,groupInputDetails, groupEncryptionType, checked, criteriaStateManager, groupMembers, setGroupMembers }: AddWalletsInCreateGroupProps) => {
const { createGatedGroup } = useCreateGatedGroup();
const { createGatedGroup, loading } = useCreateGatedGroup();
const groupInfoToast = useToast();
const getEncryptionType = () => {
if (groupEncryptionType === 'encrypted') {
Expand Down Expand Up @@ -85,7 +85,7 @@ const AddWalletsInCreateGroup = ({ handlePrevious, onClose,groupInputDetails, gr
memberList={groupMembers}
handleMemberList={setGroupMembers}
groupMembers={groupInputDetails.groupMembers}
isLoading={false}
isLoading={loading}
modalHeader="Add Wallets"
/>
</Section>
Expand Down
2 changes: 2 additions & 0 deletions packages/uiweb/src/lib/components/chat/exportedTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ export interface IChatViewComponentProps {
verificationFailModalBackground?: ModalBackgroundType;
verificationFailModalPosition?: ModalPositionType;
onVerificationFail?: () => void;
component?: React.ReactNode;
}

export interface IChatProfile {
chatId: string;
style: "Info" | "Preview";
groupInfoModalBackground?: ModalBackgroundType;
groupInfoModalPositionType?: ModalPositionType;
component?: React.ReactNode;
}

export interface TwitterFeedReturnType {
Expand Down
Loading