Skip to content

Commit

Permalink
Update package names and UI text
Browse files Browse the repository at this point in the history
  • Loading branch information
etienne committed Feb 6, 2024
1 parent bf17d64 commit 517aecb
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 52 deletions.
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "kurakani-server",
"name": "pedagochat-server",
"version": "1.0.0",
"description": "",
"main": "src/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion backend/src/routes/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ io.on("connection", (socket) => {
roomUsers[roomId] = [...users.filter((id) => id !== socket.id)];
io.emit("receive_message", {
text: "A user left the room.",
socketId: "kurakani",
socketId: "pedagochat",
roomId: roomId,
});
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "kurakani",
"name": "pedagochat",
"version": "0.1.0",
"private": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/chat/[roomId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function Page() {
if (roomUsers[roomId]?.includes(socket?.id)) return;
socket?.emit("send_message", {
text: username + " joined the room.",
socketId: "kurakani",
socketId: "pedagochat",
roomId: roomId,
});
socket?.emit("join_room", roomId);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/chat/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from "react";
function page() {
return (
<div className="flex justify-center items-center w-full text-xl">
Select a room to do Kurakani
Select a room to do pedagochat
</div>
);
}
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import UserProvider from "@/contexts/UserContext";
import "./globals.css";
import localFont from "next/font/local";
import { Metadata } from "next";
import 'react-tooltip/dist/react-tooltip.css'
import "react-tooltip/dist/react-tooltip.css";

const calibre = localFont({
src: [
Expand All @@ -15,9 +15,9 @@ const calibre = localFont({
});

export const metadata: Metadata = {
title: "Kurakani",
description: "kurakani - the best way to chat",
icons: "/images/logo.png"
title: "pedagochat",
description: "pedagochat - the best way to chat",
icons: "/images/logo.png",
};

export default function RootLayout({
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ export default function Home() {
<div className="flex flex-col gap-8 w-full xl:pr-32 lg:w-1/2">
<div className="flex flex-col gap-5">
<p className=" text-[72px] leading-[70px] lg:text-[90px] text-transparent font-medium lg:leading-[85px] tracking-tight bg-gradient bg-clip-text">
Kurakani
pedagochat
<br /> anytime, anywhere
</p>
<p className="text-lg leading-7 text-gray-600">
Kurakani makes it easy and fun to quickly chat with people all
pedagochat makes it easy and fun to quickly chat with people all
around the globe.
</p>
</div>
Expand Down
22 changes: 15 additions & 7 deletions frontend/src/components/Chat/ChatBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@ function ChatBody({ roomId }: { roomId: string }) {
return (
<div className="basis-[85%] overflow-y-scroll p-5 w-full flex flex-col gap-2">
{messages[roomId]?.map((message: any, index: number) =>
message.socketId === "kurakani" ? (
message.socketId === "pedagochat" ? (
<div className="flex self-center" key={index}>
<div className="flex justify-center items-center">
<p>{message.text}</p>
</div>
</div>
) : message.socketId === socket?.id ? (
<div className="flex self-end flex-col items-end" key={index}>
{message.text && <div className="flex justify-center items-center px-3 py-1 text-white rounded-full rounded-br-none bg-primary">
<p className="font-sans">{message.text}</p>
</div>}
{message.text && (
<div className="flex justify-center items-center px-3 py-1 text-white rounded-full rounded-br-none bg-primary">
<p className="font-sans">{message.text}</p>
</div>
)}
{message.image && <ChatImage imgURL={message.image} />}
</div>
) : (
Expand All @@ -47,9 +49,15 @@ function ChatBody({ roomId }: { roomId: string }) {
</div>
<div>
<p className="pl-2 text-sm align-bottom">{message.name}</p>
{message.text && <div className={`px-3 py-1 bg-gray-200 rounded-full ${message.image ? "rounded-bl-none" : "rounded-tl-none"} w-fit`}>
<p className="font-sans">{message.text}</p>
</div>}
{message.text && (
<div
className={`px-3 py-1 bg-gray-200 rounded-full ${
message.image ? "rounded-bl-none" : "rounded-tl-none"
} w-fit`}
>
<p className="font-sans">{message.text}</p>
</div>
)}
{message.image && <ChatImage imgURL={message.image} />}
<p className="py-2 pl-2 text-xs font-light">
{new Date(message.time).toLocaleTimeString([], {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Home/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Footer() {
<footer className="flex justify-center items-center px-5 mt-5 mb-2 lg:px-36">
<div className="w-full">
<span className="font-semibold">
© Kurakani {new Date().getFullYear()}.{" "}
© pedagochat {new Date().getFullYear()}.{" "}
</span>
<span className="font-light">
Made with ❤️ and JS by{" "}
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/components/Home/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ function LoginForm() {
const onStart = (e: any) => {
e.preventDefault();
setIsLoading(true);
if(name) {
if (name) {
localStorage.setItem("name", name);
setUsername(name);
} else {

}
router.push("/chat");
};
Expand Down Expand Up @@ -50,7 +49,7 @@ function LoginForm() {
{isLoading ? (
<ClipLoader color="white" size={20} />
) : (
"Start Kurakani"
"Start pedagochat"
)}
</button>
</div>
Expand Down
64 changes: 34 additions & 30 deletions frontend/src/components/Home/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@ import Image from "next/image";
import Link from "next/link";
import { AiOutlineClose, AiOutlineMenu } from "react-icons/ai";
import { FaGithub } from "react-icons/fa";
import { Tooltip } from 'react-tooltip'
import { Tooltip } from "react-tooltip";

const NAV_LINKS = [
{ icon: FaGithub, label: "Github", title: "Star on GitHub", link: "https://github.com/diwash007/kurakani", externalPage: true },
{
icon: FaGithub,
label: "Github",
title: "Star on GitHub",
link: "https://github.com/diwash007/pedagochat",
externalPage: true,
},
];


function Navbar() {
const [navbarActive, setNavbarActive] = useState(false);

Expand All @@ -33,15 +38,16 @@ function Navbar() {
{React.createElement(icon, { className: "w-10 h-10" })}
{label}
</Link>
{
title &&
<Tooltip delayShow={200} anchorSelect={`#${label}${index}`} place="left">
{title && (
<Tooltip
delayShow={200}
anchorSelect={`#${label}${index}`}
place="left"
>
{title}
</Tooltip>
}

)}
</>

) : (
<Link
id={`${label}${index}`}
Expand All @@ -53,8 +59,6 @@ function Navbar() {
</Link>
)}
</>


);
})}
</div>
Expand All @@ -70,10 +74,11 @@ function Navbar() {
</div>
{navbarActive && (
<div className="text-white absolute top-[80px] bg-gradient-to-r from-purple-500 to-pink-500 right-6 rounded-full font-medium text-xl py-2 px-4">
{NAV_LINKS.map(({ label, title, link, icon, externalPage }, index) => {
return (
<>
{icon ? (
{NAV_LINKS.map(
({ label, title, link, icon, externalPage }, index) => {
return (
<>
{icon ? (
<Link
id={`${label}${index}`}
className="flex gap-5 items-center justify-center"
Expand All @@ -84,21 +89,20 @@ function Navbar() {
{React.createElement(icon, { className: "w-6 h-6" })}
<span className="pt-1">{label}</span>
</Link>
) : (
<Link
id={`${label}${index}`}
href={link}
key={index}
target={externalPage ? "_blank" : "_self"}
>
{label}
</Link>
)}
</>


);
})}
) : (
<Link
id={`${label}${index}`}
href={link}
key={index}
target={externalPage ? "_blank" : "_self"}
>
{label}
</Link>
)}
</>
);
}
)}
</div>
)}
</div>
Expand Down

0 comments on commit 517aecb

Please sign in to comment.