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: ✨ upd. EditContactFooter #131

Merged
merged 1 commit into from
Sep 13, 2022
Merged
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
50 changes: 26 additions & 24 deletions modals/profile/components/organisms/EditContact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Button, ButtonBack, Icon2 } from "components/atoms"
import { Search, Title } from "../atoms"
import { ButtonAvatar } from "../moleculs"
import { Contact } from "stores/ContactsStore"
import { useSafeAreaInsets } from "react-native-safe-area-context"

export class Controller {
steps = new Steps(["Data", "Photo"])
Expand Down Expand Up @@ -85,29 +86,32 @@ type FooterProps = {
onPressDone(): void
}

export const Footer = observer(({ steps, onPressBack, onPressDone, onPressNext }: FooterProps) => (
<View style={styles.footer}>
<View style={styles.buttons}>
<ButtonBack onPress={onPressBack} />

{steps.title === "Data" ? (
<Button
text="Continue"
onPress={onPressNext}
textStyle={styles.buttonText}
contentContainerStyle={styles.buttonContent}
/>
) : (
<Button
onPress={onPressDone}
text="Save"
textStyle={styles.buttonText}
contentContainerStyle={styles.buttonContent}
/>
)}
export const Footer = observer(({ steps, onPressBack, onPressDone, onPressNext }: FooterProps) => {
const insets = useSafeAreaInsets()
return (
<View style={[styles.footer, { paddingBottom: insets.bottom + 8 }]}>
<View style={styles.buttons}>
<ButtonBack onPress={onPressBack} />

{steps.title === "Data" ? (
<Button
text="Continue"
onPress={onPressNext}
textStyle={styles.buttonText}
contentContainerStyle={styles.buttonContent}
/>
) : (
<Button
onPress={onPressDone}
text="Save"
textStyle={styles.buttonText}
contentContainerStyle={styles.buttonContent}
/>
)}
</View>
</View>
</View>
))
)
})

const styles = StyleSheet.create({
container: {
Expand Down Expand Up @@ -139,10 +143,8 @@ const styles = StyleSheet.create({
// ------ Footer ----------

footer: {
flexGrow: 1,
justifyContent: "flex-end",
marginHorizontal: 26,
marginBottom: 8,
},

button_qr: {
Expand Down