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

Create group chat comp #766

Merged
merged 20 commits into from
Oct 10, 2023
Merged
Changes from 2 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
@@ -34,6 +34,7 @@ export const ChatViewComponent: React.FC<IChatViewComponentProps> = (
file = true,
gif = true,
isConnected = true,
autoConnect = false,
onGetTokenClick,
} = options || {};

Original file line number Diff line number Diff line change
@@ -20,8 +20,11 @@ import { device } from '../../../config';
interface IThemeProps {
theme?: IChatTheme;
}
interface IConnectButtonProps {
autoConnect?: boolean;
}

export const ConnectButtonSub = () => {
export const ConnectButtonSub = ({autoConnect = false}) => {
const {wallet, connecting , connect, disconnect} = useAccount();

const {
@@ -55,6 +58,8 @@ export const ConnectButtonSub = () => {
}
}
useEffect(() => {
if(wallet && !autoConnect)
disconnect(wallet);
setUserData()
}, [wallet])

15 changes: 8 additions & 7 deletions packages/uiweb/src/lib/components/chat/ConnectButton/index.tsx
Original file line number Diff line number Diff line change
@@ -18,6 +18,13 @@ const APP_META_DATA = {
]
}

const wcv2InitOptions = {
projectId: BLOCKNATIVE_PROJECT_ID,
requiredChains: [1, 56]
}

const walletConnect = walletConnectModule(wcv2InitOptions)
const coinbaseWalletSdk = coinbaseWalletModule({ darkMode: true })
const CHAINS = [
{
id: '0x1',
@@ -58,14 +65,8 @@ const CHAINS = [
]


const wcv2InitOptions = {
projectId: BLOCKNATIVE_PROJECT_ID,
requiredChains: [1, 56]
}

const walletConnect = walletConnectModule(wcv2InitOptions)
const wallets = [injectedModule(), walletConnect, coinbaseWalletSdk]

const wallets = [injectedModule(), walletConnect]



Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@ interface IThemeProps {
theme?: IChatTheme;
}

// export interface JoinVerificationGroupSectionProps {

// isRules: boolean;
// isMember: boolean;
// onGetTokenClick?: () => void;
@@ -256,10 +256,11 @@ const ConnectButtonSection: React.FC = () => {

export const MessageInput: React.FC<MessageInputProps> = ({
chatId,
Emoji = true,
GIF = true,
File = true,
isConnected,
emoji = true,
gif = true,
file = true,
isConnected = true,
autoConnect = false,
onGetTokenClick,
}) => {
const [typedMessage, setTypedMessage] = useState<string>('');
@@ -733,7 +734,7 @@ console.log('in update chat feed')
(chatFeed && !chatFeed?.groupInformation)) && (
<>
<Section gap="8px" flex="1" position="static">
{Emoji && (
{emoji && (
<Div
width="25px"
cursor="pointer"
@@ -776,7 +777,7 @@ console.log('in update chat feed')
/>
</Section>
<SendSection position="static">
{GIF && (
{gif && (
<Section
width="34px"
height="24px"
@@ -804,7 +805,7 @@ console.log('in update chat feed')
</Section>
)}
<Section onClick={handleUploadFile}>
{!fileUploading && File && (
{!fileUploading && file && (
<>
<Section
width="17"
2 changes: 2 additions & 0 deletions packages/uiweb/src/lib/components/chat/exportedTypes.ts
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@ export interface IChatViewComponentProps {
gif?: boolean;
file?: boolean;
isConnected?: boolean;
autoConnect?:boolean;
onGetTokenClick?: () => void;
}

@@ -56,6 +57,7 @@ export interface MessageInputProps {
gif?: boolean;
file?: boolean;
isConnected?: boolean;
autoConnect?:boolean;
onGetTokenClick?: () => void;
}