Skip to content

Commit

Permalink
Merge branch 'development' of https://github.com/andrew-bierman/PackRat
Browse files Browse the repository at this point in the history
… into server_types
  • Loading branch information
pinocchio-life-like committed Dec 28, 2024
2 parents 877f9dd + 3444ffd commit 51e6226
Show file tree
Hide file tree
Showing 33 changed files with 295 additions and 239 deletions.
1 change: 1 addition & 0 deletions packages/app/components/Avatar/Avatar.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from 'react';
import { RImage } from '@packrat/ui';
import { MaterialCommunityIcons } from '@expo/vector-icons';
export interface AvatarProps {
Expand Down
1 change: 1 addition & 0 deletions packages/app/components/DialogDemo/DialogDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from 'react';
import { MaterialCommunityIcons } from '@expo/vector-icons';
import {
Button as OriginalButton,
Expand Down
1 change: 1 addition & 0 deletions packages/app/components/MultistepForm/ProgressBar.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from 'react';
import useCustomStyles from 'app/hooks/useCustomStyles';
import { Svg, Line, Circle } from 'react-native-svg';
import { View } from 'react-native';
Expand Down
4 changes: 2 additions & 2 deletions packages/app/components/MultistepForm/Sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from 'react';
import useCustomStyles from 'app/hooks/useCustomStyles';
import { View, Text } from 'react-native';

interface SidebarProps {
data: { title?: string; subtext?: string }[];
data: Array<{ title?: string; subtext?: string }>;
currentStep: number;
}

Expand All @@ -15,7 +16,6 @@ export const Sidebar: React.FC<SidebarProps> = ({ data, currentStep }) => {

return (
<View style={styles.sidebar}>
{/* Display your data here */}
{displayData.map((currentData, index) => {
if (!currentData) return null;
const { title, subtext } = currentData;
Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/RPrimaryButton/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { styled, Button, ButtonProps } from 'tamagui';
import { styled, Button, type ButtonProps } from 'tamagui';

interface RPrimaryButtonProps extends ButtonProps {
label: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/RSecondaryButton/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { styled, Button, ButtonProps } from 'tamagui';
import { styled, Button, type ButtonProps } from 'tamagui';
import useTheme from 'app/hooks/useTheme';

interface RSecondaryButtonProps extends ButtonProps {
Expand Down
4 changes: 2 additions & 2 deletions packages/app/components/Redirect/Redirect.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useEffect } from 'react';
import { useRouter } from 'app/hooks/router';

type RedirectProps = {
interface RedirectProps {
to: string;
};
}

export const Redirect = ({ to }: RedirectProps) => {
const router = useRouter();
Expand Down
6 changes: 3 additions & 3 deletions packages/app/components/Suggestion/SuggestionDescription.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, useState } from 'react';
import React, { useEffect, useState } from 'react';
import { FlatList } from 'react-native';
import { AnimatePresence, Text, Theme, View, styled } from 'tamagui';

Expand All @@ -11,10 +11,10 @@ const List = styled(FlatList<Message>, {

const getMessages = (data: Message[]) => data;

type Message = {
interface Message {
role: 'user' | 'ai';
content: string;
};
}

const renderItem = ({
item: message,
Expand Down
17 changes: 11 additions & 6 deletions packages/app/components/Suggestion/SuggestionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface Category {
name: string;
}

interface Item {
interface SuggestionItem {
id: string;
name: string;
ownerId: string;
Expand All @@ -21,12 +21,12 @@ interface Item {
}

interface SuggestionListProps {
suggestion: { Items: Item[] } | null;
suggestion: { Items: SuggestionItem[] } | null;
onAddItem: (itemId: string) => void;
}

export function SuggestionList({ suggestion, onAddItem }: SuggestionListProps) {
const [itemsList, setItemsList] = useState<Item[]>([]);
const [itemsList, setItemsList] = useState<SuggestionItem[]>([]);
const { isDark } = useTheme();

useEffect(() => {
Expand All @@ -51,7 +51,7 @@ export function SuggestionList({ suggestion, onAddItem }: SuggestionListProps) {
style={{
minWidth: 300,
height: '100%',
overflow: 'auto',
overflow: 'scroll',
}}
>
{itemsList.map((item, i) => (
Expand All @@ -67,7 +67,12 @@ export function SuggestionList({ suggestion, onAddItem }: SuggestionListProps) {

SuggestionList.fileName = 'List';

function Item({ item, onAddItem }) {
interface ItemProps {
item: SuggestionItem;
onAddItem: (itemId: string) => void;
}

function Item({ item, onAddItem }: ItemProps) {
const { addPackItem, isLoading } = useAddPackItem();

const handleAddItem = (item) => {
Expand All @@ -89,7 +94,7 @@ function Item({ item, onAddItem }) {
style={{
borderRadius: 5,
flexDirection: 'row',
aligItems: 'center',
alignItems: 'center',
}}
>
<View style={{ flexDirection: 'column', justifyContent: 'center' }}>
Expand Down
4 changes: 2 additions & 2 deletions packages/app/components/carousel/ScrollButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import {
TouchableOpacity,
View,
StyleProp,
TextStyle,
type TextStyle,
type ViewStyle,
TouchableOpacityProps,
ViewStyle,
} from 'react-native';
import useCustomStyles from 'app/hooks/useCustomStyles';
import useTheme from 'app/hooks/useTheme';
Expand Down
4 changes: 2 additions & 2 deletions packages/app/components/carousel/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useRef, useState, ReactNode } from 'react';
import React, { useRef, useState, type ReactNode } from 'react';
import {
ScrollView,
Platform,
Dimensions,
NativeScrollEvent,
type NativeScrollEvent,
} from 'react-native';
import { RStack } from '@packrat/ui';
import ScrollButton from './ScrollButton';
Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/chat/ActionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Animated, {
withTiming,
FadeIn,
} from 'react-native-reanimated';
import { LucideIcon } from 'lucide-react-native';
import type { LucideIcon } from 'lucide-react-native';

const AnimatedPressable = Animated.createAnimatedComponent(Pressable);

Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/hero/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { RStack, RImage } from '@packrat/ui';
import { ImageSourcePropType, Platform, View } from 'react-native';
import { type ImageSourcePropType, Platform, View } from 'react-native';
import { theme } from '../../theme';
import { isObjectEmpty } from '../../utils/isObjectEmpty';
import useCustomStyles from 'app/hooks/useCustomStyles';
Expand Down
1 change: 1 addition & 0 deletions packages/app/components/inventory/Inventory.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from 'react';
import { View, Text, TouchableOpacity } from 'react-native';
// import { TableContainer } from '../Table';

Expand Down
98 changes: 49 additions & 49 deletions packages/app/components/landing_page/FAQS.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import useTheme from 'app/hooks/useTheme';
import useResponsive from 'app/hooks/useResponsive';
import { FaqList } from 'app/constants/FAQS';
import { MaterialCommunityIcons } from '@expo/vector-icons';
import { useState } from 'react';
import React, { useState } from 'react';

export const FAQS = () => {
const { currentTheme } = useTheme();
Expand All @@ -26,10 +26,10 @@ export const FAQS = () => {
<View style={styles.faqMainContainer}>
<View style={styles.faqFirstContainer}>
<RText style={styles.faqMainTitle}>Frequently Asked Questions</RText>
<View style={{width: '100%'}}>
<View style={{ width: '100%' }}>
{FaqList.map((faq, index) => {
return (
<View style={styles.faqBox}>
<View key={index} style={styles.faqBox}>
<View
onPress={() => toggleAnswer(index)}
style={styles.faqQuestion}
Expand Down Expand Up @@ -59,8 +59,8 @@ export const FAQS = () => {
src={PakRat_FAQS}
style={{
backgroundColor: 'transparent',
width: xs || sm || md ? 359 : 650,
height: xs || sm || md ? 250 : 541,
width: xs || sm || md ? 359 : 650,
height: xs || sm || md ? 250 : 541,
}}
alt="PackRat Frequently Asked Questions"
/>
Expand All @@ -69,47 +69,47 @@ export const FAQS = () => {
);
};

const loadStyles = (currentTheme, xs, sm, md) => StyleSheet.create({
faqMainContainer: {
flexDirection: xs || sm || md ? 'column' : 'row',
alignItems: 'center',
justifyContent: 'space-evenly',
gap: 10,
width: '100vw',
maxWidth: '100vw',
paddingTop: 20,
paddingBottom: 20,
},
faqFirstContainer: {
alignItems: 'center',
},
faqBox: {
width: xs || sm || md ? '100%' : '24vw',
},
faqMainTitle: {
fontSize: xs || sm || md ? 20 : 26,
textAlign : xs || sm || md ? 'center' : 'auto',
fontWeight: 'bold',
color: currentTheme.colors.textPrimary,
marginBottom: 30,
},
faqQuestion: {
borderBottomWidth: 1,
borderBottomColor: currentTheme.colors.textPrimary,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
marginTop: 4,
marginBottom: 4,
marginLeft: xs || sm || md ? 10 : 0,
marginRight: xs || sm || md ? 10 : 0,
gap: xs || sm || md ? 2 : 10,
},
faqAnswer: {
marginLeft: 0,
width: xs || sm || md ? '100%' : '24vw',
marginLeft: xs || sm || md ? 10 : 0,
marginRight: xs || sm || md ? 10 : 0,
},
faqSecondContainer: {},
});
const loadStyles = (currentTheme, xs, sm, md) =>
StyleSheet.create({
faqMainContainer: {
flexDirection: xs || sm || md ? 'column' : 'row',
alignItems: 'center',
justifyContent: 'space-evenly',
gap: 10,
width: '100vw',
maxWidth: '100vw',
paddingTop: 20,
paddingBottom: 20,
},
faqFirstContainer: {
alignItems: 'center',
},
faqBox: {
width: xs || sm || md ? '100%' : '24vw',
},
faqMainTitle: {
fontSize: xs || sm || md ? 20 : 26,
textAlign: xs || sm || md ? 'center' : 'auto',
fontWeight: 'bold',
color: currentTheme.colors.textPrimary,
marginBottom: 30,
},
faqQuestion: {
borderBottomWidth: 1,
borderBottomColor: currentTheme.colors.textPrimary,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
marginTop: 4,
marginBottom: 4,
marginLeft: xs || sm || md ? 10 : 0,
marginRight: xs || sm || md ? 10 : 0,
gap: xs || sm || md ? 2 : 10,
},
faqAnswer: {
width: xs || sm || md ? '100%' : '24vw',
marginLeft: xs || sm || md ? 10 : 0,
marginRight: xs || sm || md ? 10 : 0,
},
faqSecondContainer: {},
});
Loading

0 comments on commit 51e6226

Please sign in to comment.