From 6bc2359155fb140e7134e4c86cbaa9f3cfc710c2 Mon Sep 17 00:00:00 2001 From: Sibtain Ali Date: Fri, 16 Jun 2023 05:21:15 +0500 Subject: [PATCH 01/10] fix: tweak the anonymous footer component design --- src/components/AnonymousReportFooter.js | 29 +++++++++++++++---------- src/pages/home/report/ReportFooter.js | 23 +++++++++----------- src/styles/styles.js | 25 +++++++++++++-------- src/styles/variables.js | 1 + 4 files changed, 45 insertions(+), 33 deletions(-) diff --git a/src/components/AnonymousReportFooter.js b/src/components/AnonymousReportFooter.js index 08a4a04e64dd..76129afd3cbe 100644 --- a/src/components/AnonymousReportFooter.js +++ b/src/components/AnonymousReportFooter.js @@ -3,11 +3,10 @@ import {View, Text} from 'react-native'; import Button from './Button'; import AvatarWithDisplayName from './AvatarWithDisplayName'; import ExpensifyWordmark from './ExpensifyWordmark'; -import compose from '../libs/compose'; -import withWindowDimensions, {windowDimensionsPropTypes} from './withWindowDimensions'; import withLocalize, {withLocalizePropTypes} from './withLocalize'; import reportPropTypes from '../pages/reportPropTypes'; import CONST from '../CONST'; +import variables from '../styles/variables'; import styles from '../styles/styles'; import * as Session from '../libs/actions/Session'; @@ -15,7 +14,6 @@ const propTypes = { /** The report currently being looked at */ report: reportPropTypes, - ...windowDimensionsPropTypes, ...withLocalizePropTypes, }; @@ -23,9 +21,18 @@ const defaultProps = { report: {}, }; -function AnonymousReportFooter(props) { +function AnonymousReportFooter(props){ + const [availableWidth, setAvailableWidth] = React.useState(null); + + const isSmallSizeLayout = availableWidth && availableWidth < variables.anonymousReportFooterBreakpoint; + + const onLayout = (event) => { + const {width} = event.nativeEvent.layout; + setAvailableWidth(width); + }; + return ( - + - - - + + + {props.translate('anonymousReportFooter.logoTagline')} - +