-
Notifications
You must be signed in to change notification settings - Fork 39
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
Fixed the unlock push profile in the chat #1872
Fixed the unlock push profile in the chat #1872
Conversation
In the file
In the file
In the file
Please fix the issues mentioned above. If you need further assistance, feel free to ask. |
|
There are a few issues and corrections needed in the provided code:
After making the above corrections, the code should be good. If you have any other specific requirements or questions, feel free to ask. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also add comments in the modal file to justify these changes.
)} | ||
|
||
{/* This is for displaying the Chat profile */} | ||
{type === UNLOCK_PROFILE_TYPE.MODAL && position === MODAL_POSITION.ON_PARENT && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create a typescript type in commons.types.ts and keep the unlock profile modal type there.
|
||
import { UNLOCK_PROFILE_TYPE } from './UnlockProfileWrapper'; | ||
import UnlockProfile from './UnlockProfile'; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need this file.
@@ -25,10 +28,23 @@ const UnlockProfileWrapper: FC<IntroContainerProps> = ({ | |||
showConnectModal = false, | |||
description, | |||
onClose, | |||
position = MODAL_POSITION.ON_ROOT, | |||
}) => { | |||
return ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return ( | |
const { | |
isModalOpen: isProfileModalOpen, | |
showModal: showProfileModal, | |
ModalComponent: ProfileModalComponent, | |
} = useModalBlur(); | |
useEffect(() => { | |
if (type === UNLOCK_PROFILE_TYPE.MODAL && position === MODAL_POSITION.ON_ROOT && showConnectModal) { | |
showProfileModal(); | |
} | |
}, [type, showConnectModal]); | |
return ( |
<UnlockProfileModalWrapper | ||
type={type} | ||
showConnectModal={showConnectModal} | ||
description={description} | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<UnlockProfileModalWrapper | |
type={type} | |
showConnectModal={showConnectModal} | |
description={description} | |
/> | |
<ProfileModalComponent | |
InnerComponent={UnlockProfile} | |
InnerComponentProps={{ | |
type, | |
description, | |
}} | |
modalRadius="24px" | |
modalBorder={false} | |
modalPosition={MODAL_POSITION.ON_PARENT} | |
/> |
There are several issues in the provided code snippets:
Overall, there are syntax errors, missing import statements, and typos that need to be fixed in the code snippets provided. Let me correct them for you: // Common.types.ts
export type ModalResponseType = {
isOpen: boolean;
onClose: () => void;
open: () => void;
};
export const VAR_MODAL_POSITION = {
ON_ROOT: 'ON_ROOT',
ON_PARENT: 'ON_PARENT',
} as const;
export type MODAL_POSITION_TYPE = keyof typeof VAR_MODAL_POSITION;
// UnlockProfile.tsx
import styled from 'styled-components';
// Inside the file
// Fix missing closing curly brace for PROFILESTATE enum
export enum PROFILESTATE {
CONNECT_WALLET = 'connectwallet',
UNLOCK_PROFILE = 'unlockprofile',
}
// Fix missing import for styled-components
const RenderToolTip = ({ children, type }) => {
return (
// Tooltip component code
);
};
// Fix missing closing backtick for CustomCheckbox styled component
const CustomCheckbox = styled.input.attrs({ type: 'checkbox' })`
// Checkbox styles
`;
// Fix missing closing curly brace for &:checked block in StepsLeftDesign styled component
const StepsLeftDesign = styled(SpanV2)`
// StepsLeftDesign styles
`;
// UnlockProfileWrapper.tsx
interface IntroContainerProps {
type?: UNLOCK_PROFILE_TYPE;
showConnectModal?: boolean;
description?: string;
onClose: () => void;
}
const UnlockProfileWrapper: FC<IntroContainerProps> = ({
type = DEFAULT_PROPS.type,
showConnectModal = false,
description,
onClose,
position = 'ON_ROOT',
}) => {
// Component code
const DEFAULT_PROPS = {
type: UNLOCK_PROFILE_TYPE.MODAL,
};
// Container styled component missing closing curly brace
const Container = styled(ItemVV2)`
// Container styles
`;
export default UnlockProfileWrapper; After the corrections, the code snippets should be free of syntax errors and typos. Let me know if you need further assistance. |
File: src/common/Common.types.ts All looks good. File: src/components/chat/unlockProfile/UnlockProfile.tsx
File: src/components/chat/unlockProfile/UnlockProfileWrapper.tsx
File: src/sections/chat/ChatSection.tsx All looks good. |
Pull Request Template
Ticket Number
#1869
Description
Fixed the Modal display for the Push Chat. Now the Modal is visible as embedded and recommended chats are visible.
Type of Change
Checklist
Frontend Guidelines
Build & Testing
Screenshots/Video with Explanation
Additional Context
Review & Approvals
Notes
Created a separate file for the UnlockProfile for Chat because on the wrapper the Modal was creating an issue on opening, and in the future if we want to make the chat profile modal compatible with the new modal block theme then we can directly delete that file and make this working.