Skip to content

Commit

Permalink
adding closed banner to each required component to show up across the…
Browse files Browse the repository at this point in the history
… app
  • Loading branch information
mazenchami committed Jul 4, 2024
1 parent 4e271a3 commit 07b1c00
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 20 deletions.
2 changes: 2 additions & 0 deletions app/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { Text, TextProps } from "./Text"
import { Icon, IconTypes } from "./Icon"
import { isRTL, translate } from "../i18n"
import SafeAreaViewFixed from "./SafeAreaViewFixed"
import { ClosedBanner } from "./ClosedBanner"

export interface HeaderProps {
/**
Expand Down Expand Up @@ -175,6 +176,7 @@ export function Header(props: HeaderProps) {
{...HeaderViewProps}
style={[$safeArea, HeaderViewProps?.style, { backgroundColor }]}
>
<ClosedBanner />
<View style={[$container, $containerStyleOverride]}>
<HeaderAction
tx={leftTx}
Expand Down
25 changes: 14 additions & 11 deletions app/screens/TalkDetailsScreen/TalkDetailsHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react"
import { TextStyle, View, ViewStyle } from "react-native"
import Animated, { interpolate, SharedValue, useAnimatedStyle } from "react-native-reanimated"
import { Text } from "../../components"
import { ClosedBanner, Text } from "../../components"
import { BackButton } from "../../navigators/BackButton"
import { colors, layout, spacing } from "../../theme"

Expand Down Expand Up @@ -36,16 +36,19 @@ export const TalkDetailsHeader: React.FunctionComponent<TalkDetailsHeaderProps>
}, [headingHeight])

return (
<View style={$rowContainer}>
<BackButton />
<AnimatedText
allowFontScaling={false}
preset="navHeader"
style={[$centerTitle, $animatedTitle]}
>
{title}
</AnimatedText>
</View>
<>
<ClosedBanner />
<View style={$rowContainer}>
<BackButton />
<AnimatedText
allowFontScaling={false}
preset="navHeader"
style={[$centerTitle, $animatedTitle]}
>
{title}
</AnimatedText>
</View>
</>
)
}

Expand Down
16 changes: 7 additions & 9 deletions app/screens/WelcomeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import {
ViewStyle,
useWindowDimensions,
} from "react-native"
import { SafeAreaView } from "react-native-safe-area-context"
import { Button, Screen, Text } from "../components"
import { Button, ClosedBanner, Screen, Text } from "../components"
import { useAppNavigation } from "../hooks"
import { AppStackScreenProps } from "../navigators"
import { colors, spacing } from "../theme"
Expand All @@ -32,7 +31,8 @@ export const WelcomeScreen: React.FC<WelcomeScreenProps> = (_props) => {
}, [])

return (
<Screen style={$container}>
<Screen safeAreaEdges={["top", "bottom"]} style={$container}>
<ClosedBanner />
<View style={$topContainer}>
<Image style={$welcomeLogo} source={welcomeLogo} />
</View>
Expand All @@ -58,7 +58,7 @@ export const WelcomeScreen: React.FC<WelcomeScreenProps> = (_props) => {
/>
</View>

<SafeAreaView style={$bottomContainer} edges={["bottom"]}>
<View style={$bottomContainer}>
<View
style={[
$bottomContentContainer,
Expand All @@ -72,7 +72,7 @@ export const WelcomeScreen: React.FC<WelcomeScreenProps> = (_props) => {
onPress={goNext}
/>
</View>
</SafeAreaView>
</View>
</Screen>
)
}
Expand All @@ -85,7 +85,7 @@ const $container: ViewStyle = {
const $topContainer: ViewStyle = {
flexShrink: 1,
flexGrow: 1,
flexBasis: "25%",
flexBasis: "20%",
justifyContent: "flex-start",
}

Expand All @@ -100,10 +100,8 @@ const $middleContainer: ViewStyle = {
const $bottomContainer: ViewStyle = {
flexShrink: 1,
flexGrow: 0,
flexBasis: "25%",
flexBasis: "20%",
backgroundColor: colors.background,
borderTopLeftRadius: 16,
borderTopRightRadius: 16,
}

const $bottomContentContainer: ViewStyle = {
Expand Down

0 comments on commit 07b1c00

Please sign in to comment.