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

Login signup UI swapped #1006

Open
wants to merge 25 commits into
base: andrew_testing
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e037457
Progress in Trip Creation PAge
MuhammadHassan03 Apr 28, 2024
755c937
Merge branch 'andrew_testing' of https://github.com/MuhammadHassan03/…
MuhammadHassan03 Apr 28, 2024
518123e
View Owner in Trip Page Fixed
MuhammadHassan03 Apr 28, 2024
46af0fe
Merge branch 'andrew-bierman:andrew_testing' into andrew_testing
MuhammadHassan03 May 1, 2024
d5df4c0
Fix: Zeego Menu Fix in Trips Creation Page
MuhammadHassan03 May 1, 2024
8be5cfa
Merge branch 'andrew_testing' of https://github.com/MuhammadHassan03/…
MuhammadHassan03 May 1, 2024
3dd6129
Merge branch 'andrew_testing' into andrew_testing
MuhammadHassan03 May 2, 2024
368e05c
Merge branch 'andrew-bierman:andrew_testing' into andrew_testing
MuhammadHassan03 May 3, 2024
baef540
Merge branch 'andrew-bierman:andrew_testing' into andrew_testing
MuhammadHassan03 May 7, 2024
43d58fc
Progress in Map Preview Bug
MuhammadHassan03 May 11, 2024
e3a6a7e
Scroll Fix in Create Trip Page
MuhammadHassan03 May 15, 2024
5faa34c
PR Clean Up
MuhammadHassan03 May 15, 2024
70350c4
PR Clean Up
MuhammadHassan03 May 16, 2024
ecbb611
Fixed Map Preview
MuhammadHassan03 May 17, 2024
d618fdd
PR Clean Up
MuhammadHassan03 May 17, 2024
b517a12
Merge remote-tracking branch 'upstream/andrew_testing' into andrew_te…
MuhammadHassan03 May 25, 2024
bd24b43
Implemented Bento UI Table
MuhammadHassan03 May 26, 2024
718bfde
Table Swapping with Bento UI Table
MuhammadHassan03 May 29, 2024
6426c59
Edit and Delete UI Update
MuhammadHassan03 May 29, 2024
1311e44
Table UI Update
MuhammadHassan03 May 31, 2024
80e797a
Refactored Table Look + applied refetch logic
MuhammadHassan03 Jun 5, 2024
5ef2038
Login Register UI Update
MuhammadHassan03 Jun 7, 2024
c6b95ac
Login and Signup UI Refactored
MuhammadHassan03 Jun 8, 2024
3385ebf
Width Fix in the Login Signup UI
MuhammadHassan03 Jun 10, 2024
0601ccc
Merge branch 'andrew_testing' into login-signup-ui-swapped
MuhammadHassan03 Jun 14, 2024
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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
"patch-package": "^8.0.0",
"postinstall-postinstall": "^2.1.0",
"prettier": "^3.2.5",
"simplify-geojson": "^1.0.5",
"typescript": "^5.3.3"
},
"lint-staged": {
Expand Down
19 changes: 9 additions & 10 deletions packages/app/components/feed/FeedCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,16 +244,15 @@ export default function Card({
}}
>
<RLink
href={`/profile/${
type === 'pack' ? owner_id : owner_id
}`}
style={{ textDecoration: 'none' }}
>
<RText color={currentTheme.colors.textColor}>
View{' '}
{owner?.username ? '@' + owner?.username : 'Owner'}
</RText>
</RLink>
href={`/profile/${
type === 'pack' ? owner?.id : owner_id
}`}
style={{ textDecoration: 'none' }}
>
<RText color={currentTheme.colors.textColor}>
View {owner?.username ? '@' + owner?.username : 'Owner'}
</RText>
</RLink>
<View
style={{
flexDirection: 'row',
Expand Down
4 changes: 2 additions & 2 deletions packages/app/components/map/MapButtonsOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const MapButtonsOverlay = ({
<Entypo name="resize-full-screen" size={21} color="grey" />
</TouchableOpacity>

<TouchableOpacity
{/* <TouchableOpacity
style={[
styles.headerBtnView,
{
Expand All @@ -91,7 +91,7 @@ const MapButtonsOverlay = ({
onPress={navigateToMaps}
>
<FontAwesome5 name="directions" size={21} color="grey" />
</TouchableOpacity>
</TouchableOpacity> */}
</>
) : (
// Fullscreen map
Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/map/MapContainer.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';

import { View, Platform } from 'react-native';

import WebMap from './WebMap';
import WebMap from './WebMap.web';
import { isObjectEmpty } from '../../utils/isObjectEmpty';
import { defaultShape } from '../../utils/mapFunctions';
import useCustomStyles from 'app/hooks/useCustomStyles';
Expand Down
9 changes: 6 additions & 3 deletions packages/app/components/map/useMapPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
} from '../../utils/mapFunctions';
import { api } from '../../constants/api';
import { useState, useEffect } from 'react';
import simplify from 'simplify-geojson';

interface Feature {
[key: string]: any;
Expand Down Expand Up @@ -76,11 +77,13 @@ const useMapPreviewData = (shape, processedShape) => {
imageShape.features.push(feature);
}
});



const urlEncodedImageShapeGeoJSON = encodeURIComponent(
JSON.stringify(imageShape, null, 0),
);


let bounds = getShapeSourceBounds(shape);
if (Array.isArray(bounds[0]) && Array.isArray(bounds[1])) {
bounds = [bounds[0].concat(bounds[1])];
Expand All @@ -97,8 +100,8 @@ const useMapPreviewData = (shape, processedShape) => {
uri: isPoint(shape)
? `${mapPreviewEndpoint}/pin-s+db4848(${lng},${lat})/${lng},${lat},8.63,0/900x400`
: `${mapPreviewEndpoint}/geojson(${urlEncodedImageShapeGeoJSON})/[${bounds.join(
',',
)}]/900x400?padding=50,30,30,30`,
',',
)}]/900x400?padding=50,30,30,30`,
};

setMapPreviewData(data);
Expand Down
3 changes: 2 additions & 1 deletion packages/app/components/pack_table/EditPackItemModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ export const EditPackItemModal: React.FC<EditPackItemModalProps> = ({
: null;

return (

<BaseModal
title={'Edit Item'}
isOpen={isOpen}
onClose={onClose}
footerComponent={undefined}
footerButtons={footerButtons}
triggerComponent={triggerComponent}
showTrigger={showTrigger !== undefined ? showTrigger : true}
showTrigger={!!triggerComponent}
>
{ModalContent && <ModalContent />}
</BaseModal>
Expand Down
1 change: 1 addition & 0 deletions packages/app/components/pack_table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const TableContainer = ({
setRefetch,
copy,
});

const headerRow = ['Item Name', 'Weight', 'Quantity', ''];
let flexArr = [2, 1, 1, 1];
const { deletePackItem } = useDeletePackItem();
Expand Down
3 changes: 3 additions & 0 deletions packages/app/components/pack_table/TableItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,12 @@ const TableItem = ({

let rowData = [
<RText px={8}>{name}</RText>,

<RText px={0}>{${formatNumber(weight)} ${unit}}</RText>,
<RText px={0}>{quantity}</RText>,
];
if (hasPermissions) {

if (
Platform.OS === 'android' ||
Platform.OS === 'ios' ||
Expand Down Expand Up @@ -106,6 +108,7 @@ const TableItem = ({
isOpen={activeModal === 'delete'}
onClose={closeModal}
/>
,
<Row data={rowData} style={styles.row} flexArr={flexArr} />
</>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/trip/TripCards/TripMapCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RStack, RText } from '@packrat/ui';
import MapContainer from 'app/components/map/MapContainer';
import MapContainer from 'app/components/map/MapContainer.web';
import useTheme from 'app/hooks/useTheme';
import { TripCardBase } from './TripCardBase';
import { FontAwesome5 } from '@expo/vector-icons';
Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/trip/TripCards/TripPlaceCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const TripPlaceCard = ({
return (
<TripCardBase icon={icon} title={title}>
<RStack style={{ width: '80%' }}>
<Carousel iconColor={isDark ? '#fff' : '#000'}>
<Carousel itemWidth={'5'} iconColor={isDark ? '#fff' : '#000'}>
{data?.map((item) => {
return (
<RCard
Expand Down
2 changes: 1 addition & 1 deletion packages/app/hooks/destination/useCurrentDestination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ export const useCurrentDestination = () => {

return parseCoordinates(currentDestination);
}, [currentDestination]);

return { currentDestination, latLng, isError, isLoading };
};
2 changes: 1 addition & 1 deletion packages/app/hooks/trails/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function useTrails({ latLng, selectedSearch, radius = 1000 }) {
// lon,
// radius,
// selectedSearch,
// }); // Assumed to be a valid hook from tRPC.
// }); //Assumed to be a valid hook from tRPC.
const { lat, lon } = latLng;
const isEnabled = Boolean(lat && lon);
// SWAP FOR TRPC react query
Expand Down
140 changes: 3 additions & 137 deletions packages/app/screens/LoginScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { NODE_ENV } from '@packrat/config';
import useTheme from '../hooks/useTheme';
import { useGoogleAuth, useLogin } from 'app/auth/hooks';
import { userSignIn as userSignInSchema } from '@packrat/validations';
import { SignInScreen } from '@packrat/ui/src/Bento/forms/layouts';

const RText: any = OriginalRText;
const RHeading: any = OriginalRHeading;
Expand Down Expand Up @@ -52,145 +53,10 @@ export default function Login() {
paddingTop: 32,
paddingBottom: 32,
width: '90%',
maxWidth: 290,
maxWidth: 400,
}}
>
<RHeading
fontSize={32}
color={
currentTheme.colors.background === '#0284c7'
? currentTheme.colors.black
: 'white'
}
fontWeight="semibold"
>
Welcome
</RHeading>
<RHeading
color="grey"
fontWeight="medium"
fontSize={14}
style={{ marginTop: 8 }}
>
Sign in to continue!
</RHeading>

<Form
validationSchema={userSignInSchema}
style={{ marginTop: 16, gap: 8 }}
>
<FormInput
label="Email ID"
keyboardType="email-address"
name="email"
/>
<FormInput label="Password" secureTextEntry name="password" />

<SubmitButton
style={{ marginTop: 16, backgroundColor: 'mediumpurple' }}
onSubmit={handleLogin}
>
Sign in
</SubmitButton>
</Form>
<RStack
style={{
marginTop: 16,
flexDirection: 'row',
justifyContent: 'center',
gap: 4,
}}
>
<RText fontSize={14} color="grey">
I'm a new user.
</RText>
<RLink href="/register">
<RText
style={{
color: '#818cf8',
fontWeight: 400,
fontSize: 12,
}}
>
Sign Up
</RText>
</RLink>
</RStack>

<RStack style={{ flexDirection: 'row', justifyContent: 'center' }}>
<RLink href="/password-reset">
<RText
style={{
color: '#818cf8',
fontWeight: 400,
fontSize: 12,
}}
>
Reset Password?
</RText>
</RLink>
</RStack>
{/* Google Login starts */}
<RStack
style={{
marginTop: 8,
flexDirection: 'row',
justifyContent: 'center',
}}
>
<RText color="grey" fontWeight="medium" fontSize={14}>
Or
</RText>
</RStack>

{/* Google Login */}
{enableGoogleLogin && (
<RStack
style={{
marginTop: 8,
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'center',
}}
>
<RIconButton
disabled={!isGoogleSignInReady}
onPress={async () => await promptAsync()}
backgroundColor="red"
style={{ width: '100%', color: 'white' }}
icon={
<FontAwesome
name="google"
size={16}
color={currentTheme.colors.white}
/>
}
>
Sign in with Google
</RIconButton>
</RStack>
)}

{/* Demo Login for Development start */}
{NODE_ENV !== 'production' && (
<RStack
style={{
marginTop: 8,
justifyContent: 'center',
alignItems: 'center',
}}
>
<RButton
style={{ width: '100%' }}
disabled={!isGoogleSignInReady}
onPress={() => handleLogin(demoUser)}
backgroundColor="purple"
>
Demo User
</RButton>
</RStack>
)}
{/* Demo Login for Development end */}
<SignInScreen mode="signin"/>
</View>
</RStack>
</RStack>
Expand Down
Loading
Loading