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/alerts that reflect standards #746

Open
wants to merge 3 commits into
base: andrew_testing
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import About from 'app/screens/about';
import { Platform, ScrollView, StyleSheet } from 'react-native';
import { Platform, StyleSheet } from 'react-native';
import { Stack } from 'expo-router';
import Head from 'expo-router/head';

Expand Down
10 changes: 5 additions & 5 deletions apps/expo/app/(app)/(drawer)/(tabs)/(stack)/profile/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ import { useProfileId } from 'app/hooks/user';

const Profile = () => {
const { id } = useProfileId();

const metaTitle = id ? `${id}'s Profile` : "Profile"
return (
<>
{Platform.OS === 'web' && (
<Head>
<title>{`${id}'s Profile`}</title>
<meta name="description" content={`${id}'s Profile`} />
<title>{metaTitle}</title>
<meta name="description" content={metaTitle} />
</Head>
)}
<Stack.Screen
options={{
title: `${id}'s Profile`,
name: `${id}'s Profile`,
title: metaTitle,
name: metaTitle,
}}
/>
<ProfileContainer id={id} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Platform, ScrollView } from 'react-native';
import { Platform } from 'react-native';
import { Stack } from 'expo-router';
import Settings from 'app/screens/user/Settings';
import Head from 'expo-router/head';
Expand Down
2 changes: 1 addition & 1 deletion apps/expo/app/(app)/(drawer)/(tabs)/profile/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ProfileContainer from 'app/screens/user/ProfileContainer';
import { Platform, ScrollView } from 'react-native';
import { Platform } from 'react-native';
import { Stack } from 'expo-router';
import Head from 'expo-router/head';

Expand Down
2 changes: 1 addition & 1 deletion apps/expo/app/(app)/modal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Platform, ScrollView, View } from 'react-native';
import { Platform, View } from 'react-native';
import { Stack, router, Link } from 'expo-router';
import Head from 'expo-router/head';
import { RText } from '@packrat/ui';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
2 changes: 1 addition & 1 deletion apps/next/pages/about/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import About from 'app/screens/about';
import { Platform, ScrollView, StyleSheet } from 'react-native';
import { StyleSheet } from 'react-native';

// export const runtime = 'experimental-edge'

Expand Down
2 changes: 1 addition & 1 deletion apps/tauri/pages/about/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import About from 'app/screens/about';
import { Platform, ScrollView, StyleSheet } from 'react-native';
import { StyleSheet } from 'react-native';

// export const runtime = 'experimental-edge'

Expand Down
1 change: 1 addition & 0 deletions packages/app/components/Loader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const loaderStyles = {
marginTop: 20,
justifyContent: 'center',
gap: 8,
alignItems: 'center',
},
heading: {
color: '#0a84ff',
Expand Down
44 changes: 28 additions & 16 deletions packages/app/components/PackOptions/index.tsx
Original file line number Diff line number Diff line change
@@ -1,44 +1,56 @@
import { useState } from 'react';
import { useRouter } from 'app/hooks/router';
import { RStack, RIconButton, BaseModal } from '@packrat/ui';
/* eslint-disable react/react-in-jsx-scope */
import { RStack, RIconButton, BaseModal, View } from '@packrat/ui';
import { Entypo } from '@expo/vector-icons';
import { useModalState } from './useModalState';
import { View } from 'react-native';
import { Text } from 'react-native';

interface PackOptionsProps {
interface IPackOptions {
Edit: React.ReactNode;
Delete: React.ReactNode;
Ignore: React.ReactNode;
isOpen?: boolean | undefined;
hideIcon?: boolean;
toggle?: Function | undefined;
}

export const PackOptions: React.FC<PackOptionsProps> = ({
export const PackOptions = ({
Edit,
Delete,
Ignore,
}) => {
isOpen,
hideIcon = false,
toggle,
}: IPackOptions) => {
const { isModalOpen, openModal, closeModal } = useModalState();

return (
<RStack>
<BaseModal
isOpen={isModalOpen}
isOpen={isOpen}
toggle={toggle}
hideIcon={hideIcon}
onClose={closeModal}
triggerComponent={<MenuTriggerComponent openModal={openModal} />}
>
<RStack style={{ flexDirection: 'row', alignItems: 'center' }}>
{Edit} Edit{' '}
</RStack>
<RStack style={{ flexDirection: 'row', alignItems: 'center' }}>
{Delete} Delete{' '}
</RStack>
{Edit && (
<RStack style={{ flexDirection: 'row', alignItems: 'center' }}>
<Text>{Edit} Edit</Text>
</RStack>
)}
{Delete && (
<RStack style={{ flexDirection: 'row', alignItems: 'center' }}>
<Text> {Delete}Delete </Text>
</RStack>
)}
<RStack
style={{
width: 200,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'flex-end',
justifyContent: 'center',
}}
>
{Ignore}{' '}
<Text>{Ignore}</Text>
</RStack>
</BaseModal>
</RStack>
Expand Down
1 change: 1 addition & 0 deletions packages/app/components/ScoreContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ const loadStyles = (theme: any) => {
width: Platform.OS == 'web' ? '60%' : '100%',
},
scoreText: {
paddingTop: 10,
color: currentTheme.colors.textPrimary,
fontSize: 26,
fontWeight: 'bold',
Expand Down
4 changes: 2 additions & 2 deletions packages/app/components/card/CustomCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const CustomCard = ({
)}
</View>
<RSeparator />
{type === 'pack' ? (
{type === 'pack' && (
<>
<View
style={{
Expand All @@ -83,7 +83,7 @@ export const CustomCard = ({
</View>
<RSeparator />
</>
) : null}
)}
<View
style={{
paddingRight: 16,
Expand Down
4 changes: 2 additions & 2 deletions packages/app/components/card/LargeCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const LargeCard: React.FC<LargeCardProps> = ({
paddingVertical: 15,
}}
>
{Icon ? <Icon /> : null}
{Icon && <Icon />}
<RText
style={{
color: currentTheme.colors.textPrimary,
Expand All @@ -82,7 +82,7 @@ const LargeCard: React.FC<LargeCardProps> = ({
{title && <RText>{title}</RText>}
</RText>
</View>
{ContentComponent ? <ContentComponent {...contentProps} /> : null}
{ContentComponent && <ContentComponent {...contentProps} />}
{children}
</RStack>
);
Expand Down
17 changes: 6 additions & 11 deletions packages/app/components/carousel/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import React, { useRef, useState, ReactNode } from 'react';
import {
ScrollView,
Platform,
Dimensions,
NativeScrollEvent,
} from 'react-native';
import { RStack } from '@packrat/ui';
import React, { useRef, useState, type ReactNode } from 'react';
import { Platform, Dimensions, type NativeScrollEvent } from 'react-native';
import { RStack, RScrollView } from '@packrat/ui';
import ScrollButton from './ScrollButton';
import useCustomStyles from 'app/hooks/useCustomStyles';

Expand All @@ -17,7 +12,7 @@ interface CarouselProps {
const { height, width } = Dimensions.get('window');

const Carousel: React.FC<CarouselProps> = ({ children = [], itemWidth }) => {
const scrollViewRef = useRef<ScrollView>(null);
const scrollViewRef = useRef<RScrollView>(null);
const [currentIndex, setCurrentIndex] = useState<number>(0);
const styles = useCustomStyles(loadStyles);

Expand Down Expand Up @@ -55,7 +50,7 @@ const Carousel: React.FC<CarouselProps> = ({ children = [], itemWidth }) => {
disabled={currentIndex === 0}
/>

<ScrollView
<RScrollView
ref={scrollViewRef}
horizontal
scrollEnabled={Platform.OS === 'web'}
Expand All @@ -80,7 +75,7 @@ const Carousel: React.FC<CarouselProps> = ({ children = [], itemWidth }) => {
{child}
</RStack>
))}
</ScrollView>
</RScrollView>
<ScrollButton
direction="right"
onPress={() => {
Expand Down
4 changes: 2 additions & 2 deletions packages/app/components/chat/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import React from 'react';
import {
View,
Text,
Expand Down Expand Up @@ -163,7 +163,7 @@ const ChatComponent: React.FC<ChatComponentProps> = ({
// <Text style={styles.newChatButtonText}>New Chat</Text>
// </TouchableOpacity>
// </Box>
// </ScrollView>
// </RScrollView>
)}
<MessageList messages={parsedMessages} />
<Form
Expand Down
9 changes: 5 additions & 4 deletions packages/app/components/destination/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useMemo, useState } from 'react';
import { ScrollView, View } from 'react-native';
import { RText } from '@packrat/ui';
import { View } from 'react-native';
import { Container, Text } from 'native-base';
import { useRouter } from 'app/hooks/router';
import { createParam } from 'app/hooks/params';
import useTheme from '../../hooks/useTheme';
Expand All @@ -21,6 +21,7 @@ import {
} from 'app/hooks/destination';
import { WeatherData } from '../weather/WeatherData';
import { useGEOLocationSearch } from 'app/hooks/geojson';
import { RScrollView } from '@packrat/ui';

const DestinationHeader = ({ geoJSON, selectedSearchResult }) => {
const styles = useCustomStyles(loadStyles);
Expand Down Expand Up @@ -99,7 +100,7 @@ export const DestinationPage = () => {
const map = () => <MapContainer shape={shape} />;

return (
<ScrollView>
<RScrollView>
{!isLoading && !isError && (
<View style={styles.container}>
<DestinationHeader
Expand All @@ -122,7 +123,7 @@ export const DestinationPage = () => {
<WeatherData geoJSON={currentDestination} />
</View>
)}
</ScrollView>
</RScrollView>
);
};

Expand Down
4 changes: 2 additions & 2 deletions packages/app/components/details/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Text } from 'react-native';
import { CustomCard } from '../card';
import { RStack } from '@packrat/ui';

interface DetailsComponent {
interface IDetailsComponent {
type: string;
data: any; // Need type for this
isLoading: boolean;
Expand All @@ -19,7 +19,7 @@ export const DetailsComponent = ({
error,
additionalComps,
link,
}: DetailsComponent) => {
}: IDetailsComponent) => {
const renderDetails = () => {
switch (type) {
case 'pack':
Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/feed/FeedCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export default function Card({
gap: 8,
}}
>
{user?._id === owner_id ? null : (
{user?._id !== owner_id && (
<TouchableOpacity onPress={handleAddToFavorite}>
<AntDesign
name="heart"
Expand Down
Loading
Loading