Skip to content

Commit b75102c

Browse files
committed
made changes
1 parent 6ea9070 commit b75102c

File tree

10 files changed

+31
-27
lines changed

10 files changed

+31
-27
lines changed

app/login/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export default function Login() {
99
const router = useRouter();
1010
const [user, setUser] = useState()
1111
const [userNo, setUserNo] = useState(0);
12+
const [userId, setUserId] = useState();
1213
const [profileIcon, setProfileIcon] = useState(false)
1314
const [details, setDetails] = useState({
1415
name: "",
@@ -23,6 +24,7 @@ export default function Login() {
2324
.then((res: any) => {
2425
getAccount(res)
2526
setUser(res)
27+
setUserId(res.$id)
2628
})
2729
.catch((err) => console.log(err));
2830
}
@@ -61,7 +63,7 @@ export default function Login() {
6163
<div className='flex h-screen w-screen justify-center items-center bg-[#f3fbfb] text-[#272343] pt-[60px]'>
6264
<div className='h-full pt-[30px] w-fit m-auto'>
6365
{user ?
64-
<></>
66+
<>{router.push(`/profile/${userId}`)}</>
6567
:
6668
<LogInMain {...{
6769
details,

app/profile/[id]/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ const Profile = () => {
4545
}
4646
},[profileUser])
4747

48+
console.log(profileUser)
49+
4850
return (
4951
<>
5052
{profileDetails.userId != "" &&
@@ -53,7 +55,7 @@ const Profile = () => {
5355
<div className='flex w-screen h-screen overflow-hidden'>
5456
<div className='flex flex-col h-screen w-full pt-[60px]'>
5557
<Navbar profileIcon={profileIcon} />
56-
<ProfileForm />
58+
<ProfileForm user={user} setProfileUser={setProfileUser} />
5759
</div>
5860
</div>
5961
:

app/signup/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ export default function SignUp() {
4141
AccountAPI.emailSignUp(details)
4242
.then((res: any) => {
4343
handleSigning(res)
44-
localStorage.setItem("userId",res.$id)
45-
router.push(`/profile/${res.$id}`)
4644
}).catch((err: any) => console.log(err))
4745
}
4846

@@ -55,6 +53,7 @@ export default function SignUp() {
5553
}))
5654
localStorage.setItem("userId",res.$id)
5755
localStorage.setItem("type",res.type)
56+
router.push(`/profile/${res.$id}`)
5857
}).catch((err: any) => console.log(err))
5958
}
6059

components/Connections/ConnectionCard.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { AccountAPI } from "@/lib/accountapi"
22
import Template1 from "@/lib/templates/template1"
3+
import { useRouter } from "next/navigation"
34
import { useEffect, useState } from "react"
45

56
const ConnectionCard = ({cardId}: any) => {
6-
console.log(cardId)
7-
const themeStyle = "absolute -top-[44px] -left-[73px] w-[475px] h-[282px] bg-gradient-to-r from-[#7F7FD5] to-[#91EAE4] rounded-xl scale-[0.7] z-20 hover:cursor-pointer";
7+
const router = useRouter()
8+
const themeStyle = "absolute -top-[44px] -left-[73px] w-[475px] h-[282px] bg-gradient-to-r from-[#7F7FD5] to-[#91EAE4] rounded-xl scale-[0.7] z-20";
89
const [userDetails, setUserDetails] = useState({
910
name: "",
1011
email: "",
@@ -20,9 +21,6 @@ const ConnectionCard = ({cardId}: any) => {
2021
socials: [],
2122
})
2223

23-
const getDetails = () => {
24-
}
25-
2624
useEffect(() => {
2725
AccountAPI.getUserCardDocument(cardId).then((res: any) => {
2826
console.log(res, "user")
@@ -60,7 +58,9 @@ const ConnectionCard = ({cardId}: any) => {
6058
<div
6159
className="h-[225px] w-[375px] m-auto flex flex-col justify-center items-center max-[470px]:scale-[0.87] max-[400px]:scale-[0.85] max-[470px]:m-0"
6260
>
63-
<div className="relative w-[333px] h-[198px] rounded-lg">
61+
<div
62+
onClick={() => router.push(`/card/${cardId}`)}
63+
className="relative w-[333px] h-[198px] rounded-lg hover:cursor-pointer">
6464
{userDetails.name != "" && <div
6565
className={themeStyle}
6666
><Template1 {...{

components/LandingPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ const LandingPage = () => {
2525
/></div>
2626

2727
<div className='absolute bottom-0 m-[10px] mb-[70px] flex flex-col gap-[25px] justify-center items-center max-[550px]:mb-[100px]'>
28-
<h1 className="text-6xl font-semibold text-center">
28+
<h1 className="text-9xl font-semibold text-center">
2929
Bizzygram
3030
</h1>
3131

32-
<h3 className="text-2xl text-center">
32+
<h3 className="text-3xl text-center">
3333
Connect with a Tap,
3434
<br />
3535
Your Network in One Snap!

components/ProfileForm/CardInfo.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useState } from 'react'
33

44
const CardInfo = ({setOpenSocials, user}: any) => {
55
const inputStyle = "rounded-md border border-slate-300 py-1 px-3 text-lg mb-2 bg-[#bae8e8] text-[#272343] font-medium focus:outline-none focus:ring-[#272343] focus:ring-2 max-[550px]:mb-[20px]";
6+
const userType = "Individual"
67
const [profileDetails, setProfileDetails] = useState({
78
contactNo: "",
89
profession: "",
@@ -20,15 +21,15 @@ const CardInfo = ({setOpenSocials, user}: any) => {
2021

2122
const handleNextBtn = () => {
2223
setOpenSocials(true)
23-
AccountAPI.addingNewProfile(profileDetails)
24+
AccountAPI.addingNewProfile(user, profileDetails)
2425
}
2526

2627
return (
2728
<div className='flex flex-col justify-center items-center'>
2829
<div
2930
className='grid grid-cols-[150px_minmax(150px,_300px)] items-center gap-[15px] max-[550px]:grid-cols-1 max-[550px]:gap-[5px]'
3031
>
31-
{user.type == "Individual" ? <>
32+
{userType == "Individual" ? <>
3233
<p
3334
className='text-xl font-medium'
3435
>Profession</p>

components/ProfileForm/ProfileForm.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import CardInfo from "./CardInfo"
33
import SocialsInfo from "./SocialInfo"
44
import Image from "next/image";
55

6-
const ProfileForm = ({user}: any) => {
6+
const ProfileForm = ({user, setProfileUser}: any) => {
77
const [openSocials, setOpenSocials] = useState(false);
88

99
return (
@@ -13,7 +13,7 @@ const ProfileForm = ({user}: any) => {
1313
className='w-fit ml-0'
1414
onClick={() => setOpenSocials(false)}
1515
><Image
16-
src='/images/back.png'
16+
src='/images/left-arrow.png'
1717
alt="Back"
1818
width={25}
1919
height={25}
@@ -34,7 +34,7 @@ const ProfileForm = ({user}: any) => {
3434
className="flex h-[500px] items-start justify-center p-1 overflow-scroll"
3535
>
3636
{!openSocials ? <CardInfo user={user} setOpenSocials={setOpenSocials} /> :
37-
<SocialsInfo {...{user}} />}
37+
<SocialsInfo {...{user, setProfileUser}} />}
3838
</div>
3939
</div>
4040
)

components/ProfileForm/SocialInfo.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import { AccountAPI } from "@/lib/accountapi"
22
import { useRouter } from "next/navigation";
33

4-
const SocialsInfo = ({user}: any) => {
4+
const SocialsInfo = ({user, setProfileUser}: any) => {
55
const router = useRouter()
66
const links: any = ["","", "", "", "", "", "", ""]
77

88
const inputStyle = "rounded-md border border-slate-300 py-1 px-3 text-lg mb-2 bg-[#bae8e8] text-[#272343] font-medium focus:outline-none focus:ring-[#272343] focus:ring-2 max-[550px]:mb-[20px]";
99

1010
const handleNextBtn = () => {
1111
AccountAPI.updatingSocials(user.$id, links)
12-
router.push('/login')
12+
setProfileUser(1)
1313
}
1414

1515
return (
16-
<div className='flex flex-col justify-center items-center overflow-scroll mb-[40px]'>
16+
<div className='flex flex-col justify-center items-center overflow-scroll mb-[40px] p-4'>
1717
<div
1818
className='grid grid-cols-[150px_minmax(150px,_300px)] items-center gap-[15px] max-[550px]:grid-cols-1 max-[550px]:gap-[5px]'
1919
>

components/SignUp-In/SignUpMain.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const SignUpMain = ({details, setDetails, userNo, setUserNo, setShowUserType, ha
6262
className='w-fit ml-0'
6363
onClick={handleBackBtn}
6464
><Image
65-
src='/images/back.png'
65+
src='/images/left-arrow.png'
6666
width={25}
6767
height={25}
6868
alt="Back"
@@ -80,7 +80,7 @@ const SignUpMain = ({details, setDetails, userNo, setUserNo, setShowUserType, ha
8080
>
8181
<Image
8282
className='mr-4'
83-
src='https://res.cloudinary.com/db7nrltsv/image/upload/v1685734638/search_bi0uwu.png'
83+
src='/images/google.png'
8484
width={25}
8585
height={25}
8686
alt="Google"

lib/accountapi.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@ export const AccountAPI = {
9898
)
9999
},
100100

101-
addingNewProfile: async (res:any) => {
101+
addingNewProfile: async (res:any, profileDetails: any) => {
102102
return await database.createDocument(DATABASE_ID, PROFILE_COLLECTION_ID, ID.unique(), {
103103
userId: res.$id,
104104
type: res.type,
105-
profession: res.profession,
106-
organisation: res.organisation,
107-
firmType: res.firmType,
108-
contactNo: res.contactNo,
105+
profession: profileDetails.profession,
106+
organisation: profileDetails.organisation,
107+
firmType: profileDetails.firmType,
108+
contactNo: profileDetails.contactNo,
109109
}, [
110110
Permission.write(Role.any()),
111111
]).then(() => {

0 commit comments

Comments
 (0)