Skip to content

Commit

Permalink
Add pages in profile and update navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodoro committed Sep 27, 2024
1 parent 49556d4 commit 0d8f793
Show file tree
Hide file tree
Showing 10 changed files with 129 additions and 5 deletions.
11 changes: 11 additions & 0 deletions src/app/profile/deposits/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react'

const DepositsPage = () => {
return (
<div>

</div>
)
}

export default DepositsPage
11 changes: 11 additions & 0 deletions src/app/profile/inventory/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react'

const InventoryProfilePage = () => {
return (
<div>

</div>
)
}

export default InventoryProfilePage
16 changes: 16 additions & 0 deletions src/app/profile/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import NavbarProfile from '@/containers/layout/NavbarProfile'
import React from 'react'

export default function ProfileLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<>
<div className="absolute -top-3 -left-3 md:top-[-7rem] -z-20 md:left-8 flex-shrink-0 w-[336px] h-[336px] md:w-[587px] md:h-[587px] opacity-[0.3] bg-[#c51fff] blur-[227px]" />
<NavbarProfile />
{children}
</ >
)
}
11 changes: 11 additions & 0 deletions src/app/profile/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react'

const ProfilePage = () => {
return (
<div>

</div>
)
}

export default ProfilePage
11 changes: 11 additions & 0 deletions src/app/profile/withdrawals/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react'

const WithdrawalsPage = () => {
return (
<div>

</div>
)
}

export default WithdrawalsPage
2 changes: 1 addition & 1 deletion src/components/icons/setting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const SettingsIcon = () => {
const SettingsButton = () => {
return (
<Link
href={'#'}
href={'/profile'}
className='flex justify-center items-center gap-2.5 rounded-[15px] hover:scale-105 transition-all active:scale-95 select-none'
style={{
width: '56px',
Expand Down
2 changes: 1 addition & 1 deletion src/components/interface/Buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const AuthButton = () => {
const EarnMoneyButton = () => {
const { getTranslation } = useTranslation();
return (
<Link href={'#'} className='hover:scale-105 transition-all active:scale-95 select-none h-auto flex flex-row justify-center items-center rounded-2xl p-0.5 shadow-[0_10px_79px_0_rgba(146,105,213,0.20)] bg-gradient-to-r from-[#1F79FF] via-[#6A12FA] to-[#B8A6FF]'>
<Link href={'/referral'} className='hover:scale-105 transition-all active:scale-95 select-none h-auto flex flex-row justify-center items-center rounded-2xl p-0.5 shadow-[0_10px_79px_0_rgba(146,105,213,0.20)] bg-gradient-to-r from-[#1F79FF] via-[#6A12FA] to-[#B8A6FF]'>
<span className='flex flex-row justify-center items-center rounded-2xl bg-[#1E1C41] gap-2 px-8 py-4 w-full h-full'>
<div className="text-gray-50 text-center text-sm font-semibold leading-[normal]">{getTranslation('components.interface.button.earnMoney')}</div>
<svg width={11} height={11} viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
Expand Down
5 changes: 3 additions & 2 deletions src/containers/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ const Navbar = () => {
</div>
<div className='flex flex-row gap-7 items-center'>
<SelectLanguage />
{user ?
{/* TODO: Вернуть навбар в обратное состояние */}
{!user ?
<>
<Profile images={user.image} />
{/* <Profile images={user.image} /> */}
<SettingsButton />
<EarnMoneyButton />
</> :
Expand Down
62 changes: 62 additions & 0 deletions src/containers/layout/NavbarProfile.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
'use client'
import { CartButton } from "@/components/cart/Cart"
import { IoWallet } from "react-icons/io5";
import { FaGun } from "react-icons/fa6";
import { usePathname } from "next/navigation";
import { SelectPages } from "@/components/interface/Select";
import { HiUser } from "react-icons/hi2";
import { RiFolderReceivedFill } from "react-icons/ri";

const NavbarProfile = () => {
const pathname = usePathname()
return (
<>
<div
style={{
background: 'linear-gradient(150deg,rgba(42,26,82,1),rgba(22,25,64,1)) padding-box, linear-gradient(150deg,rgba(71,55,105,1),rgba(22,25,64,1)) border-box',
border: '2px solid transparent'
}}
className="hidden xl:flex w-full bg-red-300 px-9 py-[30px] justify-between gap-4 rounded-[30px]"
>
<div className="flex items-center justify-center gap-4">
<CartButton href={"/profile"} isActive={pathname == '/profile'} >
<HiUser className="text-[26px]" />
Profile
</CartButton>
<CartButton href={"/profile/inventory"} isActive={pathname == '/profile/inventory'}>
<FaGun className="text-[26px]" />
Inventory
</CartButton>
<CartButton href={"/profile/deposits"} isActive={pathname == '/profile/deposits'}>
<IoWallet className="text-[26px]" />
Deposits
</CartButton>
<CartButton href={"/profile/withdrawals"} isActive={pathname == '/profile/withdrawals'}>
<RiFolderReceivedFill className="text-[26px]" />
Withdrawals
</CartButton>
</div>
<div className="flex flex-col items-end">
{/* TODO:Logout из системы */}
</div>
</div>
<div className="flex xl:hidden w-full justify-between items-center">
<SelectPages
url={pathname}
items={[
{ value: '/profile', div: <><HiUser className="text-[26px]" />Profile</> },
{ value: '/profile/inventory', div: <><FaGun className="text-[26px]" />Inventory</> },
{ value: '/profile/deposits', div: <><IoWallet className="text-[26px]" />Deposits</> },
{ value: '/profile/withdrawals', div: <><RiFolderReceivedFill className="text-[26px]" />Withdrawals</> },
]}
/>
<div className="flex flex-col items-end min-w-[130px]">
{/* TODO:Logout из системы */}
</div>
</div>
</>

)
}

export default NavbarProfile
3 changes: 2 additions & 1 deletion src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ export async function middleware(request: NextRequest, response: NextResponse) {
}
}

export const configUser = ['/profile']
// TODO:добавить в мидлвару профили, реферальную систему и пополнение
export const configUser = []
export const configAdmin = ['/admin', '/admin/:path']

0 comments on commit 0d8f793

Please sign in to comment.