Skip to content

Commit

Permalink
🎨 linting
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-bierman committed May 17, 2024
1 parent 8c416bc commit b762872
Show file tree
Hide file tree
Showing 36 changed files with 57 additions and 96 deletions.
4 changes: 1 addition & 3 deletions packages/app/api/getGeoCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ export const getGeoCode = async (addressArray: string[]): Promise<any> => {
.then((result) => {
resultReturn = result;
})
.catch((error) => {

});
.catch((error) => {});

return resultReturn;
};
1 change: 0 additions & 1 deletion packages/app/api/getTrails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export const getTrailsRapid = async (

return trailsArray;
} catch (error) {

console.error('error:' + error);
return [];
}
Expand Down
6 changes: 5 additions & 1 deletion packages/app/auth/hooks/useGoogleAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import * as Google from 'expo-auth-session/providers/google';

import { queryTrpc } from 'app/trpc';
import { useSessionSignIn } from './useSessionSignIn';
import { WEB_CLIENT_ID, IOS_CLIENT_ID, ANDROID_CLIENT_ID } from '@packrat/config';
import {
WEB_CLIENT_ID,
IOS_CLIENT_ID,
ANDROID_CLIENT_ID,
} from '@packrat/config';

const webClientId = String(WEB_CLIENT_ID);
const iosClientId = String(IOS_CLIENT_ID);
Expand Down
6 changes: 3 additions & 3 deletions packages/app/auth/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
// const firebaseUser = userCredential.user;
// setAuth(firebaseUser);
// } catch (error) {
//
//
// }
// };

Expand All @@ -95,7 +95,7 @@
// const firebaseUser = userCredential.user;
// setAuth(firebaseUser);
// } catch (error) {
//
//
// }
// };

Expand All @@ -106,7 +106,7 @@
// const signUpWithEmailPasswordProvider = async (email, password) => {
// try {
// const newUser = await createUserWithEmailAndPassword(email, password);
//
//

// } catch (e) {
// console.log("Error", e)
Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// width,
// style,
// }) => {
// //
// //

// const items =
// data?.map((item, index) => {
Expand Down
1 change: 0 additions & 1 deletion packages/app/components/card/CustomCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export const CustomCard = ({
if (!data) return null;

const isWeb = Platform.OS === 'web';


return (
<View
Expand Down
5 changes: 4 additions & 1 deletion packages/app/components/card/CustomCardHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ export const CustomCardHeader = ({ data, title, link, actionsComponent }) => {
{typeof title === 'string' ? <RText>{title}</RText> : title}
</RStack>
<View>
<RLink href={`/profile/${data.owner_id.id || data.owner_id}`} style={{ textDecoration: 'none' }}>
<RLink
href={`/profile/${data.owner_id.id || data.owner_id}`}
style={{ textDecoration: 'none' }}
>
<RText>
{user?.id === data.owner_id
? 'Your Profile'
Expand Down
1 change: 0 additions & 1 deletion packages/app/components/map/MapButtonsOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const MapButtonsOverlay = ({
progress,
navigateToMaps,
}: MapButtonsOverlayProps) => {

const [showStyleOptions, setShowStyleOptions] = useState(false);
const { enableDarkMode, enableLightMode, isDark, isLight, currentTheme } =
useTheme();
Expand Down
2 changes: 0 additions & 2 deletions packages/app/components/map/NativeMap.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ function NativeMap({ shape: shapeProp }) {

const pointLatLong = shape?.features[0]?.geometry?.coordinates;
const openMaps = (latLong) => {

const scheme = Platform.select({
ios: 'maps://0,0?q=',
android: 'geo:0,0?q=',
Expand Down Expand Up @@ -149,7 +148,6 @@ function NativeMap({ shape: shapeProp }) {
id="destination"
coordinate={pointLatLong}
onSelected={() => {

openMaps(pointLatLong);
}}
>
Expand Down
3 changes: 1 addition & 2 deletions packages/app/components/map/useGpxUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ mapboxgl.accessToken = MAPBOX_ACCESS_TOKEN;

const useGpxUpload = (setShape) => {
const handleGpxUpload = async () => {

try {
const result = await DocumentPicker.getDocumentAsync({
type: 'application/gpx+xml',
});

if (result.type === 'success') {
const base64Gpx = result.uri.split(',')[1];
const gpxString = atob(base64Gpx);
Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/pack_table/packtable.style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Platform } from 'react-native';
const isWeb = Platform.OS === 'web';
const loadStyles = (theme) => {
const { currentTheme } = theme;

return {
container: {
flex: 1,
Expand Down
1 change: 0 additions & 1 deletion packages/app/components/weather/WeatherCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ export default function WeatherCard({
style={styles.card}
>
{restOfWeek.map((day, index) => {

return (
<RStack key={index} style={styles.weatherInfo}>
<RText style={{ color: styles.tempColor.color }}>{day}</RText>
Expand Down
2 changes: 1 addition & 1 deletion packages/app/constants/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import { API_URL } from '@packrat/config';
* The api url.
* format: "{scheme}://{serverhost}:{port}/api"
* e.g: "http://localhost:4200/api"
*/
*/
export const api = API_URL;
2 changes: 0 additions & 2 deletions packages/app/context/Auth/SessionProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ export function useSession() {
export function SessionProvider(props) {
const [[isLoading, session], setSession] = useStorageState('session');



return (
<AuthContext.Provider
value={{
Expand Down
2 changes: 0 additions & 2 deletions packages/app/context/theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ export const ThemeProvider = ({ children }) => {
* @return {undefined} No return value.
*/
const enableDarkMode = () => {

dispatch({ type: 'ENABLE_DARK_MODE' });
};
/**
Expand All @@ -75,7 +74,6 @@ export const ThemeProvider = ({ children }) => {
* @return {void} - This function does not return any value.
*/
const enableLightMode = () => {

dispatch({ type: 'ENABLE_LIGHT_MODE' });
};

Expand Down
4 changes: 2 additions & 2 deletions packages/app/hooks/chat/useChat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const useChat = (itemTypeId = null) => {
// );

// useEffect(() => {
//
//
// setParsedMessages(
// conversation ? parseConversationHistory(conversation.history) : [],
// );
Expand All @@ -60,7 +60,7 @@ export const useChat = (itemTypeId = null) => {
? parseConversationHistory(conversations)
: [];

//
//

/**
* Handles sending a message.
Expand Down
4 changes: 2 additions & 2 deletions packages/app/hooks/chat/useGetAIResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export function useGetAIResponse() {
// };
// },
// onError: (err, { userId, conversationId, userInput }, context) => {
//
//
//
//
// if (context.previousConversation) {
// queryTrpc.getConversationById.setData(
// { conversationId },
Expand Down
8 changes: 2 additions & 6 deletions packages/app/hooks/common/useCopyClipboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,13 @@ export const useCopyClipboard = (link: string) => {
if (Platform.OS === 'web') {
navigator.clipboard
.writeText(copyLink)
.then(() => {

})
.then(() => {})
.catch((err) => {
console.error('Failed to copy text to clipboard', err);
});
} else {
Clipboard.setStringAsync(copyLink)
.then(() => {

})
.then(() => {})
.catch((err) => {
console.error('Failed to copy text to clipboard', err);
});
Expand Down
3 changes: 1 addition & 2 deletions packages/app/hooks/common/useValidateSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ export const useValidateSchema = (
typeof formatBeforeValidate === 'function'
? formatBeforeValidate(values)
: values;

await ValidationSchema.parseAsync(finalValues);
setIsValid(true);
} catch (e) {

setIsValid(false);
} finally {
setIsValidating(false);
Expand Down
1 change: 0 additions & 1 deletion packages/app/hooks/favorites/useAddFavorite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export function useAddFavorite() {

// A wrapper function to abstract away the .mutate call
const addFavorite = (newFavorite) => {

mutation.mutate(newFavorite, {
onSuccess: () => {
// Invalidate and refetch. Update to be more specific
Expand Down
6 changes: 2 additions & 4 deletions packages/app/hooks/map/useNativeMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export const useNativeMap = ({ shape: shapeProp }) => {
// console.log("🚀 ~ file: NativeMap.native.js:99 ~ NativeMap ~ bounds:", bounds)
bounds = bounds[0].concat(bounds[1]);
const zoomLevel = calculateZoomLevel(bounds, { width: dw, height: 360 });
//
//
//
//

// effects
useEffect(() => {
Expand Down Expand Up @@ -93,7 +93,6 @@ export const useNativeMap = ({ shape: shapeProp }) => {
* @param {Event} event - The press event object.
*/
function onMapPress(event) {

// if (trailCenterPoint) {
// mapViewFullScreenRef?.current.setCamera({
// centerCoordinate: trailCenterPoint,
Expand All @@ -109,7 +108,6 @@ export const useNativeMap = ({ shape: shapeProp }) => {
* @returns {void}
*/
function onDownloadProgress(offlineRegion, offlineRegionStatus) {

setProgress(offlineRegionStatus.percentage);
setDownloading(true);
if (offlineRegionStatus.percentage == 100) {
Expand Down
1 change: 0 additions & 1 deletion packages/app/hooks/packs/useAddNewPack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export const useAddNewPack = () => {
};
},
onError: (_error, _pack, context) => {

utils.getPacks.setData(
{
ownerId: _pack.owner_id,
Expand Down
7 changes: 2 additions & 5 deletions packages/app/hooks/packs/useAddPackItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ export const useAddPackItem = () => {
const previousPack = utils.getPackById.getData({
packId: newItem.packId,
});



const newQueryData = {
...previousPack,
items: [
Expand All @@ -31,15 +30,13 @@ export const useAddPackItem = () => {
},
],
};

utils.getPackById.setData({ packId: newItem.packId }, newQueryData);
return {
previousPack,
};
},
onError: (err, newItem, context) => {


// if (context.previousPack) {
// utils.getPackById.setData(
// { packId: newItem.packId },
Expand Down
2 changes: 0 additions & 2 deletions packages/app/hooks/packs/useDeletePackItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ export const useDeletePackItem = () => {
// };
},
onError: (err, deleteItem, context) => {


// if (context.previousPack) {
// utils.getPackById.setData(
// { packId: deleteItem.packId },
Expand Down
3 changes: 0 additions & 3 deletions packages/app/hooks/packs/useEditPackItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ export const useEditPackItem = (isItemPage) => {
};
},
onError: (err, editedItem, context) => {



// if (context.previousPack) {
// // Restore the previous pack data in case of an error
// utils.getPackById.setData(
Expand Down
4 changes: 1 addition & 3 deletions packages/app/hooks/password-reset/usePasswordResetForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ export const usePasswordResetForm = () => {
try {
await resetPassword({ password, resetToken });
setIsPasswordUpdated(true);
} catch (error) {

}
} catch (error) {}
};

return {
Expand Down
2 changes: 0 additions & 2 deletions packages/app/hooks/trails/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ function useTrails({ latLng, selectedSearch, radius = 1000 }) {
},
);



// React.useEffect(() => {
let filteredTrails = [];
if (data) {
Expand Down
5 changes: 0 additions & 5 deletions packages/app/hooks/useMatchesCurrentUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@ import { useAuthUser } from 'app/auth/hooks';
export const useMatchesCurrentUser = (ownerId: string): boolean => {
const currentUser = useAuthUser();


const currentUserId = currentUser?.id;





return currentUserId === ownerId; // Note: I adjusted `id` to `id` based on your other code
};
1 change: 0 additions & 1 deletion packages/app/screens/about/AboutContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const AboutContent = ({ desktopContainer, isMobile }: AboutContentProps) => {
useTheme();

const styles = useCustomStyles(loadStyles);


const { handleGithubLink, handleDiscordLink, aboutSections } = useAbout();

Expand Down
2 changes: 0 additions & 2 deletions packages/app/screens/maps/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ export default function DownloadedMaps() {
padding: 20,
}}
onPress={() => {


setPack(pack);
setShowMap(true);
}}
Expand Down
Loading

0 comments on commit b762872

Please sign in to comment.