Skip to content

Commit

Permalink
Merge pull request #124 from adrianvrj/dev
Browse files Browse the repository at this point in the history
[feat] adding navigation to the entire app
  • Loading branch information
adrianvrj authored Oct 3, 2024
2 parents dd8cbb4 + a3e5998 commit 12e663d
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 22 deletions.
7 changes: 6 additions & 1 deletion frontend/gostarkme-web/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,9 @@ yarn-error.log*
*.tsbuildinfo
next-env.d.ts

/package-lock.json
/package-lock.json
/package.json
/yarn.lock
/.env*
/.env.example
/next.config.mjs
10 changes: 5 additions & 5 deletions frontend/gostarkme-web/app/app/myprofile/[useraddr]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ import Image from 'next/image';
import Footer from '@/components/ui/Footer';
import Navbar from '@/components/ui/Navbar';

const navItems = [
{ label: 'My Profile', href: '/profile' },
{ label: 'My funds', href: '/funds' }
];

interface UserProfilePageProps {
params: {
useraddr: string;
Expand All @@ -22,6 +17,11 @@ export function generateStaticParams() {
const UserProfilePage: React.FC<UserProfilePageProps> = ({ params }) => {
const { useraddr } = params;

const navItems = [
{ label: 'My Profile', href: `/app/myprofile/${useraddr}` },
{ label: 'My funds', href: `/app/myfunds/${useraddr}` }
];

// Mock data for design purposes
const totalDonations = 20000;
const currentLevel = 10;
Expand Down
2 changes: 1 addition & 1 deletion frontend/gostarkme-web/app/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import React from "react";
const Dashboard = () => {
const navItems = [
{ label: 'My Profile', href: 'app/myprofile/1' },
{ label: 'My funds', href: '/funds' }
{ label: 'My funds', href: '/app/myfunds/1' }
];

const funds = [
Expand Down
27 changes: 14 additions & 13 deletions frontend/gostarkme-web/components/modules/myfunds/UserFunds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import React, { useEffect, useState } from 'react';
import FundCard from '@/components/modules/myfunds/FundCard';
import { Button } from '@/components/ui/Button';
import { LinkButton } from '@/components/ui/LinkButton';

interface UserFundsProps {
userAddress: string;
Expand Down Expand Up @@ -53,28 +54,28 @@ const UserFunds: React.FC<UserFundsProps> = ({ userAddress }) => {
<div className="flex items-center">
<h1 className="text-2xl font-bold mr-2">My Funds &#10024;</h1>
</div>
<Button className='!px-12 !py-2.5' label='New' onClick={onNewFundHandler} />
<LinkButton label="New" href="/app/newfunding" />
</div>

{funds.length === 0 ? (
<div className="flex justify-center items-center h-64">
<div className="text-center text-gray-500">
<div className="text-center text-gray-500">
No funds found for address {userAddress.slice(0, 5)}...{userAddress.slice(-4)}
</div>
</div>
</div>
) : (
) : (
<div className="grid grid-cols-1 md:grid-cols-2 gap-y-10 gap-x-16">
{funds.map((fund: any, index: number) => (
<FundCard
key={index}
type={fund.type}
title={fund.title}
description={fund.description}
{... fund.onClick && { onClick: () => fund.onClick(fund.id) }}
{funds.map((fund: any, index: number) => (
<FundCard
key={index}
type={fund.type}
title={fund.title}
description={fund.description}
{...fund.onClick && { onClick: () => fund.onClick(fund.id) }}
/>
))}
))}
</div>
)}
)}
</div>
);
};
Expand Down
4 changes: 2 additions & 2 deletions frontend/gostarkme-web/components/ui/Bounded.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import Footer from "./Footer";
import Navbar from "./Navbar";

const navItems = [
{ label: 'My Profile', href: '/profile' },
{ label: 'My funds', href: '/funds' }
{ label: 'My Profile', href: '/app/myprofile/1' },
{ label: 'My funds', href: '/app/myfunds/1' }
];
interface BoundedProps {
children: ReactNode;
Expand Down

0 comments on commit 12e663d

Please sign in to comment.