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: CategoryViewPage back button is no longer misplaced when uploading posts #395

Merged
Show file tree
Hide file tree
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
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
Loading