Skip to content

Commit

Permalink
fix small bug
Browse files Browse the repository at this point in the history
  • Loading branch information
huseyincansoylu committed May 7, 2024
1 parent deb8093 commit 769c1a0
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ dist-ssr
*.njsproj
*.sln
*.sw?


.env
4 changes: 2 additions & 2 deletions src/components/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { BugIcon, CubeIcon, UserIcon, StatusIcon } from "../icons";
const navigationItems = [
{
name: "Blockchain",
to: "",
to: "blockchain",
svg: <CubeIcon />
},
{
Expand All @@ -20,7 +20,7 @@ const navigationItems = [
},
{
name: "Status",
to: "status",
to: "",
svg: <StatusIcon />
}
];
Expand Down
19 changes: 19 additions & 0 deletions src/routes/Blockchain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,25 @@ const Blockchain = () => {
];
}

let allEventsValid = true;

for (let i = 0; i < blockchainData.length; i++) {
const item = blockchainData[i];

if (!item.success || !item.failure) {
allEventsValid = false;
break;
}
}

if (!allEventsValid) {
return (
<div className="p-4 bg-white rounded-md">
There is no Blockchain events
</div>
);
}

return (
<div className="flex flex-col space-y-4">
{blockchainData.map(item => (
Expand Down
6 changes: 3 additions & 3 deletions src/routes/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const router = createHashRouter([
element: <Root />,
children: [
{
element: <Blockchain />,
element: <Status />,
index: true
},
{
Expand All @@ -24,8 +24,8 @@ export const router = createHashRouter([
element: <Bugs />
},
{
path: "status",
element: <Status />
path: "blockchain",
element: <Blockchain />
}
]
},
Expand Down
17 changes: 17 additions & 0 deletions src/routes/User.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,23 @@ const User = () => {
];
}

let allEventsValid = true;

for (let i = 0; i < userData.length; i++) {
const item = userData[i];

if (!item.success || !item.failure) {
allEventsValid = false;
break;
}
}

if (!allEventsValid) {
return (
<div className="p-4 bg-white rounded-md">There is no User events</div>
);
}

return (
<div className="flex flex-col space-y-4">
{userData.map(data => (
Expand Down

0 comments on commit 769c1a0

Please sign in to comment.