Skip to content

Commit fab25f9

Browse files
committed
profile pic and name from google
1 parent 1fa8d9d commit fab25f9

File tree

8 files changed

+33
-6
lines changed

8 files changed

+33
-6
lines changed

next.config.mjs

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import createNextIntlPlugin from 'next-intl/plugin';
33
const withNextIntl = createNextIntlPlugin();
44

55
/** @type {import('next').NextConfig} */
6-
const nextConfig = {};
6+
const nextConfig = {
7+
8+
};
79

810
export default withNextIntl(nextConfig);

next.config.ts

+11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
import type { NextConfig } from "next";
22

33
const nextConfig: NextConfig = {
4+
images: {
5+
remotePatterns: [
6+
{
7+
protocol: 'https',
8+
hostname: 'lh3.googleusercontent.com',
9+
port: '',
10+
pathname: '*',
11+
search: '',
12+
},
13+
],
14+
},
415
/* config options here */
516
async headers() {
617
return [

public/assets/profile.png

-3.75 KB
Binary file not shown.

public/assets/profile.svg

+5
Loading

src/app/chat/page.module.scss

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ width:100%;
2727
text-align: center;
2828
.profilePic{
2929
cursor: pointer;
30+
border-radius: 50px;
3031
}
3132
}
3233
}

src/app/components/chatBubbles/chatBubbles.module.scss

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
background: #1683FF;
2121
border-radius:20px;
2222
color: #fff;
23+
2324
}
2425
}
2526

27+
.profilePic{
28+
border-radius: 50px;
29+
}
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11

2+
import { useUser } from "@auth0/nextjs-auth0/client";
23
import styles from "../chatBubbles.module.scss";
3-
import Image from 'next/image';
4+
5+
46

57

68
type Props = {
79
text:string
810
};
911

1012
export default function ChatOut(props: Props) {
13+
const { user } = useUser();
1114

1215
return (
1316
<div className={styles.chatRowReverse}>
1417
<div className={styles.chatBubbleOut}>
1518
<p>{props.text}</p>
1619
</div>
17-
<Image src={'/assets/profile.png'} alt='veri-fact logo' height={40} width={40} />
20+
<img src={user?user.picture:"/assets/profile.svg"} alt="me" width="40" height="40" className={styles.profilePic}/>
1821
</div>
1922
);
2023
}

src/app/components/controlColumn/index.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
"use client"
22

3-
import Image from "next/image";
43
import AddTab from "../../components/addTab";
54
import styles from "../../chat/page.module.scss";
65
import { useState } from "react";
76
import UserModal from "../modals/userModal";
87
import PreferencesModal from "../modals/preferences";
98
import ReportModal from "../modals/report";
9+
import { useUser } from '@auth0/nextjs-auth0/client';
1010

1111

1212
export default function ControlColumn() {
1313
const [accountControlIsOpen, setAccountControlIsOpen] = useState(false)
1414
const [activeModal, setActiveModal] = useState(0)
15+
const { user } = useUser();
1516

1617
return (
1718
<section className={styles.controlColumn}>
1819
<div className={styles.tabSection}>
1920
<AddTab />
2021
</div>
2122
<div className={styles.profileWrapper}>
22-
<Image src="/assets/profile.png" alt="me" width="50" height="50" className={styles.profilePic} onClick={()=> setAccountControlIsOpen(true)}/>
23-
<p>David</p>
23+
<img src={user?user.picture:"/assets/profile.svg"} alt="me" width="50" height="50" className={styles.profilePic} onClick={()=> setAccountControlIsOpen(true)}/>
24+
<p>{user?user.name.split(" ")[0]:""}</p>
2425
</div>
2526
{accountControlIsOpen === true ? <UserModal setAccountControlIsOpen={setAccountControlIsOpen} setActiveModal={setActiveModal} /> : ""}
2627
{activeModal === 1 ? <PreferencesModal setActiveModal={setActiveModal} />: ""}

0 commit comments

Comments
 (0)