Skip to content

Commit

Permalink
fix issue from johuruls feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
neajmorshed0 committed Feb 17, 2025
1 parent c5a8d9d commit ff192d6
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 42 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/.idea
/node_modules
/.pnp
.pnp.js
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"@types/react": "^19",
"@types/react-dom": "^19",
"@types/react-flatpickr": "^3.8.11",
"@types/react-transition-group": "^4.4.12",
"eslint": "^9",
"eslint-config-next": "15.1.3",
"postcss": "^8",
Expand Down
2 changes: 1 addition & 1 deletion src/components/auth/SignInForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function SignInForm() {
const [showPassword, setShowPassword] = useState(false);
const [isChecked, setIsChecked] = useState(false);
return (
<div className="flex flex-col flex-1 p-6 rounded-2xl sm:rounded-none sm:border-0 sm:p-8">
<div className="flex flex-col flex-1">
<div className="w-full max-w-md pt-10 mx-auto">
<Link
href="/"
Expand Down
2 changes: 1 addition & 1 deletion src/components/ecommerce/DemographicCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function DemographicCard() {
</div>

<div className="relative inline-block">
<button onClick={toggleDropdown}>
<button onClick={toggleDropdown} className="dropdown-toggle">
<MoreDotIcon className="text-gray-400 hover:text-gray-700 dark:hover:text-gray-300" />
</button>
<Dropdown
Expand Down
2 changes: 1 addition & 1 deletion src/components/ecommerce/MonthlySalesChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export default function MonthlySalesChart() {
</h3>

<div className="relative inline-block">
<button onClick={toggleDropdown}>
<button onClick={toggleDropdown} className="dropdown-toggle">
<MoreDotIcon className="text-gray-400 hover:text-gray-700 dark:hover:text-gray-300" />
</button>
<Dropdown
Expand Down
2 changes: 1 addition & 1 deletion src/components/ecommerce/MonthlyTarget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default function MonthlyTarget() {
</p>
</div>
<div className="relative inline-block">
<button onClick={toggleDropdown}>
<button onClick={toggleDropdown} className="dropdown-toggle">
<MoreDotIcon className="text-gray-400 hover:text-gray-700 dark:hover:text-gray-300" />
</button>
<Dropdown
Expand Down
4 changes: 2 additions & 2 deletions src/components/form/MultiSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const MultiSelect: React.FC<MultiSelectProps> = ({

<div className="relative z-20 inline-block w-full">
<div className="relative flex flex-col items-center">
<div onClick={toggleDropdown} className="w-full">
<div onClick={toggleDropdown} className="dropdown-toggle" className="w-full">
<div className="mb-2 flex h-11 rounded-lg border border-gray-300 py-1.5 pl-3 pr-3 shadow-theme-xs outline-none transition focus:border-brand-300 focus:shadow-focus-ring dark:border-gray-700 dark:bg-gray-900 dark:focus:border-brand-300">
<div className="flex flex-wrap flex-auto gap-2">
{selectedValuesText.length > 0 ? (
Expand Down Expand Up @@ -104,7 +104,7 @@ const MultiSelect: React.FC<MultiSelectProps> = ({
<div className="flex items-center py-1 pl-1 pr-1 w-7">
<button
type="button"
onClick={toggleDropdown}
onClick={toggleDropdown} className="dropdown-toggle"
className="w-5 h-5 text-gray-700 outline-none cursor-pointer focus:outline-none dark:text-gray-400"
>
<svg
Expand Down
5 changes: 3 additions & 2 deletions src/components/header/NotificationDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import React, { useState } from "react";
import { Dropdown } from "../ui/dropdown/Dropdown";
import { DropdownItem } from "../ui/dropdown/DropdownItem";


export default function NotificationDropdown() {
const [isOpen, setIsOpen] = useState(false);
const [notifying, setNotifying] = useState(true);
Expand All @@ -24,7 +25,7 @@ export default function NotificationDropdown() {
return (
<div className="relative">
<button
className="relative flex items-center justify-center text-gray-500 transition-colors bg-white border border-gray-200 rounded-full hover:text-gray-700 h-11 w-11 hover:bg-gray-100 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white"
className="relative flex dropdown-toggle items-center justify-center text-gray-500 transition-colors bg-white border border-gray-200 rounded-full hover:text-gray-700 h-11 w-11 hover:bg-gray-100 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white"
onClick={handleClick}
>
<span
Expand Down Expand Up @@ -59,7 +60,7 @@ export default function NotificationDropdown() {
Notification
</h5>
<button
onClick={toggleDropdown}
onClick={toggleDropdown} className="dropdown-toggle"
className="text-gray-500 transition dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200"
>
<svg
Expand Down
19 changes: 9 additions & 10 deletions src/components/header/UserDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@ import { DropdownItem } from "../ui/dropdown/DropdownItem";
export default function UserDropdown() {
const [isOpen, setIsOpen] = useState(false);

function toggleDropdown() {
setIsOpen(!isOpen);
}
function toggleDropdown(e: React.MouseEvent<HTMLButtonElement, MouseEvent>) {
e.stopPropagation();
setIsOpen((prev) => !prev);
}

function closeDropdown() {
setIsOpen(false);
}
return (
<div className="relative">
<button
onClick={toggleDropdown}
className="flex items-center text-gray-700 dark:text-gray-400"
onClick={toggleDropdown} className="dropdown-toggle"
className="flex items-center text-gray-700 dark:text-gray-400 dropdown-toggle"
>
<span className="mr-3 overflow-hidden rounded-full h-11 w-11">
<Image
Expand All @@ -30,9 +31,7 @@ export default function UserDropdown() {
/>
</span>

<span className="block mr-1 font-medium text-theme-sm">
Musharof
</span>
<span className="block mr-1 font-medium text-theme-sm">Musharof</span>

<svg
className={`stroke-gray-500 dark:stroke-gray-400 transition-transform duration-200 ${
Expand Down Expand Up @@ -61,10 +60,10 @@ export default function UserDropdown() {
>
<div>
<span className="block font-medium text-gray-700 text-theme-sm dark:text-gray-400">
Musharof Chowdury
Musharof Chowdhury
</span>
<span className="mt-0.5 block text-theme-xs text-gray-500 dark:text-gray-400">
[email protected]
[email protected]
</span>
</div>

Expand Down
30 changes: 16 additions & 14 deletions src/components/ui/dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,23 @@ export const Dropdown: React.FC<DropdownProps> = ({
}) => {
const dropdownRef = useRef<HTMLDivElement>(null);

useEffect(() => {
const handleClickOutside = (event: MouseEvent) => {
if (
dropdownRef.current &&
!dropdownRef.current.contains(event.target as Node)
) {
onClose();
}
};
useEffect(() => {
const handleClickOutside = (event: MouseEvent) => {
if (
dropdownRef.current &&
!dropdownRef.current.contains(event.target as Node) &&
!(event.target as HTMLElement).closest('.dropdown-toggle')
) {
onClose();
}
};

document.addEventListener("mousedown", handleClickOutside);
return () => {
document.removeEventListener("mousedown", handleClickOutside);
};
}, [onClose]);

document.addEventListener("mousedown", handleClickOutside);
return () => {
document.removeEventListener("mousedown", handleClickOutside);
};
}, [onClose]);

if (!isOpen) return null;

Expand Down
22 changes: 14 additions & 8 deletions src/components/user-profile/UserMetaCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Button from "../ui/button/Button";
import Input from "../form/input/InputField";
import Label from "../form/Label";
import Image from "next/image";
import Link from "next/link";

export default function UserMetaCard() {
const { isOpen, openModal, closeModal } = useModal();
Expand Down Expand Up @@ -42,7 +43,9 @@ export default function UserMetaCard() {
</div>
</div>
<div className="flex items-center order-2 gap-2 grow xl:order-3 xl:justify-end">
<button className="flex h-11 w-11 items-center justify-center gap-2 rounded-full border border-gray-300 bg-white text-sm font-medium text-gray-700 shadow-theme-xs hover:bg-gray-50 hover:text-gray-800 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-white/[0.03] dark:hover:text-gray-200">
<a
target="_blank"
rel="noreferrer" href='https://www.facebook.com/PimjoHQ' className="flex h-11 w-11 items-center justify-center gap-2 rounded-full border border-gray-300 bg-white text-sm font-medium text-gray-700 shadow-theme-xs hover:bg-gray-50 hover:text-gray-800 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-white/[0.03] dark:hover:text-gray-200">
<svg
className="fill-current"
width="20"
Expand All @@ -56,9 +59,10 @@ export default function UserMetaCard() {
fill=""
/>
</svg>
</button>
</a>

<button className="flex h-11 w-11 items-center justify-center gap-2 rounded-full border border-gray-300 bg-white text-sm font-medium text-gray-700 shadow-theme-xs hover:bg-gray-50 hover:text-gray-800 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-white/[0.03] dark:hover:text-gray-200">
<a href='https://x.com/PimjoHQ' target="_blank"
rel="noreferrer" className="flex h-11 w-11 items-center justify-center gap-2 rounded-full border border-gray-300 bg-white text-sm font-medium text-gray-700 shadow-theme-xs hover:bg-gray-50 hover:text-gray-800 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-white/[0.03] dark:hover:text-gray-200">
<svg
className="fill-current"
width="20"
Expand All @@ -72,9 +76,10 @@ export default function UserMetaCard() {
fill=""
/>
</svg>
</button>
</a>

<button className="flex h-11 w-11 items-center justify-center gap-2 rounded-full border border-gray-300 bg-white text-sm font-medium text-gray-700 shadow-theme-xs hover:bg-gray-50 hover:text-gray-800 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-white/[0.03] dark:hover:text-gray-200">
<a href="https://www.linkedin.com/company/pimjo" target="_blank"
rel="noreferrer" className="flex h-11 w-11 items-center justify-center gap-2 rounded-full border border-gray-300 bg-white text-sm font-medium text-gray-700 shadow-theme-xs hover:bg-gray-50 hover:text-gray-800 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-white/[0.03] dark:hover:text-gray-200">
<svg
className="fill-current"
width="20"
Expand All @@ -88,9 +93,10 @@ export default function UserMetaCard() {
fill=""
/>
</svg>
</button>
</a>

<button className="flex h-11 w-11 items-center justify-center gap-2 rounded-full border border-gray-300 bg-white text-sm font-medium text-gray-700 shadow-theme-xs hover:bg-gray-50 hover:text-gray-800 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-white/[0.03] dark:hover:text-gray-200">
<a href='https://instagram.com/PimjoHQ' target="_blank"
rel="noreferrer" className="flex h-11 w-11 items-center justify-center gap-2 rounded-full border border-gray-300 bg-white text-sm font-medium text-gray-700 shadow-theme-xs hover:bg-gray-50 hover:text-gray-800 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-white/[0.03] dark:hover:text-gray-200">
<svg
className="fill-current"
width="20"
Expand All @@ -104,7 +110,7 @@ export default function UserMetaCard() {
fill=""
/>
</svg>
</button>
</a>
</div>
</div>
<button
Expand Down
5 changes: 3 additions & 2 deletions src/layout/AppHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,12 @@ const AppHeader: React.FC = () => {
<ThemeToggleButton />
{/* <!-- Dark Mode Toggler --> */}

<NotificationDropdown />
<NotificationDropdown />
{/* <!-- Notification Menu Area --> */}
</div>
{/* <!-- User Area --> */}
<UserDropdown />
<UserDropdown />

</div>
</div>
</header>
Expand Down

0 comments on commit ff192d6

Please sign in to comment.