Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sweepstake
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Arjun Jhukal
sweepstake
Commits
d1a80c88
Commit
d1a80c88
authored
Oct 15, 2025
by
Arjun Jhukal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated the next config rewrite rules
parent
500717a6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
145 additions
and
41 deletions
+145
-41
next.config.ts
next.config.ts
+8
-0
Profile.tsx
src/components/organism/Header/Profile.tsx
+137
-40
baseQuery.ts
src/services/baseQuery.ts
+0
-1
No files found.
next.config.ts
View file @
d1a80c88
...
@@ -17,6 +17,14 @@ const nextConfig: NextConfig = {
...
@@ -17,6 +17,14 @@ const nextConfig: NextConfig = {
},
},
],
],
},
},
async
rewrites
()
{
return
[
{
source
:
'/api/backend/:path*'
,
// Requests to /api/backend/* from your frontend
destination
:
'https://app.bdwebai.com/api/:path*'
,
// Will be rewritten to your Laravel API
},
];
},
};
};
export
default
nextConfig
;
export
default
nextConfig
;
src/components/organism/Header/Profile.tsx
View file @
d1a80c88
...
@@ -28,6 +28,11 @@ export default function ProfileBlock() {
...
@@ -28,6 +28,11 @@ export default function ProfileBlock() {
};
};
const
id
=
open
?
'profile-dropdown'
:
""
const
id
=
open
?
'profile-dropdown'
:
""
const
handleLogout
=
(
e
:
React
.
MouseEvent
)
=>
{
e
.
preventDefault
();
dispatch
(
clearTokens
());
router
.
replace
(
PATH
.
AUTH
.
LOGIN
.
ROOT
);
};
const
menuItems
=
[
const
menuItems
=
[
{
{
label
:
"Profile"
,
label
:
"Profile"
,
...
@@ -53,36 +58,58 @@ export default function ProfileBlock() {
...
@@ -53,36 +58,58 @@ export default function ProfileBlock() {
label
:
"Logout"
,
label
:
"Logout"
,
href
:
"#"
,
href
:
"#"
,
icon
:
<
Logout
size=
"20"
className=
"group-hover:text-primary"
/>,
icon
:
<
Logout
size=
"20"
className=
"group-hover:text-primary"
/>,
onClick
:
(
e
:
React
.
MouseEvent
)
=>
{
onClick
:
handleLogout
,
e
.
preventDefault
();
},
dispatch
(
clearTokens
());
];
router
.
replace
(
"/login"
);
},
const
adminMenuItems
=
[
{
label
:
'View Profile'
,
href
:
'#'
,
icon
:
<
Profile
size=
"20"
className=
"group-hover:text-primary"
/>,
},
{
label
:
'Logout'
,
href
:
'#'
,
icon
:
<
Logout
size=
"20"
className=
"group-hover:text-primary text-red-500"
/>,
onClick
:
handleLogout
,
},
},
];
];
const
[
glassStyle
,
setGlassStyle
]
=
React
.
useState
({
top
:
0
,
height
:
0
,
opacity
:
0
});
const
menuListRef
=
React
.
useRef
<
HTMLUListElement
>
(
null
);
const
handleMouseEnter
=
(
e
:
React
.
MouseEvent
<
HTMLLIElement
>
)
=>
{
const
item
=
e
.
currentTarget
;
const
list
=
menuListRef
.
current
;
if
(
item
&&
list
)
{
const
itemRect
=
item
.
getBoundingClientRect
();
const
listRect
=
list
.
getBoundingClientRect
();
const
topPosition
=
itemRect
.
top
-
listRect
.
top
;
setGlassStyle
({
top
:
topPosition
,
height
:
itemRect
.
height
,
opacity
:
1
,
});
}
};
const
handleMouseLeave
=
()
=>
{
setGlassStyle
((
prev
)
=>
({
...
prev
,
opacity
:
0
}));
};
return
(
return
(
<
Box
>
<
Box
>
<
Button
<
a
aria
-
label=
"open profile"
aria
-
label=
"open profile"
ref=
{
anchorRef
}
ref=
{
anchorRef
}
aria
-
controls=
{
open
?
'profile-grow'
:
undefined
}
aria
-
controls=
{
open
?
'profile-grow'
:
undefined
}
aria
-
haspopup=
"true"
aria
-
haspopup=
"true"
onClick=
{
handleToggle
}
onClick=
{
handleToggle
}
className=
'!hover:bg-transparent'
className=
'!hover:bg-transparent cursor-pointer'
sx=
{
{
style=
{
{
padding
:
0
,
padding
:
0
'&:hover'
:
{
backgroundColor
:
'transparent'
,
// disables hover bg
},
'&:active'
:
{
backgroundColor
:
'transparent'
,
// disables click bg
boxShadow
:
'none'
,
// disables ripple/box-shadow
},
'&:focus'
:
{
backgroundColor
:
'transparent'
,
// disables focus bg
boxShadow
:
'none'
,
// disables focus shadow
},
}
}
}
}
>
>
<
div
className=
' lg:flex items-center gap-1'
>
<
div
className=
' lg:flex items-center gap-1'
>
...
@@ -97,7 +124,7 @@ export default function ProfileBlock() {
...
@@ -97,7 +124,7 @@ export default function ProfileBlock() {
<
ArrowDown2
size=
{
14
}
className=
'hidden lg:block'
/>
<
ArrowDown2
size=
{
14
}
className=
'hidden lg:block'
/>
</>
:
""
}
</>
:
""
}
</
div
>
</
div
>
</
Button
>
</
a
>
<
Popper
<
Popper
id=
{
id
}
id=
{
id
}
open=
{
open
}
open=
{
open
}
...
@@ -119,37 +146,107 @@ export default function ProfileBlock() {
...
@@ -119,37 +146,107 @@ export default function ProfileBlock() {
<
ClickAwayListener
onClickAway=
{
handleClose
}
>
<
ClickAwayListener
onClickAway=
{
handleClose
}
>
{
{
user
?.
role
&&
user
.
role
.
toLowerCase
()
!==
"user"
?
(
user
?.
role
&&
user
.
role
.
toLowerCase
()
!==
"user"
?
(
<
List
>
<
List
ref=
{
menuListRef
}
<
ListItem
>
onMouseLeave=
{
handleMouseLeave
}
<
ListItemText
>
style=
{
{
position
:
'relative'
}
}
>
<
Link
href=
{
"#"
}
className=
'block py-3 px-4 hover:bg-[#FBF4FB]'
>
View Profile
</
Link
>
<
div
</
ListItemText
>
style=
{
{
<
ListItemText
>
position
:
"absolute"
,
<
Link
href=
{
""
}
className=
'block py-3 px-4 hover:bg-[#FBF4FB] text-red-500'
onClick=
{
(
e
)
=>
{
left
:
"0"
,
e
.
preventDefault
();
right
:
"0"
,
dispatch
(
clearTokens
());
top
:
`${glassStyle.top}px`
,
router
.
replace
(
PATH
.
AUTH
.
LOGIN
.
ROOT
)
height
:
`${glassStyle.height}px`
,
}
}
>
Logout
</
Link
>
background
:
"rgba(255, 255, 255, 0.15)"
,
</
ListItemText
>
backdropFilter
:
"blur(12px)"
,
WebkitBackdropFilter
:
"blur(12px)"
,
border
:
"1px solid rgba(255, 255, 255, 0.25)"
,
borderRadius
:
"8px"
,
boxShadow
:
`
0 8px 32px 0 rgba(0, 0, 0, 0.37),
inset 0 1px 0 0 rgba(255, 255, 255, 0.4),
0 0 20px rgba(255, 255, 255, 0.1)
`
,
transition
:
"all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1)"
,
pointerEvents
:
"none"
,
zIndex
:
1
,
opacity
:
glassStyle
.
opacity
,
transform
:
glassStyle
.
opacity
===
1
?
"translateY(0) scale(1)"
:
"translateY(0) scale(0.95)"
,
}
}
/>
{
adminMenuItems
.
map
((
item
,
idx
)
=>
(
<
ListItem
key=
{
idx
}
disablePadding
onMouseEnter=
{
handleMouseEnter
}
style=
{
{
position
:
'relative'
,
zIndex
:
2
,
padding
:
0
,
}
}
>
{
!
item
?.
onClick
?
<
Link
href=
{
item
.
href
||
""
}
</
ListItem
>
className=
{
`flex items-center py-3 px-4 `
}
>
<
ListItemIcon
className=
"min-w-[30px] mr-1 group-hover:text-primary"
>
{
item
.
icon
}
</
ListItemIcon
>
<
ListItemText
primary=
{
item
.
label
}
className=
'group-hover:text-primary'
/>
</
Link
>
:
<
ListItemButton
href=
{
item
.
href
||
""
}
onClick=
{
item
.
onClick
}
className=
{
`flex items-center py-3 px-4 !wit`
}
>
<
ListItemIcon
className=
"min-w-[30px] mr-1 group-hover:text-primary"
>
{
item
.
icon
}
</
ListItemIcon
>
<
ListItemText
primary=
{
item
.
label
}
className=
'group-hover:text-primary'
/>
</
ListItemButton
>
}
</
ListItem
>))
}
</
List
>
</
List
>
)
:
(
)
:
(
<
List
>
<
List
ref=
{
menuListRef
}
onMouseLeave=
{
handleMouseLeave
}
style=
{
{
position
:
'relative'
}
}
>
<
div
style=
{
{
position
:
'absolute'
,
left
:
'0'
,
right
:
'0'
,
top
:
`${glassStyle.top}px`
,
height
:
`${glassStyle.height}px`
,
background
:
'rgba(255, 255, 255, 0.15)'
,
backdropFilter
:
'blur(12px)'
,
WebkitBackdropFilter
:
'blur(12px)'
,
border
:
'1px solid rgba(255, 255, 255, 0.25)'
,
borderRadius
:
'8px'
,
boxShadow
:
`
0 8px 32px 0 rgba(0, 0, 0, 0.37),
inset 0 1px 0 0 rgba(255, 255, 255, 0.4),
0 0 20px rgba(255, 255, 255, 0.1)
`
,
transition
:
'all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1)'
,
pointerEvents
:
'none'
,
zIndex
:
1
,
opacity
:
glassStyle
.
opacity
,
transform
:
glassStyle
.
opacity
===
1
?
'translateY(0) scale(1)'
:
'translateY(0) scale(0.95)'
,
}
}
/>
{
menuItems
.
map
((
item
,
idx
)
=>
(
{
menuItems
.
map
((
item
,
idx
)
=>
(
<
ListItem
key=
{
idx
}
disablePadding
>
<
ListItem
key=
{
idx
}
disablePadding
onMouseEnter=
{
handleMouseEnter
}
style=
{
{
position
:
'relative'
,
zIndex
:
2
,
padding
:
0
,
}
}
>
{
!
item
?.
onClick
?
<
Link
{
!
item
?.
onClick
?
<
Link
// component=
{
item
.
href
?
Link
:
"
button
"}
href=
{
item
.
href
||
""
}
href=
{
item
.
href
||
""
}
className=
{
`flex items-center py-3 px-4
hover:bg-[#FBF4FB] group
`
}
className=
{
`flex items-center py-3 px-4 `
}
>
>
<
ListItemIcon
className=
"min-w-[30px] mr-1 group-hover:text-primary"
>
{
item
.
icon
}
</
ListItemIcon
>
<
ListItemIcon
className=
"min-w-[30px] mr-1 group-hover:text-primary"
>
{
item
.
icon
}
</
ListItemIcon
>
<
ListItemText
primary=
{
item
.
label
}
className=
'group-hover:text-primary'
/>
<
ListItemText
primary=
{
item
.
label
}
className=
'group-hover:text-primary'
/>
</
Link
>
:
<
ListItemButton
</
Link
>
:
<
ListItemButton
href=
{
item
.
href
||
""
}
href=
{
item
.
href
||
""
}
onClick=
{
item
.
onClick
}
onClick=
{
item
.
onClick
}
className=
{
`flex items-center py-3 px-4 !wit
hover:bg-[#FBF4FB] group
`
}
className=
{
`flex items-center py-3 px-4 !wit`
}
>
>
<
ListItemIcon
className=
"min-w-[30px] mr-1 group-hover:text-primary"
>
{
item
.
icon
}
</
ListItemIcon
>
<
ListItemIcon
className=
"min-w-[30px] mr-1 group-hover:text-primary"
>
{
item
.
icon
}
</
ListItemIcon
>
<
ListItemText
primary=
{
item
.
label
}
className=
'group-hover:text-primary'
/>
<
ListItemText
primary=
{
item
.
label
}
className=
'group-hover:text-primary'
/>
...
...
src/services/baseQuery.ts
View file @
d1a80c88
...
@@ -13,7 +13,6 @@ export const baseQuery = fetchBaseQuery({
...
@@ -13,7 +13,6 @@ export const baseQuery = fetchBaseQuery({
headers
.
set
(
"Authorization"
,
`Bearer
${
token
}
`
);
headers
.
set
(
"Authorization"
,
`Bearer
${
token
}
`
);
}
}
return
headers
;
return
headers
;
},
},
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment