Skip to content

Commit 45574f7

Browse files
Merge pull request #506 from ParnaRoyChowdhury777/main
Fixed bug + Teams UI
2 parents 8a17250 + 4fc4707 commit 45574f7

File tree

3 files changed

+62
-81
lines changed

3 files changed

+62
-81
lines changed

src/app/globals.css

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
@tailwind base;
22
@tailwind components;
33
@tailwind utilities;
4+
5+
body {
6+
scroll-behavior: smooth;
7+
}
8+
49
@keyframes scroll {
510
0% {
611
transform: translateY(0);

src/app/teams/create/page.tsx

+55-36
Original file line numberDiff line numberDiff line change
@@ -3,63 +3,82 @@ import { Button } from "@/components/ui/button";
33
import { Input } from "@/components/ui/input";
44
import Image from "next/image";
55
import { useRouter } from "next/navigation";
6-
import { useState } from "react";
6+
import { useState } from "react";
77
import { toast } from "sonner";
8-
import { useSelector } from 'react-redux';
9-
import { RootState } from '@/config/store';
8+
import { useSelector } from "react-redux";
9+
import { RootState } from "@/config/store";
1010
import createAxiosInstance from "@/config/AxiosProtectedRoute";
1111
import { createNewTeamUrl } from "@/lib/API-URLs";
1212

1313
function CreateTeam() {
1414
const [teamName, setTeamName] = useState("");
15-
const user = useSelector((state:RootState)=>state.auth.user)
15+
const user = useSelector((state: RootState) => state.auth.user);
1616
const router = useRouter();
1717
const axiosInstance = createAxiosInstance(user.accessToken);
1818

19-
const createNewTeam = async() => {
19+
const createNewTeam = async () => {
2020
try {
21-
const res = await axiosInstance.post(createNewTeamUrl,{
22-
teamName
21+
const res = await axiosInstance.post(createNewTeamUrl, {
22+
teamName,
2323
});
24-
if(res.status === 200){
25-
router.push('/dashboard');
24+
if (res.status === 200) {
25+
router.push("/dashboard");
2626
toast.success("Team created Successfully");
2727
}
2828
} catch (err) {
29-
3029
console.log(err);
3130
}
3231
};
33-
32+
3433
return (
35-
<div className=" px-6 md:px-16 my-16">
36-
<Image src="/android-chrome-512x512.png" alt="logo" width={50} height={50} />
37-
<div className="flex flex-col items-center mt-8 gap-4">
38-
<h2 className="font-bold text-[40px] py-3">
39-
What should we call your team?
40-
</h2>
41-
<div className="mt-7 w-[40%]">
42-
<label className="text-muted-foreground">Team Name</label>
43-
<Input
44-
placeholder="Team Name"
45-
className="mt-3"
46-
onChange={(e) => setTeamName(e.target.value)}
47-
/>
34+
<>
35+
<div className="relative min-h-screen w-full lg:grid lg:grid-cols-2">
36+
<div className="flex items-center justify-center py-12">
37+
<div className="px-6 md:px-16 my-16">
38+
<Image
39+
src="/android-chrome-512x512.png"
40+
alt="logo"
41+
width={50}
42+
height={50}
43+
/>
44+
<div className="flex flex-col items-center mt-8 gap-4">
45+
<h2 className="font-bold text-[40px] py-3 text-center">
46+
What should we call your team?
47+
</h2>
48+
<div className="mt-7 w-full sm:px-8">
49+
<label className="text-muted-foreground">Team Name</label>
50+
<Input
51+
placeholder="Team Name"
52+
className="mt-3"
53+
onChange={(e) => setTeamName(e.target.value)}
54+
/>
55+
</div>
56+
<div className="flex gap-10 items-center">
57+
<Button
58+
disabled={!(teamName && teamName?.length > 0)}
59+
onClick={() => createNewTeam()}
60+
>
61+
Create Team
62+
</Button>
63+
<Button onClick={() => router.push("/dashboard")}>
64+
Cancel
65+
</Button>
66+
</div>
67+
</div>
68+
</div>
4869
</div>
49-
<div className="flex gap-10 items-center">
50-
<Button
51-
disabled={!(teamName && teamName?.length > 0)}
52-
onClick={() => createNewTeam()}
53-
>
54-
Create Team
55-
</Button>
56-
<Button
57-
onClick={() => router.push("/dashboard")}>
58-
Cancel
59-
</Button>
70+
<div className="hidden max-h-svh overflow-hidden bg-muted md:block">
71+
<Image
72+
alt="Image"
73+
loading="lazy"
74+
width={500}
75+
height={500}
76+
src="https://i.postimg.cc/26253f6m/ok-2.png"
77+
className="h-full w-full object-cover transition-all duration-500 hover:scale-110"
78+
/>
6079
</div>
6180
</div>
62-
</div>
81+
</>
6382
);
6483
}
6584

src/components/shared/Footer.tsx

+2-45
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,7 @@
11
"use client";
2-
import React, {useEffect} from 'react';
3-
import Image from 'next/image';
4-
import Script from 'next/script';
5-
6-
const GoogleTranslateComponent = () => {
7-
useEffect(() => {
8-
// Load the Google Translate script
9-
const script = document.createElement('script');
10-
script.src = "https://translate.google.com/translate_a/element.js?cb=loadGoogleTranslate";
11-
script.async = true;
12-
document.body.appendChild(script);
132

14-
// Define the Google Translate callback function
15-
window.loadGoogleTranslate = () => {
16-
new window.google.translate.TranslateElement({
17-
pageLanguage: 'en'
18-
}, 'google_element');
19-
};
20-
21-
return () => {
22-
// Clean up by removing the script
23-
document.body.removeChild(script);
24-
};
25-
}, []);
26-
};
3+
import React from 'react';
4+
import Image from 'next/image';
275

286
const Footer: React.FC = () => {
297
return (
@@ -50,27 +28,6 @@ const Footer: React.FC = () => {
5028
</p>
5129
</div>
5230

53-
<div className="wrapper col-md-3 col-12" style={{ justifyContent: 'center', display: 'flex' }}>
54-
<div id="google_element"></div>
55-
<Script
56-
src="https://translate.google.com/translate_a/element.js?cb=loadGoogleTranslate"
57-
strategy="afterInteractive"
58-
/>
59-
<Script
60-
id="google-translate"
61-
strategy="afterInteractive"
62-
dangerouslySetInnerHTML={{
63-
__html: `
64-
function loadGoogleTranslate() {
65-
new google.translate.TranslateElement({
66-
pageLanguage: 'en'
67-
}, 'google_element');
68-
}
69-
`,
70-
}}
71-
/>
72-
</div>
73-
7431
<div className="grid grid-cols-2 gap-8 sm:gap-6 lg:grid-cols-4">
7532
<div>
7633
<h2 className="mb-6 text-sm font-semibold text-gray-900 uppercase dark:text-white">

0 commit comments

Comments
 (0)