-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: show correct logo on mobile + space around mobile search button (#…
…1445) Signed-off-by: Norman Meier <[email protected]>
- Loading branch information
Showing
5 changed files
with
59 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,35 @@ | ||
import React from "react"; | ||
import { View, TouchableOpacity, ViewStyle } from "react-native"; | ||
import { View, TouchableOpacity, ViewStyle, StyleProp } from "react-native"; | ||
|
||
import logoTopVersionSVG from "@/assets/logos/logo-hexagon-version-alpha.svg"; | ||
import { SVG } from "@/components/SVG"; | ||
import { useAppConfig } from "@/context/AppConfigProvider"; | ||
import { useAppNavigation } from "@/hooks/navigation/useAppNavigation"; | ||
import { layout } from "@/utils/style/layout"; | ||
|
||
export const TopLogo = () => { | ||
export const TopLogo: React.FC<{ | ||
height?: number; | ||
style?: StyleProp<ViewStyle>; | ||
}> = ({ height = 68, style }) => { | ||
const navigation = useAppNavigation(); | ||
const { homeScreen, logo: configLogo } = useAppConfig(); | ||
|
||
const logoSource = configLogo || logoTopVersionSVG; | ||
const logo = <SVG height={68} source={logoSource} />; | ||
|
||
const style: ViewStyle = { | ||
marginHorizontal: layout.spacing_x0_25, | ||
overflow: "hidden", | ||
}; | ||
|
||
const content = | ||
homeScreen === "Home" ? ( | ||
<TouchableOpacity | ||
style={style} | ||
onPress={() => navigation.navigate(homeScreen as any)} | ||
> | ||
{logo} | ||
</TouchableOpacity> | ||
) : ( | ||
<View style={style}>{logo}</View> | ||
); | ||
const logo = ( | ||
<SVG | ||
height={height} | ||
preserveAspectRatio="xMinYMin meet" | ||
source={logoSource} | ||
/> | ||
); | ||
|
||
return ( | ||
<View | ||
style={{ | ||
flex: 1, | ||
justifyContent: "center", | ||
}} | ||
return homeScreen === "Home" ? ( | ||
<TouchableOpacity | ||
style={style} | ||
onPress={() => navigation.navigate(homeScreen as any)} | ||
> | ||
{content} | ||
</View> | ||
{logo} | ||
</TouchableOpacity> | ||
) : ( | ||
<View style={style}>{logo}</View> | ||
); | ||
}; |
28 changes: 0 additions & 28 deletions
28
packages/components/navigation/components/TopLogoMobile.tsx
This file was deleted.
Oops, something went wrong.