Skip to content

Commit

Permalink
fix: CategoryViewPage back button is no longer misplaced when uploadi…
Browse files Browse the repository at this point in the history
…ng posts
  • Loading branch information
Sebastian-Webster committed Feb 16, 2024
1 parent 832d7bc commit 9e95d5a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 23 deletions.
5 changes: 3 additions & 2 deletions components/TopNavBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ const TopNavBar = ({extraStyles = {}, rightIcon, screenName, hideBackButton, hid
const {colors} = useTheme();
const navigation = useNavigation();


return (
<ChatScreen_Title style={[{backgroundColor: colors.primary, borderWidth: 0, paddingTop: StatusBarHeight + 10}, extraStyles]}>
<ChatScreen_Title style={[{backgroundColor: colors.primary, borderWidth: 0, paddingTop: StatusBarHeight, height: 'auto', paddingBottom: 5}, extraStyles]}>
{hideBackButton ? null :
leftIcon || (
<Navigator_BackButton style={{paddingTop: StatusBarHeight + 2}} onPress={() => {navigation.goBack()}}>
<Navigator_BackButton style={{paddingTop: StatusBarHeight - 8}} onPress={() => {navigation.goBack()}}>
{leftIconChild || (
<Image
source={require('../assets/app_icons/back_arrow.png')}
Expand Down
35 changes: 14 additions & 21 deletions screens/CategoryViewPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,10 @@ import {
MsgBox,
ImagePostTextFrame,
CategoriesTopBtns,
Navigator_BackButton
Navigator_BackButton,
TestText
} from '../screens/screenStylings/styling';

// Colors
const {brand, primary, tertiary, greyish, darkLight, slightlyLighterPrimary, descTextColor, darkest, red} = Colors;

// async-storage
import AsyncStorage from '@react-native-async-storage/async-storage';

Expand All @@ -90,6 +88,7 @@ import usePostReducer from '../hooks/usePostReducer';
import ParseErrorMessage from '../components/ParseErrorMessage';

import Ionicons from 'react-native-vector-icons/Ionicons.js';
import TopNavBar from '../components/TopNavBar.js';

const CategoryViewPage = ({route, navigation}) => {
const {colors, dark, indexNum} = useTheme()
Expand Down Expand Up @@ -492,23 +491,17 @@ const CategoryViewPage = ({route, navigation}) => {
<>
{displayAgeRequirementWarning == false ?
<>
<View style={{paddingTop: StatusBarHeight - 15, color: colors.primary, flexDirection: 'row', justifyContent: 'center'}}>
<Navigator_BackButton onPress={() => {navigation.goBack()}}>
<Image
source={require('../assets/app_icons/back_arrow.png')}
style={{minHeight: 40, minWidth: 40, width: 40, height: 40, maxWidth: 40, maxHeight: 40, borderRadius: 40/2, tintColor: colors.tertiary, top: -11}}
resizeMode="contain"
resizeMethod="resize"
/>
</Navigator_BackButton>
{categoryData.NSFW == true && (
<SubTitle style={{color: red, marginBottom: 0, marginTop: 15}}>(NSFW)</SubTitle>
)}
{categoryData.NSFL == true && (
<SubTitle style={{color: red, marginBottom: 0, marginTop: 15}}>(NSFL)</SubTitle>
)}
<PageTitle style={{fontSize: 26}} welcome={true}>{categoryData.categoryTitle || "Couldn't get name"}</PageTitle>
</View>
<TopNavBar screenName={
<>
{categoryData.NSFW == true && (
<SubTitle style={{color: colors.red, marginBottom: 0}}>(NSFW)</SubTitle>
)}
{categoryData.NSFL == true && (
<SubTitle style={{color: colors.red, marginBottom: 0}}>(NSFL)</SubTitle>
)}
<TestText style={{color: colors.tertiary}}>{categoryData.categoryTitle || "Couldn't get name"}</TestText>
</>
}/>
{selectedPostFormat == "One" && (<FlatList
data={threads.posts}
keyExtractor={(item) => item._id}
Expand Down

0 comments on commit 9e95d5a

Please sign in to comment.