mirror of
https://gitea.gofwd.group/dstrawsb/ballistic-builder.git
synced 2025-12-06 02:36:44 -05:00
bunch of fixes
This commit is contained in:
@@ -3,7 +3,7 @@ import styles from '../styles.module.css';
|
||||
import PageHero from "@components/PageHero";
|
||||
import UsersTable from "@src/components/admin/UsersTable";
|
||||
import { Suspense } from "react";
|
||||
import Loading from "@src/app/components/Loading/loading";
|
||||
import Loading from "@src/components/Loading/loading";
|
||||
import { ColumnHeadings } from "@src/lib/utils";
|
||||
|
||||
export default async function UsersPage() {
|
||||
|
||||
@@ -3,7 +3,7 @@ import styles from '../styles.module.css';
|
||||
import PageHero from "@components/PageHero";
|
||||
import SortTable from "@components/SortTable";
|
||||
import { Suspense } from "react";
|
||||
import Loading from "@src/app/components/Loading/loading";
|
||||
import Loading from "@src/components/Loading/loading";
|
||||
|
||||
export default async function BarrelsPage() {
|
||||
const data = await getProductType('Barrels');
|
||||
|
||||
@@ -1,28 +1,19 @@
|
||||
'use client';
|
||||
import { getUserByUUID } from "@actions/userActions";
|
||||
import { NextPage } from "next";
|
||||
import { Herr_Von_Muellerhoff } from "next/font/google";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import { useParams, usePathname, useRouter } from "next/navigation";
|
||||
export default async function UserProfilePage(props: any) {
|
||||
|
||||
export default function UserProfilePage(props: any) {
|
||||
let a_user:any = "";
|
||||
const {uuid} = await props.params;
|
||||
|
||||
const router = useRouter();
|
||||
const params = useParams<{ uuid: string }>()
|
||||
const [user, setUser] = useState<{ uuid: string | null; id: string; username: string; email: string; emailVerifiedOn: Date | null; password_hash: string; first_name: string | null; last_name: string | null; full_name: string | null; isAdmin:boolean, buildPrivacySetting: string | null; } | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (params?.uuid) {
|
||||
getUserByUUID(params?.uuid as unknown as string)
|
||||
.then((user) => setUser(user))
|
||||
.catch((error) => console.error("Error fetching user data:", error));
|
||||
}
|
||||
}, [params?.uuid]);
|
||||
|
||||
if (!params || !params.uuid || !user ) {
|
||||
return <div>Loading...</div>;
|
||||
if (uuid) {
|
||||
a_user = await getUserByUUID(uuid as unknown as string);
|
||||
}
|
||||
|
||||
if (!props.params || !uuid || !a_user ) {
|
||||
return <div>Loading...</div>;
|
||||
}
|
||||
return (
|
||||
<div className="p-4 pt-16 mx-auto max-w-screen-lg">
|
||||
|
||||
@@ -30,16 +21,14 @@ if (!params || !params.uuid || !user ) {
|
||||
|
||||
{/* User Info */}
|
||||
<div>
|
||||
<h1 className="text-3xl font-bold mb-4"> User Profile </h1>
|
||||
|
||||
|
||||
<h1 className="text-3xl font-bold mb-4"> User Profile </h1>
|
||||
<div className="bg-white rounded-lg shadow-md p-4 mb-6">
|
||||
<h2 className="text-xl font-semibold mb-4">{user.first_name}{" "}{user.last_name} </h2>
|
||||
<h2 className="text-xl font-semibold mb-4">{user.email}</h2>
|
||||
<h2 className="text-xl font-semibold mb-4">{user.username} </h2>
|
||||
<h2 className="text-xl font-semibold mb-4">{(user.isAdmin)? "True":"False"} </h2>
|
||||
<h2 className="text-xl font-semibold mb-4">{user.first_name}{" "}{user.last_name} </h2>
|
||||
<h2 className="text-xl font-semibold mb-4">{user.first_name}{" "}{user.last_name} </h2>
|
||||
<h2 className="text-xl font-semibold mb-4">{a_user.first_name}{" "}{a_user.last_name} </h2>
|
||||
<h2 className="text-xl font-semibold mb-4">{a_user.email}</h2>
|
||||
<h2 className="text-xl font-semibold mb-4">{a_user.username} </h2>
|
||||
<h2 className="text-xl font-semibold mb-4">{(a_user.isAdmin)? "True":"False"} </h2>
|
||||
<h2 className="text-xl font-semibold mb-4">{a_user.first_name}{" "}{a_user.last_name} </h2>
|
||||
<h2 className="text-xl font-semibold mb-4">{a_user.first_name}{" "}{a_user.last_name} </h2>
|
||||
<div className="overflow-x-auto">
|
||||
|
||||
</div>
|
||||
|
||||
@@ -6,7 +6,7 @@ import styles from '../styles.module.css';
|
||||
import PageHero from "@components/PageHero";
|
||||
|
||||
import { Suspense } from "react";
|
||||
import Loading from "@src/app/components/Loading/loading";
|
||||
import Loading from "@src/components/Loading/loading";
|
||||
import Link from "next/link";
|
||||
|
||||
export default async function AccountsTable( props: any ) {
|
||||
@@ -70,7 +70,7 @@ export default async function AccountsTable( props: any ) {
|
||||
<tr key={item.uuid}>
|
||||
<td className="whitespace-wrap flex items-center py-4 pl-4 pr-3 text-xs font-medium text-gray-900 ">
|
||||
|
||||
<Link href={`/userProfile/${item.uuid}`}><span className="pl-2"> {item.first_name}</span></Link>
|
||||
<Link href={`/UserProfile/${item.uuid}`}><span className="pl-2"> {item.first_name}</span></Link>
|
||||
</td>
|
||||
<td className="whitespace-nowrap px-3 py-4 text-xs text-gray-900">
|
||||
{item.last_name}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
"use client";
|
||||
import { FC, useState } from "react";
|
||||
import { brandType } from "src/types/brandType";
|
||||
import { brandType } from "@lib/types/brandType";
|
||||
import Brand from "./brand";
|
||||
import AddBrand from "./addBrand";
|
||||
import { addBrand, deleteBrand, editBrand } from "../../actions/brandActions";
|
||||
import Footer from "@src/app/site/Footer/page";
|
||||
import Footer from "@src/app/(siteInfo)/Footer/page";
|
||||
import constants from "@src/lib/constants";
|
||||
interface Props {
|
||||
brands: brandType[];
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
"use client";
|
||||
import { FC, useState } from "react";
|
||||
import { componentTypeType } from "src/types/componentTypeType";
|
||||
import { componentTypeType } from "@lib/types/componentTypeType";
|
||||
import { componentType } from './componentType'
|
||||
// import AddBrand from "./addBrand";
|
||||
import { getData } from "src/actions/componentTypeActions";
|
||||
import { getData } from "@actions/componentTypeActions";
|
||||
import constants from "@src/lib/constants";
|
||||
|
||||
interface Props {
|
||||
componentType: componentType[];
|
||||
componentType: any[];
|
||||
}
|
||||
|
||||
const ComponentTypeList: FC<Props> = ({ componentType }) => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
import { ChangeEvent, FC, useState } from "react";
|
||||
import { componentTypeType } from "src/types/componentTypeType";
|
||||
import { componentTypeType } from "@lib/types/componentTypeType";
|
||||
|
||||
interface Props {
|
||||
componentType: componentTypeType;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { PlusCircleIcon } from "@heroicons/react/20/solid";
|
||||
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { TestProductPage } from "@src/app/components/TestProductPage";
|
||||
import { TestProductPage } from "@src/components/TestProductPage";
|
||||
|
||||
export default async function SortTable(props: any) {
|
||||
return (
|
||||
|
||||
@@ -92,7 +92,7 @@ export default async function UsersTable(props: any) {
|
||||
<tr key={item.uuid}>
|
||||
<td className="whitespace-wrap flex items-center py-4 pl-4 pr-3 text-xs font-medium text-gray-900 ">
|
||||
|
||||
<Link href={`/userProfile/${item.uuid}`}><span className="pl-2"> {item.email}</span></Link>
|
||||
<Link href={`/UserProfile/${item.uuid}`}><span className="pl-2"> {item.email}</span></Link>
|
||||
</td>
|
||||
<td className="whitespace-nowrap px-3 py-4 text-xs text-gray-900">
|
||||
{item.first_name}
|
||||
|
||||
Reference in New Issue
Block a user