diff --git a/src/blocks/modal/Modal.tsx b/src/blocks/modal/Modal.tsx index 71ddb3af6b..8f886aeb53 100644 --- a/src/blocks/modal/Modal.tsx +++ b/src/blocks/modal/Modal.tsx @@ -8,7 +8,7 @@ import { ModalSize } from './Modal.types'; type ButtonAlignment = 'end' | 'center'; export type ModalProps = { - acceptButtonProps?: ButtonProps; + acceptButtonProps?: ButtonProps | null; buttonAlignment?: ButtonAlignment; cancelButtonProps?: ButtonProps | null; children: ReactNode; @@ -50,6 +50,7 @@ const ContentChildren = styled.div<{ size: ModalSize }>` flex-direction: column; align-items: flex-start; flex: 1 0 0; + width: 100%; padding-top: var(--spacing-${({ size }) => (size === 'small' ? 'xxs' : 'xs')}); `; @@ -137,13 +138,15 @@ const Modal: FC = ({ {cancelButtonProps?.children} )} - + {acceptButtonProps && ( + + )} diff --git a/src/components/chat/unlockProfile/UnlockProfile.tsx b/src/components/chat/unlockProfile/UnlockProfile.tsx index f655eaf043..95f24b841f 100644 --- a/src/components/chat/unlockProfile/UnlockProfile.tsx +++ b/src/components/chat/unlockProfile/UnlockProfile.tsx @@ -33,7 +33,6 @@ export enum PROFILESTATE { } // Interface - type UnlockProfileModalProps = { InnerComponentProps: { type: UNLOCK_PROFILE_TYPE | undefined; @@ -105,26 +104,6 @@ const UnlockProfile = ({ InnerComponentProps, onClose }: UnlockProfileModalProps return ( - {onClose && ( - - - } - /> - - )} - {/* Logo and Left Text */} { const Container = styled(ItemHV2)` flex-direction: column; align-items: ${(props) => (props.type === UNLOCK_PROFILE_TYPE.MODAL ? 'center' : 'end')}; - width: ${(props) => (props.type === UNLOCK_PROFILE_TYPE.MODAL ? '450px' : 'inherit')}; - padding: ${(props) => (props.type === UNLOCK_PROFILE_TYPE.MODAL ? '16px' : '0px')}; + width: ${(props) => (props.type === UNLOCK_PROFILE_TYPE.MODAL ? '100%' : 'inherit')}; + padding: ${(props) => (props.type === UNLOCK_PROFILE_TYPE.MODAL ? '0px' : '0px')}; @media (${device.tablet}) { - width: ${(props) => (props.type === UNLOCK_PROFILE_TYPE.MODAL ? '320px' : 'inherit')}; - padding: ${(props) => (props.type === UNLOCK_PROFILE_TYPE.MODAL ? '12px' : '0px')}; + width: ${(props) => (props.type === UNLOCK_PROFILE_TYPE.MODAL ? '100%' : 'inherit')}; + padding: ${(props) => (props.type === UNLOCK_PROFILE_TYPE.MODAL ? '0px' : '0px')}; align-items: center; } `; diff --git a/src/components/chat/unlockProfile/UnlockProfileWrapper.tsx b/src/components/chat/unlockProfile/UnlockProfileWrapper.tsx index fe33fdde4c..9780914c82 100644 --- a/src/components/chat/unlockProfile/UnlockProfileWrapper.tsx +++ b/src/components/chat/unlockProfile/UnlockProfileWrapper.tsx @@ -1,8 +1,8 @@ -import { ItemVV2 } from 'components/reusables/SharedStylingV2'; -import useModalBlur, { MODAL_POSITION } from 'hooks/useModalBlur'; -import { useEffect } from 'react'; +import { FC } from 'react'; import styled from 'styled-components'; +import { ItemVV2 } from 'components/reusables/SharedStylingV2'; import UnlockProfile from './UnlockProfile'; +import { Modal } from 'blocks'; export enum UNLOCK_PROFILE_TYPE { BOTTOM_BAR = 'bottombar', @@ -13,54 +13,51 @@ interface IntroContainerProps { type?: UNLOCK_PROFILE_TYPE; showConnectModal?: boolean; description?: string; - onClose?: () => void; + onClose: () => void; } const DEFAULT_PROPS = { type: UNLOCK_PROFILE_TYPE.MODAL, }; -const UnlockProfileWrapper = ({ +const UnlockProfileWrapper: FC = ({ type = DEFAULT_PROPS.type, - showConnectModal, + showConnectModal = false, description, onClose, -}: IntroContainerProps) => { - const { - isModalOpen: isProfileModalOpen, - showModal: showProfileModal, - ModalComponent: ProfileModalComponent, - } = useModalBlur(); - - useEffect(() => { - if (type === UNLOCK_PROFILE_TYPE.MODAL && showConnectModal) { - showProfileModal(); - } - }, [type, showConnectModal]); - - if (type === UNLOCK_PROFILE_TYPE.MODAL) { - return ( - - ); - } else { - return ( - - { + return ( + <> + {type === UNLOCK_PROFILE_TYPE.MODAL ? ( + - - ); - } + size="small" + closeOnOverlayClick + cancelButtonProps={null} + acceptButtonProps={null} + > + + + ) : ( + + + + )} + + ); }; export default UnlockProfileWrapper; @@ -70,7 +67,6 @@ const Container = styled(ItemVV2)` border-radius: 24px; padding: 24px; align-items: center; - // overflow: hidden; backdrop-filter: blur(8px); &.bottombar { @@ -81,7 +77,6 @@ const Container = styled(ItemVV2)` width: auto; bottom: 0; flex-direction: row; - // overflow: hidden; border-top-left-radius: 0px; border-top-right-radius: 0px; }