Skip to content

Commit

Permalink
Merge pull request #45373 from huult/44436-qr-code-expand
Browse files Browse the repository at this point in the history
fix QR code expand to full size
  • Loading branch information
mountiny authored Jul 19, 2024
2 parents 72118a0 + 3e45ea6 commit 3d465c3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/QRShare/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,21 @@ import ExpensifyWordmark from '@assets/images/expensify-wordmark.svg';
import ImageSVG from '@components/ImageSVG';
import QRCode from '@components/QRCode';
import Text from '@components/Text';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import useWindowDimensions from '@hooks/useWindowDimensions';
import variables from '@styles/variables';
import type {QRShareHandle, QRShareProps} from './types';

function QRShare({url, title, subtitle, logo, svgLogo, svgLogoFillColor, logoBackgroundColor, logoRatio, logoMarginRatio}: QRShareProps, ref: ForwardedRef<QRShareHandle>) {
const styles = useThemeStyles();
const theme = useTheme();
const {isSmallScreenWidth} = useResponsiveLayout();
const {windowWidth} = useWindowDimensions();
const qrCodeContainerWidth = isSmallScreenWidth ? windowWidth : variables.sideBarWidth;

const [qrCodeSize, setQrCodeSize] = useState<number | undefined>();
const [qrCodeSize, setQrCodeSize] = useState<number>(qrCodeContainerWidth - styles.ph5.paddingHorizontal * 2 - variables.qrShareHorizontalPadding * 2);
const svgRef = useRef<Svg>();

useImperativeHandle(
Expand Down

0 comments on commit 3d465c3

Please sign in to comment.