Skip to content

Commit

Permalink
Merge branch 'main' into glydric
Browse files Browse the repository at this point in the history
  • Loading branch information
Glydric committed Dec 21, 2023
2 parents c5f8ef3 + a64fb1d commit 72f82e9
Show file tree
Hide file tree
Showing 54 changed files with 2,154 additions and 223 deletions.
684 changes: 507 additions & 177 deletions Frontend/package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion Frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
"@types/react-redux": "^7.1.31",
"antd": "^5.11.3",
"axios": "^1.6.2",
"dayjs": "^1.11.10",
"next": "14.0.0",
"react": "^18",
"react-dom": "^18",
"react-icons": "^4.12.0",
"react-redux": "^8.1.3"
"react-redux": "^8.1.3",
"recharts": "^2.10.3"
},
"devDependencies": {
"@types/node": "^20",
Expand Down
Binary file added Frontend/public/images/cat.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Frontend/public/images/dog.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Frontend/public/images/leonardo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Frontend/public/images/mission.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Frontend/public/images/nabil.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Frontend/public/images/overview.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Frontend/public/images/person.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Frontend/public/images/solution.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions Frontend/src/app/about-us/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import {
AboutUsOverviewContainer,
AboutUsSolutionContainer,
AboutUsMissionContainer,
AboutUsTeamContainer,
} from "@/containers";

export default function AboutUsPage() {
return (
<div className="flex flex-col">
<AboutUsOverviewContainer />
<AboutUsSolutionContainer />
<AboutUsMissionContainer />
<AboutUsTeamContainer />
</div>
);
}
10 changes: 10 additions & 0 deletions Frontend/src/app/analytics/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"use client";
import { AnalyticsContainer } from "@/containers";

export default function Analytics() {
return (
<div>
<AnalyticsContainer />
</div>
);
}
15 changes: 15 additions & 0 deletions Frontend/src/app/authorized-entities/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"use client";
import { Table } from "@/components";
import { authorizedEntitiesData, authorizedEntitiesColumns } from "@/data";

export default function AuthorizedEntities() {
return (
<div>
<Table
columns={authorizedEntitiesColumns}
data={authorizedEntitiesData}
pagination={{ total: authorizedEntitiesData.length }}
/>
</div>
);
}
7 changes: 7 additions & 0 deletions Frontend/src/app/contact-us/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { ContactUsContainer } from "@/containers";

export default function ContactUsPage() {
return (
<ContactUsContainer />
);
}
6 changes: 6 additions & 0 deletions Frontend/src/app/globals.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
@tailwind base;
@tailwind components;
@tailwind utilities;


html,body{
margin:0;
padding:0;
}
15 changes: 15 additions & 0 deletions Frontend/src/app/recent-activities/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"use client";
import { Table } from "@/components";
import { recentActivitiesData, recentActivitiesColumns } from "@/data";

export default function RecentActivities() {
return (
<div>
<Table
columns={recentActivitiesColumns}
data={recentActivitiesData}
pagination={{ total: recentActivitiesData.length }}
/>
</div>
);
}
4 changes: 1 addition & 3 deletions Frontend/src/app/video-stream/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { VideoStreamContainer } from "@/containers";

export default function Home() {
export default function VideoStreamPage() {
return (
<main>
<VideoStreamContainer />
</main>
);
}
73 changes: 73 additions & 0 deletions Frontend/src/components/button/button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import {
ConfigProvider,
theme as antTheme,
Button as AntButton,
Tooltip,
} from "antd";
import type { ButtonProps } from "antd/es/button/button";
import { PropsWithChildren } from "react";
import { ColorVariant } from "@/types";
import { theme } from "../../../theme";

type PropsType = {
variant?: ColorVariant;
toolTipText?: string;
} & ButtonProps;

type ButtonWrapperPropsType = {
toolTipText?: string;
};

const getButtonColor = (variant: ColorVariant) => {
switch (variant) {
case "danger": {
return theme.colors.dangerColor;
}

case "warning": {
return theme.colors.warningColor;
}
}
return theme.colors.secondaryColor;
};

const { useToken } = antTheme;

const ButtonWrapper: React.FC<PropsWithChildren<ButtonWrapperPropsType>> = ({
toolTipText,
children,
}) => (
<>
{toolTipText ? <Tooltip title={toolTipText}>{children}</Tooltip> : children}
</>
);

/** This component renders a button */
export const Button: React.FC<PropsWithChildren<PropsType>> = ({
children,
variant = "primary",
toolTipText,
type = "primary",
...props
}) => {
const { token } = useToken();
const buttonColor: string = getButtonColor(variant);
const modifiedTheme = {
token: {
...token,
colorPrimary: buttonColor,
colorPrimaryHover: buttonColor + "AA",
colorPrimaryActive: buttonColor,
},
};

return (
<ConfigProvider theme={modifiedTheme}>
<ButtonWrapper toolTipText={toolTipText}>
<AntButton type="primary" {...props}>
{children}
</AntButton>
</ButtonWrapper>
</ConfigProvider>
);
};
20 changes: 20 additions & 0 deletions Frontend/src/components/card/card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { PropsWithChildren } from "react";

type PropsType = {
header?: React.ReactNode;
};

/** This component renders a card*/
export const Card: React.FC<PropsWithChildren<PropsType>> = ({
children,
header,
}) => {
return (
<div className="min-w-[200px] inline-block border-solid border border-gray-200 rounded-md shadow-md">
<div className="p-4 border-0 border-solid border-b border-gray-200 font-bold">
{header && <>{header}</>}
</div>
<div className="p-4">{children}</div>
</div>
);
};
3 changes: 3 additions & 0 deletions Frontend/src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
export { VideoRecordingScreen } from "./video-recording-screen/video-recording-screen";
export { Table } from "./table/table";
export { Button } from "./button/button";
export { Card } from "./card/card";
27 changes: 27 additions & 0 deletions Frontend/src/components/table/table.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import type { ColumnsType, TablePaginationConfig } from "antd/es/table";
import { Table as AntTable } from "antd";
import { AnyObject } from "@/types";

type PropsType<T extends AnyObject> = {
data: T[];
columns: ColumnsType<T>;
pagination?: TablePaginationConfig;
loading?: boolean;
};

/** This component renders a table */
export const Table: <T extends AnyObject>(
props: PropsType<T>
) => React.ReactElement = ({ columns, data, loading = false, pagination }) => {
return (
<div>
<AntTable
className="overflow-x-auto"
columns={columns}
dataSource={data}
loading={loading}
pagination={pagination ? pagination : false}
/>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"use client";
import type { FC } from "react";
import React from "react";
import { aboutUsData } from "@/data";

/* This container renders contact us sections */
export const AboutUsMissionContainer: FC = () => {
return (
<div className="grid md:grid-cols-2 gap-x-8 px-4 py-12">
<div>
<h2 className="text-center text-secondary">
{aboutUsData.missionHeading}
</h2>
<p className="leading-relaxed text-justify">{aboutUsData.missionParagraph}</p>
</div>
<div className="flex items-center">
<img
className="max-w-full rounded-lg"
src={aboutUsData.missionImage}
alt="Overview image"
/>
</div>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"use client";
import type { FC } from "react";
import React from "react";
import { aboutUsData } from "@/data";

/* This container renders contact us sections */
export const AboutUsOverviewContainer: FC = () => {
return (
<div className="grid md:grid-cols-2 gap-x-8 px-4 py-12">
<div>
<h2 className="text-center text-secondary">
{aboutUsData.overviewHeading}
</h2>
<p className="leading-relaxed text-justify">{aboutUsData.overviewParagraph}</p>
</div>
<div className="flex items-center">
<img
className="max-w-full rounded-lg"
src={aboutUsData.overviewImage}
alt="Overview image"
/>
</div>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"use client";
import type { FC } from "react";
import React from "react";
import { aboutUsData } from "@/data";

/* This container renders contact us sections */
export const AboutUsSolutionContainer: FC = () => {
return (
<div className="grid md:grid-cols-2 gap-x-8 bg-primary text-white px-4 py-12">
<div className="md:order-last">
<h2 className="text-center">
{aboutUsData.solutionHeading}
</h2>
<p className="leading-relaxed text-justify">{aboutUsData.solutionParagraph}</p>
</div>
<div className="flex items-center">
<img
className="max-w-full rounded-lg"
src={aboutUsData.solutionImage}
alt="Overview image"
/>
</div>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"use client";
import type { FC } from "react";
import React from "react";
import { aboutUsData } from "@/data";

/* This container renders contact us sections */
export const AboutUsTeamContainer: FC = () => {
return (
<div className="flex flex-col items-center bg-primary text-white px-4 py-12">
<h2 className="text-center">{aboutUsData.teamHeading}</h2>
<p className="leading-relaxed pb-3 sm:w-1/2 text-center">
{aboutUsData.teamParagraph}
</p>

<div className="grid grid-cols-1 sm:grid-cols-3 gap-x-8 gap-y-8">
{aboutUsData.teamMembers.map((item, index) => (
<div className="flex flex-col gap-y-4 items-center" key={index}>
<img
className="block rounded-lg w-full max-h-72 object-cover"
src={item.image}
alt="Overview image"
/>
<span className="font-bold text-lg">{item.name}</span>
<span className="">{item.title}</span>
</div>
))}
</div>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"use client";
import type { FC } from "react";
import React from "react";
import { AuthorizedCounterContainer } from "./authorized-counter/authorized-counter";
import { UnauthorizedCounterContainer } from "./unauthorized-counter/unauthorized-counter";
import { AuthorizedUnauthorizedPieContainer } from "./authorized-unauthorized-pie/authorized-unauthorized-pie";
import { AuthorizedUnauthorizedLineContainer } from "./authorized-unauthorized-line/authorized-unauthorized-line";
import { UserAreaBarContainer } from "./user-area-bar/user-area-bar";
import { RecentAuthorizedContainer } from "./recent-authorized/recent-authorized";
import { RecentUnauthorizedContainer } from "./recent-unauthorized/recent-unauthorized";

/* This container renders analytics sections */
export const AnalyticsContainer: FC = () => {
return (
<div>
<div className="grid gap-4 grid-cols-3">
<UnauthorizedCounterContainer />

<AuthorizedCounterContainer />

<AuthorizedUnauthorizedPieContainer />
</div>

<div className="grid pt-4 grid-cols-1">
<AuthorizedUnauthorizedLineContainer />
</div>
<div className="grid pt-4 grid-cols-1">
<UserAreaBarContainer />
</div>

<div className="grid py-4 gap-4 grid-cols-2">
<RecentAuthorizedContainer />

<RecentUnauthorizedContainer />
</div>
</div>
);
};
Loading

0 comments on commit 72f82e9

Please sign in to comment.