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

fix(mobile): fix transaction form layout on ipad #285

Merged
merged 1 commit into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion apps/mobile/app/(app)/(tabs)/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default function SettingsScreen() {
}

return (
<View className="bg-card">
<View className="flex-1 bg-card">
<ScrollView
contentContainerClassName="py-4 gap-4"
contentContainerStyle={{ paddingBottom: bottom + 80 }}
Expand Down
5 changes: 3 additions & 2 deletions apps/mobile/app/(app)/transaction/new-record.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import { useForm } from 'react-hook-form'
import {
ActivityIndicator,
Alert,
Dimensions,
Keyboard,
ScrollView,
View,
useWindowDimensions,
} from 'react-native'

export default function NewRecordScreen() {
Expand All @@ -45,7 +45,7 @@ export default function NewRecordScreen() {
const [page, setPage] = useState<number>(0)
const { defaultBudgetId } = useUserMetadata()
const navigation = useNavigation()
const { width } = useWindowDimensions()
const [width, setWidth] = useState(Dimensions.get('window').width)
const { removeDraftTransaction } = useTransactionStore()

const params = useLocalSearchParams()
Expand Down Expand Up @@ -155,6 +155,7 @@ export default function NewRecordScreen() {
Keyboard.dismiss()
}}
showsHorizontalScrollIndicator={false}
onLayout={(e) => setWidth(e.nativeEvent.layout.width)}
>
<View style={{ width }}>
<TransactionForm
Expand Down