Skip to content

Commit dfbee0f

Browse files
[chore ☘️] sidebar & search bar responsive upgrade
1 parent 121b822 commit dfbee0f

13 files changed

Lines changed: 63 additions & 43 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
.pnp.js
55
.yarn/install-state.gz
66
pnpm-lock.yaml
7+
package-lock.json
78

89
# testing
910
/coverage

src/app/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default function RootLayout({
4444
>
4545
<Toaster />
4646
<main className="relative flex flex-col min-h-scree">
47-
<div className="lg:w-[20rem] lg:fixed lg:left-0 lg:top-0 lg:my-8 lg:px-8 border-r-2 border-gray-200 lg:h-[90vh] z-20 w-[100%]">
47+
<div className="lg:w-[20rem] dark:bg-zinc-900 bg-zinc-100 lg:bg-transparent fixed lg:left-0 lg:top-0 lg:my-8 lg:h-[90vh] p-4 lg:px-4 lg:py-0 border-r-2 border-gray-200 z-20 w-full">
4848
<Sidebar />
4949
</div>
5050
<div className="flex-1 flex-grow w-full">

src/cloud/config.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/components/contents/ProfileGrid.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const ProfileGrid = async ({ page, searchParams }: Props) => {
4040
]);
4141
const count = lengths[0].count;
4242
return (
43-
<div className="lg:mt-32 mb-8 border-t-orange-500 lg:ml-[20rem] lg:px-6 overflow-y-scroll p-5 lg:p-0">
43+
<div className="lg:mt-32 mt-[10rem] mb-8 border-t-orange-500 lg:ml-[20rem] px-4 lg:px-6 overflow-y-scroll relative">
4444
<Search />
4545
<div className="flex-center flex-col gap-3">
4646
{count <= 0 || profiles.length === 0 ? (

src/components/forms/CreateProfile.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const CreateProfile = ({
5454
/** image handler */
5555
const handleImage = async (
5656
event: ChangeEvent<HTMLInputElement>,
57-
fieldChange: (value: string) => void,
57+
fieldChange: (value: string) => void
5858
) => {
5959
event.preventDefault();
6060
/** File reader */
@@ -98,7 +98,7 @@ const CreateProfile = ({
9898
onSubmit={form.handleSubmit(onSubmitHandler)}
9999
className="flex-center flex-col md:flex-row-reverse gap-5 px-5 pb-5"
100100
>
101-
<div className="w-[30%] flex-center flex-col gap-3">
101+
<div className="w-full md:w-[30%] flex-center flex-col gap-3">
102102
<h1 className="text-base font-semibold hidden md:visible">
103103
Upload Profile
104104
</h1>
@@ -142,7 +142,7 @@ const CreateProfile = ({
142142
/>
143143
</div>
144144

145-
<div className="w-[80%] space-y-4">
145+
<div className="w-full md:w-[80%] space-y-4">
146146
<FormField
147147
control={form.control}
148148
name="name"

src/components/forms/SearchProfiles.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const SearchProfiles = () => {
3434
<SearchIcon
3535
size={30}
3636
className={
37-
"absolute lg:right-10 right-2 cursor-pointer hover:text-red-600 transition-all duration-300"
37+
"absolute right-2 cursor-pointer hover:text-red-600 transition-all duration-300"
3838
}
3939
/>
4040
</>

src/components/shared/search/Search.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import SearchProfiles from "@/components/forms/SearchProfiles";
33

44
const Search = () => {
55
return (
6-
<div className="backdrop-blur-3xl lg:fixed lg:top-0 lg:left-[20rem] lg:right-0 z-10 static">
7-
<div className="w-full bottom-0 lg:my-8 my-5 lg:px-6 px-0 flex-center">
6+
<div className="lg:backdrop-blur-3xl fixed left-0 lg:left-[20rem] lg:mx-0 px-4 py-0.5 dark:bg-zinc-900 bg-zinc-100 lg:bg-transparent lg:top-0 top-[5rem] right-0 z-50">
7+
<div className="w-full my-3 lg:my-8 flex-center relative">
88
<SearchProfiles />
99
</div>
1010
</div>

src/components/shared/sidebar/ProfileAdd.tsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,29 @@ import {
99
DialogTrigger,
1010
} from "../../ui/dialog";
1111
import CreateProfile from "../../forms/CreateProfile";
12+
import { Plus } from "lucide-react";
1213

1314
const ProfileAdd = () => {
1415
const [open, setOpen] = useState<boolean>(false);
15-
1616
return (
1717
<Dialog open={open} onOpenChange={setOpen}>
1818
<DialogTrigger asChild>
19-
<Button variant="default" className="font-semibold mt-5">
20-
Add My Profile
21-
</Button>
19+
<>
20+
<Button
21+
onClick={() => setOpen(true)}
22+
variant="default"
23+
className="font-semibold mt-5 lg:block hidden"
24+
>
25+
Add My Profile
26+
</Button>
27+
<Button
28+
onClick={() => setOpen(true)}
29+
variant="default"
30+
className="rounded-full w-10 h-10 p-0 font-extrabold lg:hidden fixed bottom-5 right-5"
31+
>
32+
<Plus size={30} fontWeight={900} />
33+
</Button>
34+
</>
2235
</DialogTrigger>
2336

2437
{/* diolog content */}

src/components/shared/sidebar/Sidebar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import ProfileAdd from "./ProfileAdd";
88

99
const Sidebar = () => {
1010
return (
11-
<div className="lg:flex-between flex justify-between p-4 lg:p-0 flex-col h-full">
11+
<div className="md:flex-between flex justify-between flex-col h-full">
1212
{/* header */}
13-
<div className="flex-start flex-col gap-4">
13+
<div className="flex-start flex-col w-full">
1414
<div className="flex-between flex-row w-full">
1515
<Logo />
1616
<ModeToggle />

src/configs/index.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import dotenv from "dotenv";
2+
import { z } from "zod";
3+
dotenv.config({
4+
path: "./.env",
5+
});
6+
7+
export const configType = z.object({
8+
DATABASE_URI: z.string().nonempty({ message: "DATABASE_URL is missing" }),
9+
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME: z
10+
.string()
11+
.nonempty({ message: "Cloudinary cloud name is missing" }),
12+
NEXT_PUBLIC_CLOUDINARY_API_KEY: z
13+
.string()
14+
.nonempty({ message: "Cloudinary API key missing" }),
15+
});
16+
type TConfig = z.infer<typeof configType>;
17+
18+
export const config: TConfig = {
19+
DATABASE_URI: process.env.DATABASE_URI as string,
20+
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME: process.env
21+
.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME as string,
22+
NEXT_PUBLIC_CLOUDINARY_API_KEY: process.env
23+
.NEXT_PUBLIC_CLOUDINARY_API_KEY as string,
24+
};

0 commit comments

Comments
 (0)