Skip to content

Commit

Permalink
mobile: adjust paddings, make bottom sheet full screen (#672)
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtus7 authored Feb 9, 2024
1 parent 34f6592 commit f1c7299
Showing 1 changed file with 37 additions and 25 deletions.
62 changes: 37 additions & 25 deletions apps/daimo-mobile/src/view/screen/AccountScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
import { daimoChainFromId } from "@daimo/contract";
import { NativeStackScreenProps } from "@react-navigation/native-stack";
import { useCallback, useEffect, useRef, useState } from "react";
import { ActivityIndicator, Linking, View } from "react-native";
import { ActivityIndicator, Linking, StyleSheet, View } from "react-native";
import { useSharedValue } from "react-native-reanimated";

import { addLastSendTime } from "../../logic/daimoContacts";
Expand Down Expand Up @@ -50,8 +50,10 @@ function AccountScreenInner(props: Props & { account: Account }) {
const { params } = props.route;

return (
<View style={ss.container.screen}>
<ScreenHeader title="Account" onBack={goBack || goHome} />
<View style={[ss.container.screen, styles.noPadding]}>
<View style={styles.screenPadding}>
<ScreenHeader title="Account" onBack={goBack || goHome} />
</View>
<Spacer h={32} />
{"link" in params && (
<AccountScreenLoader account={props.account} link={params.link} />
Expand Down Expand Up @@ -162,31 +164,41 @@ function AccountScreenBody({

return (
<>
<View
style={{
flexDirection: "column",
alignItems: "center",
}}
>
<ContactBubble contact={{ type: "eAcc", ...eAcc }} size={64} />
<View style={styles.screenPadding}>
<View style={styles.mainContent}>
<ContactBubble contact={{ type: "eAcc", ...eAcc }} size={64} />
<Spacer h={16} />
<AccountCopyLinkButton eAcc={eAcc} size="h2" center />
<Spacer h={8} />
<TextH3 color={color.gray3}>{subtitle}</TextH3>
</View>
<Spacer h={24} />
<View style={ss.container.padH8}>
{canSend && <ButtonBig type="primary" title="SEND" onPress={send} />}
</View>
<Spacer h={16} />
<AccountCopyLinkButton eAcc={eAcc} size="h2" center />
<Spacer h={8} />
<TextH3 color={color.gray3}>{subtitle}</TextH3>
</View>
<Spacer h={24} />
<View style={ss.container.padH8}>
{canSend && <ButtonBig type="primary" title="SEND" onPress={send} />}
</View>
<Spacer h={16} />
<View style={ss.container.padH8}>
<ButtonBig
type="subtle"
title="VIEW ON BLOCK EXPLORER"
onPress={openExplorer}
/>
<View style={ss.container.padH8}>
<ButtonBig
type="subtle"
title="VIEW ON BLOCK EXPLORER"
onPress={openExplorer}
/>
</View>
</View>
{bottomSheet}
</>
);
}

const styles = StyleSheet.create({
mainContent: {
flexDirection: "column",
alignItems: "center",
},
noPadding: {
paddingHorizontal: 0,
},
screenPadding: {
paddingHorizontal: 16,
},
});

0 comments on commit f1c7299

Please sign in to comment.