-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #593 from andrew-bierman/dev
Dev to main
- Loading branch information
Showing
459 changed files
with
6,710 additions
and
4,142 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
2 changes: 1 addition & 1 deletion
2
client/app/(app)/about/index.tsx → apps/expo/app/(app)/about/index.tsx
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
2 changes: 1 addition & 1 deletion
2
client/app/(app)/appearance/index.tsx → apps/expo/app/(app)/appearance/index.tsx
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
2 changes: 1 addition & 1 deletion
2
...app/(app)/destination/[destinationId].tsx → ...app/(app)/destination/[destinationId].tsx
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
2 changes: 1 addition & 1 deletion
2
client/app/(app)/feed/index.tsx → apps/expo/app/(app)/feed/index.tsx
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 |
---|---|---|
@@ -0,0 +1,123 @@ | ||
import { View } from 'react-native'; | ||
import React, { useEffect, useState } from 'react'; | ||
import { StyleSheet, Platform } from 'react-native'; | ||
import { MaterialIcons } from '@expo/vector-icons'; | ||
import { theme } from 'app/theme'; | ||
import useTheme from 'app/hooks/useTheme'; | ||
import { RTooltip, RButton, RScrollView, BaseModal } from '@packrat/ui'; | ||
import { AddItemGlobal } from 'app/components/item/AddItemGlobal'; | ||
import { ItemsTable } from 'app/components/itemtable/itemTable'; | ||
import { useDispatch, useSelector } from 'react-redux'; | ||
import { getItemsGlobal } from 'app/store/globalItemsStore'; | ||
import { Stack } from 'expo-router'; | ||
import Head from 'expo-router/head'; | ||
import { useFetchGlobalItems } from 'app/hooks/globalItems'; | ||
import useCustomStyles from 'app/hooks/useCustomStyles'; | ||
|
||
export default function Items() { | ||
// pagination index limit | ||
const [limit, setLimit] = useState(5); | ||
// page number for pagination | ||
const [page, setPage] = useState(1); | ||
|
||
const [refetch, setRefetch] = useState(false); | ||
|
||
const { data, isLoading, isError } = useFetchGlobalItems(limit, page); | ||
return ( | ||
<RScrollView> | ||
{Platform.OS === 'web' && ( | ||
<Head> | ||
<title>Items</title> | ||
</Head> | ||
)} | ||
<Stack.Screen | ||
options={{ | ||
title: 'Items', | ||
name: 'Items', | ||
}} | ||
/> | ||
<View> | ||
<> | ||
<BaseModal | ||
title="Add a global Item" | ||
trigger="Add Item" | ||
triggerComponent={<ModalTriggerButton />} | ||
> | ||
<AddItemGlobal setRefetch={setRefetch} refetch={refetch} /> | ||
</BaseModal> | ||
</> | ||
{!isError && | ||
data?.globalItems && | ||
Array.isArray(data?.globalItems?.items) ? ( | ||
<ItemsTable | ||
limit={limit} | ||
setLimit={setLimit} | ||
page={page} | ||
setPage={setPage} | ||
data={data} | ||
isLoading={isLoading} | ||
totalPages={data?.globalItems?.totalPages ?? 0} | ||
refetch={refetch} | ||
setRefetch={setRefetch} | ||
/> | ||
) : null} | ||
</View> | ||
</RScrollView> | ||
); | ||
} | ||
const loadStyles = () => { | ||
const currentTheme = theme; | ||
return { | ||
container: { | ||
display: 'flex', | ||
justifyContent: 'center', | ||
marginTop: '1rem', | ||
alignItems: 'center', | ||
}, | ||
button: { | ||
backgroundColor: currentTheme.colors.background, | ||
color: currentTheme.colors.white, | ||
width: Platform.OS === 'web' ? '20rem' : '20%', | ||
alignItems: 'center', | ||
textAlign: 'center', | ||
}, | ||
}; | ||
}; | ||
|
||
const ModalTriggerButton = ({ setIsModalOpen }) => { | ||
const styles = useCustomStyles(loadStyles); | ||
const { currentTheme } = useTheme(); | ||
|
||
return ( | ||
<View | ||
style={{ | ||
display: 'flex', | ||
flexDirection: 'row', | ||
marginTop: '2rem', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
}} | ||
> | ||
<RButton | ||
style={styles.button} | ||
onPress={() => { | ||
setIsModalOpen(true); | ||
}} | ||
> | ||
Add Item | ||
</RButton> | ||
{Platform.OS === 'web' ? ( | ||
<RTooltip | ||
Label="Add a global item" | ||
Icon={ | ||
<MaterialIcons | ||
name="info-outline" | ||
size={24} | ||
color={currentTheme.colors.background} | ||
/> | ||
} | ||
/> | ||
) : null} | ||
</View> | ||
); | ||
}; |
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
6 changes: 3 additions & 3 deletions
6
client/app/(app)/pack/[packId].tsx → apps/expo/app/(app)/pack/[packId].tsx
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
2 changes: 1 addition & 1 deletion
2
client/app/(app)/pack/create.tsx → apps/expo/app/(app)/pack/create.tsx
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
2 changes: 1 addition & 1 deletion
2
client/app/(app)/packs/index.tsx → apps/expo/app/(app)/packs/index.tsx
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
7 changes: 2 additions & 5 deletions
7
client/app/(app)/password-reset/index.tsx → apps/expo/app/(app)/password-reset/index.tsx
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
2 changes: 1 addition & 1 deletion
2
client/app/(app)/profile/[id].tsx → apps/expo/app/(app)/profile/[id].tsx
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
2 changes: 1 addition & 1 deletion
2
client/app/(app)/profile/index.tsx → apps/expo/app/(app)/profile/index.tsx
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
2 changes: 1 addition & 1 deletion
2
client/app/(app)/profile/settings/index.tsx → ...expo/app/(app)/profile/settings/index.tsx
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
6 changes: 3 additions & 3 deletions
6
client/app/(app)/trip/[tripId].tsx → apps/expo/app/(app)/trip/[tripId].tsx
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
2 changes: 1 addition & 1 deletion
2
client/app/(app)/trip/create.tsx → apps/expo/app/(app)/trip/create.tsx
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
2 changes: 1 addition & 1 deletion
2
client/app/(app)/trips/index.tsx → apps/expo/app/(app)/trips/index.tsx
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
2 changes: 1 addition & 1 deletion
2
client/app/(auth)/_layout.tsx → apps/expo/app/(auth)/_layout.tsx
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
Oops, something went wrong.