@@ -2,6 +2,13 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.2.38](https://github.com/bipproduction/hipmi/compare/v1.2.37...v1.2.38) (2025-01-03)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* user ([215accb](https://github.com/bipproduction/hipmi/commit/215accbcaa989e43f43dfc5f400d5411013f4ef3))
|
||||||
|
|
||||||
## [1.2.37](https://github.com/bipproduction/hipmi/compare/v1.2.36...v1.2.37) (2025-01-02)
|
## [1.2.37](https://github.com/bipproduction/hipmi/compare/v1.2.36...v1.2.37) (2025-01-02)
|
||||||
|
|
||||||
## [1.2.36](https://github.com/bipproduction/hipmi/compare/v1.2.35...v1.2.36) (2024-12-30)
|
## [1.2.36](https://github.com/bipproduction/hipmi/compare/v1.2.35...v1.2.36) (2024-12-30)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hipmi",
|
"name": "hipmi",
|
||||||
"version": "1.2.37",
|
"version": "1.2.38",
|
||||||
"private": true,
|
"private": true,
|
||||||
"prisma": {
|
"prisma": {
|
||||||
"seed": "npx tsx prisma/seed.ts --yes"
|
"seed": "npx tsx prisma/seed.ts --yes"
|
||||||
|
|||||||
@@ -1,19 +1,12 @@
|
|||||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { funGlobal_checkActivationUseById } from "@/app_modules/_global/fun/get/fun_check_activation_use_by_id";
|
|
||||||
import WaitingRoom_View from "@/app_modules/waiting_room/view";
|
import WaitingRoom_View from "@/app_modules/waiting_room/view";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const userLoginId = await funGetUserIdByToken();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
const activationUser = await funGlobal_checkActivationUseById({
|
|
||||||
userId: userLoginId as string,
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<WaitingRoom_View
|
<WaitingRoom_View userLoginId={userLoginId as string} />
|
||||||
activationUser={activationUser as boolean}
|
|
||||||
userLoginId={userLoginId as string}
|
|
||||||
/>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
53
src/app/api/user/activation/route.ts
Normal file
53
src/app/api/user/activation/route.ts
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
import { prisma } from "@/app/lib";
|
||||||
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
|
import backendLogger from "@/util/backendLogger";
|
||||||
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
|
export const dynamic = "force-dynamic";
|
||||||
|
|
||||||
|
export async function GET(request: Request) {
|
||||||
|
try {
|
||||||
|
let fixData
|
||||||
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
|
if (userLoginId == null) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Gagal mendapatkan data, user id tidak ada",
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const activationUser = await prisma.user.findFirst({
|
||||||
|
where: {
|
||||||
|
id: userLoginId,
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
active: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
fixData = activationUser?.active
|
||||||
|
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: true,
|
||||||
|
message: "Berhasil mendapatkan data",
|
||||||
|
data: fixData,
|
||||||
|
},
|
||||||
|
{ status: 200 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
backendLogger.error("Error get activation user: ", error);
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Gagal mendapatkan data",
|
||||||
|
reason: (error as Error).message,
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,9 +1,16 @@
|
|||||||
|
|
||||||
import { NextResponse } from "next/server";
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
|
|
||||||
export async function GET(req: Request) {
|
export async function GET(req: Request) {
|
||||||
const auth = req.headers.get("Authorization");
|
const auth = req.headers.get("Authorization");
|
||||||
const token = auth?.split(" ")[1];
|
const token = auth?.split(" ")[1];
|
||||||
if (!token) return NextResponse.json({ success: false }, { status: 401 });
|
|
||||||
return NextResponse.json({ success: true });
|
|
||||||
|
|
||||||
|
console.log("validasi atas", token);
|
||||||
|
|
||||||
|
if (!token) return NextResponse.json({ success: false }, { status: 401 });
|
||||||
|
|
||||||
|
console.log("validasi bawah", token);
|
||||||
|
|
||||||
|
return NextResponse.json({ success: true });
|
||||||
}
|
}
|
||||||
@@ -5,7 +5,8 @@ import {
|
|||||||
UIGlobal_LayoutHeaderTamplate,
|
UIGlobal_LayoutHeaderTamplate,
|
||||||
UIGlobal_LayoutTamplate,
|
UIGlobal_LayoutTamplate,
|
||||||
} from "@/app_modules/_global/ui";
|
} from "@/app_modules/_global/ui";
|
||||||
import { Grid, Skeleton, Stack } from "@mantine/core";
|
import { Button, Grid, Skeleton, Stack } from "@mantine/core";
|
||||||
|
import Link from "next/link";
|
||||||
|
|
||||||
export default function Voting_ComponentSkeletonViewPuh() {
|
export default function Voting_ComponentSkeletonViewPuh() {
|
||||||
return (
|
return (
|
||||||
@@ -13,6 +14,25 @@ export default function Voting_ComponentSkeletonViewPuh() {
|
|||||||
<UIGlobal_LayoutTamplate
|
<UIGlobal_LayoutTamplate
|
||||||
header={<UIGlobal_LayoutHeaderTamplate title="Skeleton Maker" />}
|
header={<UIGlobal_LayoutHeaderTamplate title="Skeleton Maker" />}
|
||||||
>
|
>
|
||||||
|
<Button
|
||||||
|
|
||||||
|
>
|
||||||
|
<Link
|
||||||
|
color="white"
|
||||||
|
style={{
|
||||||
|
color: "white",
|
||||||
|
textDecoration: "none",
|
||||||
|
}}
|
||||||
|
target="_blank"
|
||||||
|
href={
|
||||||
|
"https://wa.me/+6281339158911?text=Hallo , Apa boleh saya minta informasi tentang DariBaliMice?"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{" "}
|
||||||
|
Kirim
|
||||||
|
</Link>
|
||||||
|
</Button>
|
||||||
|
|
||||||
<Stack>
|
<Stack>
|
||||||
<ComponentGlobal_CardStyles marginBottom={"0"}>
|
<ComponentGlobal_CardStyles marginBottom={"0"}>
|
||||||
<Stack>
|
<Stack>
|
||||||
|
|||||||
9
src/app_modules/_global/lib/api_user.ts
Normal file
9
src/app_modules/_global/lib/api_user.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
export const apiGetCookiesUser = async () => {
|
||||||
|
const response = await fetch(`/api/user/get`);
|
||||||
|
return await response.json().catch(() => null);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const apiGetACtivationUser = async () => {
|
||||||
|
const response = await fetch(`/api/user/activation`);
|
||||||
|
return await response.json().catch(() => null);
|
||||||
|
};
|
||||||
@@ -44,7 +44,7 @@ export default function AdminDeveloper({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack>
|
<Stack>
|
||||||
<ComponentAdminGlobal_HeaderTamplate name="Developer" />
|
<ComponentAdminGlobal_HeaderTamplate name="Super Admin" />
|
||||||
<SimpleGrid cols={2} spacing={50}>
|
<SimpleGrid cols={2} spacing={50}>
|
||||||
{/* <TableAdmin
|
{/* <TableAdmin
|
||||||
dataAdmin={dataAdmin}
|
dataAdmin={dataAdmin}
|
||||||
@@ -148,7 +148,7 @@ function NewTableUser({
|
|||||||
p={"xs"}
|
p={"xs"}
|
||||||
style={{ borderRadius: "6px" }}
|
style={{ borderRadius: "6px" }}
|
||||||
>
|
>
|
||||||
<Title order={4}>Table User NEW</Title>
|
<Title order={4}>Table User</Title>
|
||||||
<TextInput
|
<TextInput
|
||||||
icon={<IconSearch size={20} />}
|
icon={<IconSearch size={20} />}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
|
|||||||
@@ -297,10 +297,10 @@ export const newListAdminPage = [
|
|||||||
child: [],
|
child: [],
|
||||||
},
|
},
|
||||||
|
|
||||||
// Developer
|
// Developer | Super Admin
|
||||||
{
|
{
|
||||||
id: "Developer",
|
id: "Super Admin",
|
||||||
name: "Developer",
|
name: "Super Admin",
|
||||||
path: RouterAdminDeveloper.main,
|
path: RouterAdminDeveloper.main,
|
||||||
icon: <IconDashboard />,
|
icon: <IconDashboard />,
|
||||||
child: [],
|
child: [],
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||||
|
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||||
import { MODEL_USER } from "@/app_modules/home/model/interface";
|
import { MODEL_USER } from "@/app_modules/home/model/interface";
|
||||||
|
import { clientLogger } from "@/util/clientLogger";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Center,
|
Center,
|
||||||
@@ -14,48 +17,67 @@ import {
|
|||||||
Title,
|
Title,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { IconSearch } from "@tabler/icons-react";
|
import { IconSearch } from "@tabler/icons-react";
|
||||||
import adminUserAccess_funEditAccess from "../fun/edit/fun_edit_access";
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
import adminUserAccess_funEditAccess from "../fun/edit/fun_edit_access";
|
||||||
import adminUserAccess_getListUser from "../fun/get/get_list_all_user";
|
import adminUserAccess_getListUser from "../fun/get/get_list_all_user";
|
||||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
|
||||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
|
||||||
|
|
||||||
export default function AdminUserAccess_View({ listUser }: { listUser: any }) {
|
export default function AdminUserAccess_View({ listUser }: { listUser: any }) {
|
||||||
const [data, setData] = useState<MODEL_USER[]>(listUser.data);
|
const [data, setData] = useState<MODEL_USER[]>(listUser.data);
|
||||||
const [isActivePage, setActivePage] = useState(1);
|
const [isActivePage, setActivePage] = useState(1);
|
||||||
const [isNPage, setNPage] = useState(listUser.nPage);
|
const [isNPage, setNPage] = useState(listUser.nPage);
|
||||||
const [isSearch, setSearch] = useState("");
|
const [isSearch, setSearch] = useState("");
|
||||||
|
const [isLoadingAccess, setIsLoadingAccess] = useState(false);
|
||||||
|
const [isLoadingDelete, setIsLoadingDelete] = useState(false);
|
||||||
|
const [userId, setUserId] = useState("");
|
||||||
|
|
||||||
async function onAccess(id: string) {
|
async function onAccess(id: string) {
|
||||||
await adminUserAccess_funEditAccess(id, true).then(async (res) => {
|
try {
|
||||||
if (res.status === 200) {
|
setUserId(id);
|
||||||
const value = await adminUserAccess_getListUser({
|
setIsLoadingAccess(true);
|
||||||
page: 1,
|
await adminUserAccess_funEditAccess(id, true).then(async (res) => {
|
||||||
search: isSearch,
|
if (res.status === 200) {
|
||||||
});
|
const value = await adminUserAccess_getListUser({
|
||||||
setData(value.data as any);
|
page: 1,
|
||||||
setNPage(value.nPage);
|
search: isSearch,
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
});
|
||||||
} else {
|
setData(value.data as any);
|
||||||
ComponentGlobal_NotifikasiGagal(res.message);
|
setNPage(value.nPage);
|
||||||
}
|
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||||
});
|
} else {
|
||||||
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
clientLogger.error("Error grand access", error);
|
||||||
|
} finally {
|
||||||
|
setIsLoadingAccess(false);
|
||||||
|
setUserId("");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onDelAccess(id: string) {
|
async function onDelete(id: string) {
|
||||||
await adminUserAccess_funEditAccess(id, false).then(async (res) => {
|
try {
|
||||||
if (res.status === 200) {
|
setUserId(id);
|
||||||
const value = await adminUserAccess_getListUser({
|
setIsLoadingDelete(true);
|
||||||
page: 1,
|
await adminUserAccess_funEditAccess(id, false).then(async (res) => {
|
||||||
search: isSearch,
|
if (res.status === 200) {
|
||||||
});
|
const value = await adminUserAccess_getListUser({
|
||||||
setData(value.data as any);
|
page: 1,
|
||||||
setNPage(value.nPage);
|
search: isSearch,
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
});
|
||||||
} else {
|
setData(value.data as any);
|
||||||
ComponentGlobal_NotifikasiGagal(res.message);
|
setNPage(value.nPage);
|
||||||
}
|
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||||
});
|
} else {
|
||||||
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
clientLogger.error("Error delete access", error);
|
||||||
|
} finally {
|
||||||
|
setIsLoadingDelete(false);
|
||||||
|
setUserId("");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onSearch(s: any) {
|
async function onSearch(s: any) {
|
||||||
@@ -91,22 +113,26 @@ export default function AdminUserAccess_View({ listUser }: { listUser: any }) {
|
|||||||
{e.active === false ? (
|
{e.active === false ? (
|
||||||
<Center>
|
<Center>
|
||||||
<Button
|
<Button
|
||||||
|
loaderPosition="center"
|
||||||
|
loading={isLoadingAccess && userId === e.id}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
color="Green"
|
color="Green"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
onAccess(e.id);
|
onAccess(e.id);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Give Access
|
Grand Access
|
||||||
</Button>
|
</Button>
|
||||||
</Center>
|
</Center>
|
||||||
) : (
|
) : (
|
||||||
<Center>
|
<Center>
|
||||||
<Button
|
<Button
|
||||||
|
loaderPosition="center"
|
||||||
|
loading={isLoadingDelete && userId === e.id}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
color="red"
|
color="red"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
onDelAccess(e.id);
|
onDelete(e.id);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Delete Access
|
Delete Access
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export function Portofolio_ComponentButtonSelanjutnya({
|
|||||||
profileId: string;
|
profileId: string;
|
||||||
dataPortofolio: MODEL_PORTOFOLIO_OLD;
|
dataPortofolio: MODEL_PORTOFOLIO_OLD;
|
||||||
dataMedsos: any;
|
dataMedsos: any;
|
||||||
imageId: string
|
imageId: string;
|
||||||
}) {
|
}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
@@ -36,11 +36,18 @@ export function Portofolio_ComponentButtonSelanjutnya({
|
|||||||
deskripsi: dataPortofolio.deskripsi,
|
deskripsi: dataPortofolio.deskripsi,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (_.values(porto).includes("")) {
|
||||||
|
ComponentGlobal_NotifikasiPeringatan("Lengkapi Data");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dataPortofolio.tlpn.length < 10) {
|
||||||
|
ComponentGlobal_NotifikasiPeringatan("Nomor telepon minimal 10 angka");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
if (_.values(porto).includes("")) {
|
|
||||||
return ComponentGlobal_NotifikasiPeringatan("Lengkapi Data");
|
|
||||||
}
|
|
||||||
const res = await funCreatePortofolio({
|
const res = await funCreatePortofolio({
|
||||||
profileId: profileId,
|
profileId: profileId,
|
||||||
data: dataPortofolio as any,
|
data: dataPortofolio as any,
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ import {
|
|||||||
funGlobal_UploadToStorage,
|
funGlobal_UploadToStorage,
|
||||||
} from "@/app_modules/_global/fun";
|
} from "@/app_modules/_global/fun";
|
||||||
import { DIRECTORY_ID } from "@/app/lib";
|
import { DIRECTORY_ID } from "@/app/lib";
|
||||||
|
import { PhoneInput } from "react-international-phone";
|
||||||
|
import "react-international-phone/style.css";
|
||||||
|
|
||||||
export default function CreatePortofolio({
|
export default function CreatePortofolio({
|
||||||
bidangBisnis,
|
bidangBisnis,
|
||||||
@@ -69,12 +71,12 @@ export default function CreatePortofolio({
|
|||||||
label: {
|
label: {
|
||||||
color: MainColor.white,
|
color: MainColor.white,
|
||||||
},
|
},
|
||||||
input: {
|
// input: {
|
||||||
backgroundColor: MainColor.white
|
// backgroundColor: MainColor.white,
|
||||||
},
|
// },
|
||||||
required: {
|
// required: {
|
||||||
color: MainColor.red,
|
// color: MainColor.red,
|
||||||
}
|
// },
|
||||||
}}
|
}}
|
||||||
withAsterisk
|
withAsterisk
|
||||||
label="Nama Bisnis"
|
label="Nama Bisnis"
|
||||||
@@ -88,17 +90,16 @@ export default function CreatePortofolio({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Select
|
<Select
|
||||||
|
|
||||||
styles={{
|
styles={{
|
||||||
label: {
|
label: {
|
||||||
color: MainColor.white,
|
color: MainColor.white,
|
||||||
},
|
},
|
||||||
input: {
|
// input: {
|
||||||
backgroundColor: MainColor.white
|
// backgroundColor: MainColor.white,
|
||||||
},
|
// },
|
||||||
required: {
|
// required: {
|
||||||
color: MainColor.red,
|
// color: MainColor.red,
|
||||||
}
|
// },
|
||||||
}}
|
}}
|
||||||
withAsterisk
|
withAsterisk
|
||||||
label="Bidang Bisnis"
|
label="Bidang Bisnis"
|
||||||
@@ -114,17 +115,18 @@ export default function CreatePortofolio({
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextInput
|
<TextInput
|
||||||
styles={{
|
styles={{
|
||||||
label: {
|
label: {
|
||||||
color: MainColor.white,
|
color: MainColor.white,
|
||||||
},
|
},
|
||||||
input: {
|
// input: {
|
||||||
backgroundColor: MainColor.white
|
// backgroundColor: MainColor.white,
|
||||||
},
|
// },
|
||||||
required: {
|
// required: {
|
||||||
color: MainColor.red,
|
// color: MainColor.red,
|
||||||
}
|
// },
|
||||||
}}
|
}}
|
||||||
withAsterisk
|
withAsterisk
|
||||||
label="Alamat Bisnis"
|
label="Alamat Bisnis"
|
||||||
@@ -137,17 +139,40 @@ export default function CreatePortofolio({
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<TextInput
|
|
||||||
|
<Stack spacing={5}>
|
||||||
|
<Text c={MainColor.white} fz={"sm"}>
|
||||||
|
Nomor Telepon{" "}
|
||||||
|
<Text c={"red"} span inherit>
|
||||||
|
*
|
||||||
|
</Text>
|
||||||
|
</Text>
|
||||||
|
|
||||||
|
<PhoneInput
|
||||||
|
placeholder="Nomor telepon"
|
||||||
|
inputStyle={{ width: "100%" }}
|
||||||
|
defaultCountry="id"
|
||||||
|
onChange={(val) => {
|
||||||
|
const valPhone = val.substring(1);
|
||||||
|
setDataPortofolio({
|
||||||
|
...dataPortofolio,
|
||||||
|
tlpn: valPhone,
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
|
||||||
|
{/* <TextInput
|
||||||
styles={{
|
styles={{
|
||||||
label: {
|
label: {
|
||||||
color: MainColor.white,
|
color: MainColor.white,
|
||||||
},
|
},
|
||||||
input: {
|
// input: {
|
||||||
backgroundColor: MainColor.white
|
// backgroundColor: MainColor.white,
|
||||||
},
|
// },
|
||||||
required: {
|
// required: {
|
||||||
color: MainColor.red,
|
// color: MainColor.red,
|
||||||
}
|
// },
|
||||||
}}
|
}}
|
||||||
withAsterisk
|
withAsterisk
|
||||||
label="Nomor Telepon "
|
label="Nomor Telepon "
|
||||||
@@ -159,19 +184,20 @@ export default function CreatePortofolio({
|
|||||||
tlpn: val.target.value,
|
tlpn: val.target.value,
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
/>
|
/> */}
|
||||||
|
|
||||||
<Stack spacing={5}>
|
<Stack spacing={5}>
|
||||||
<Textarea
|
<Textarea
|
||||||
styles={{
|
styles={{
|
||||||
label: {
|
label: {
|
||||||
color: MainColor.white,
|
color: MainColor.white,
|
||||||
},
|
},
|
||||||
input: {
|
// input: {
|
||||||
backgroundColor: MainColor.white
|
// backgroundColor: MainColor.white,
|
||||||
},
|
// },
|
||||||
required: {
|
// required: {
|
||||||
color: MainColor.red,
|
// color: MainColor.red,
|
||||||
}
|
// },
|
||||||
}}
|
}}
|
||||||
maxLength={300}
|
maxLength={300}
|
||||||
autosize
|
autosize
|
||||||
@@ -208,7 +234,9 @@ export default function CreatePortofolio({
|
|||||||
</AspectRatio>
|
</AspectRatio>
|
||||||
) : (
|
) : (
|
||||||
<Stack spacing={5} justify="center" align="center" h={"100%"}>
|
<Stack spacing={5} justify="center" align="center" h={"100%"}>
|
||||||
<Title c={MainColor.white} order={3}>Upload Logo Bisnis</Title>
|
<Title c={MainColor.white} order={3}>
|
||||||
|
Upload Logo Bisnis
|
||||||
|
</Title>
|
||||||
<Text c={MainColor.white} fs={"italic"} fz={10} align="center">
|
<Text c={MainColor.white} fs={"italic"} fz={10} align="center">
|
||||||
Masukan logo bisnis anda untuk ditampilkan dalam portofolio
|
Masukan logo bisnis anda untuk ditampilkan dalam portofolio
|
||||||
</Text>
|
</Text>
|
||||||
@@ -308,9 +336,9 @@ export default function CreatePortofolio({
|
|||||||
label: {
|
label: {
|
||||||
color: MainColor.white,
|
color: MainColor.white,
|
||||||
},
|
},
|
||||||
input: {
|
// input: {
|
||||||
backgroundColor: MainColor.white
|
// backgroundColor: MainColor.white,
|
||||||
}
|
// },
|
||||||
}}
|
}}
|
||||||
label="Facebook"
|
label="Facebook"
|
||||||
maxLength={100}
|
maxLength={100}
|
||||||
@@ -327,9 +355,9 @@ export default function CreatePortofolio({
|
|||||||
label: {
|
label: {
|
||||||
color: MainColor.white,
|
color: MainColor.white,
|
||||||
},
|
},
|
||||||
input: {
|
// input: {
|
||||||
backgroundColor: MainColor.white
|
// backgroundColor: MainColor.white,
|
||||||
}
|
// },
|
||||||
}}
|
}}
|
||||||
label="Instagram"
|
label="Instagram"
|
||||||
maxLength={100}
|
maxLength={100}
|
||||||
@@ -346,9 +374,9 @@ export default function CreatePortofolio({
|
|||||||
label: {
|
label: {
|
||||||
color: MainColor.white,
|
color: MainColor.white,
|
||||||
},
|
},
|
||||||
input: {
|
// input: {
|
||||||
backgroundColor: MainColor.white
|
// backgroundColor: MainColor.white,
|
||||||
}
|
// },
|
||||||
}}
|
}}
|
||||||
label="Tiktok"
|
label="Tiktok"
|
||||||
maxLength={100}
|
maxLength={100}
|
||||||
@@ -365,9 +393,9 @@ export default function CreatePortofolio({
|
|||||||
label: {
|
label: {
|
||||||
color: MainColor.white,
|
color: MainColor.white,
|
||||||
},
|
},
|
||||||
input: {
|
// input: {
|
||||||
backgroundColor: MainColor.white
|
// backgroundColor: MainColor.white,
|
||||||
}
|
// },
|
||||||
}}
|
}}
|
||||||
label="Twitter"
|
label="Twitter"
|
||||||
maxLength={100}
|
maxLength={100}
|
||||||
@@ -384,9 +412,9 @@ export default function CreatePortofolio({
|
|||||||
label: {
|
label: {
|
||||||
color: MainColor.white,
|
color: MainColor.white,
|
||||||
},
|
},
|
||||||
input: {
|
// input: {
|
||||||
backgroundColor: MainColor.white
|
// backgroundColor: MainColor.white,
|
||||||
}
|
// },
|
||||||
}}
|
}}
|
||||||
label="Youtube"
|
label="Youtube"
|
||||||
maxLength={100}
|
maxLength={100}
|
||||||
|
|||||||
@@ -1,131 +1,186 @@
|
|||||||
import { AccentColor, MainColor } from "@/app_modules/_global/color";
|
import { AccentColor, MainColor } from "@/app_modules/_global/color";
|
||||||
import { ComponentGlobal_LoadImage } from "@/app_modules/_global/component";
|
import { ComponentGlobal_LoadImage } from "@/app_modules/_global/component";
|
||||||
import { Box, Divider, Grid, Group, Paper, SimpleGrid, Stack, Text, Title } from "@mantine/core";
|
import {
|
||||||
|
Box,
|
||||||
|
Button,
|
||||||
|
Divider,
|
||||||
|
Grid,
|
||||||
|
Group,
|
||||||
|
Paper,
|
||||||
|
SimpleGrid,
|
||||||
|
Stack,
|
||||||
|
Text,
|
||||||
|
Title,
|
||||||
|
} from "@mantine/core";
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
import { IconBuildingSkyscraper, IconListDetails, IconMapPin, IconPhoneCall, IconPinned } from "@tabler/icons-react";
|
import {
|
||||||
|
IconBuildingSkyscraper,
|
||||||
|
IconListDetails,
|
||||||
|
IconMapPin,
|
||||||
|
IconPhoneCall,
|
||||||
|
IconPinned,
|
||||||
|
} from "@tabler/icons-react";
|
||||||
import { useParams } from "next/navigation";
|
import { useParams } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { apiGetOnePortofolioById } from "../lib/api_portofolio";
|
import { apiGetOnePortofolioById } from "../lib/api_portofolio";
|
||||||
import { IDetailPortofolioBisnis } from "../lib/type_portofolio";
|
import { IDetailPortofolioBisnis } from "../lib/type_portofolio";
|
||||||
import SkeletonDetailBisnis from "./ui_skeleton_detail_bisnis";
|
import SkeletonDetailBisnis from "./ui_skeleton_detail_bisnis";
|
||||||
|
import { UIGlobal_Modal } from "@/app_modules/_global/ui";
|
||||||
|
import Link from "next/link";
|
||||||
|
|
||||||
export default function Portofolio_UiDetailDataNew() {
|
export default function Portofolio_UiDetailDataNew() {
|
||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true);
|
||||||
const param = useParams<{ id: string }>()
|
const param = useParams<{ id: string }>();
|
||||||
const [dataPorto, setDataPorto] = useState<IDetailPortofolioBisnis>();
|
const [dataPorto, setDataPorto] = useState<IDetailPortofolioBisnis>();
|
||||||
|
const [openModal, setOpenModal] = useState(false);
|
||||||
|
|
||||||
async function funGetPortofolio() {
|
async function funGetPortofolio() {
|
||||||
try {
|
try {
|
||||||
setLoading(true)
|
setLoading(true);
|
||||||
const response = await apiGetOnePortofolioById(param.id, "bisnis");
|
const response = await apiGetOnePortofolioById(param.id, "bisnis");
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
setDataPorto(response.data);
|
setDataPorto(response.data);
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
} finally {
|
|
||||||
setLoading(false)
|
|
||||||
}
|
}
|
||||||
}
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
useShallowEffect(() => {
|
useShallowEffect(() => {
|
||||||
funGetPortofolio()
|
funGetPortofolio();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Paper
|
<Paper
|
||||||
p={"sm"}
|
p={"sm"}
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: AccentColor.darkblue,
|
backgroundColor: AccentColor.darkblue,
|
||||||
border: `2px solid ${AccentColor.blue}`,
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
borderRadius: "10px ",
|
borderRadius: "10px ",
|
||||||
padding: "15px",
|
padding: "15px",
|
||||||
color: MainColor.white,
|
color: MainColor.white,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{
|
{loading ? (
|
||||||
loading ?
|
<SkeletonDetailBisnis />
|
||||||
<SkeletonDetailBisnis />
|
) : (
|
||||||
:
|
<Stack>
|
||||||
<Stack>
|
<Group position="apart">
|
||||||
<Group position="apart">
|
<Title order={6}>Data Bisnis</Title>
|
||||||
<Title order={6}>Data Bisnis</Title>
|
<Text color={MainColor.yellow} fw={"bold"}>
|
||||||
<Text color={MainColor.yellow} fw={"bold"}>
|
id: {" "}
|
||||||
id: {" "}
|
<Text span inherit>
|
||||||
<Text span inherit>
|
#{dataPorto?.id_Portofolio}
|
||||||
#{dataPorto?.id_Portofolio}
|
</Text>
|
||||||
</Text>
|
</Text>
|
||||||
</Text>
|
</Group>
|
||||||
</Group>
|
<Stack>
|
||||||
<Stack>
|
<SimpleGrid
|
||||||
<SimpleGrid
|
cols={2}
|
||||||
cols={2}
|
spacing={"md"}
|
||||||
spacing={"md"}
|
breakpoints={[
|
||||||
breakpoints={[
|
{ maxWidth: "62rem", cols: 2, spacing: "md" },
|
||||||
{ maxWidth: "62rem", cols: 2, spacing: "md" },
|
{ maxWidth: "48rem", cols: 1, spacing: "sm" },
|
||||||
{ maxWidth: "48rem", cols: 1, spacing: "sm" },
|
{ maxWidth: "36rem", cols: 1, spacing: "sm" },
|
||||||
{ maxWidth: "36rem", cols: 1, spacing: "sm" },
|
]}
|
||||||
]}
|
>
|
||||||
>
|
<Box>
|
||||||
<Box>
|
<Paper>
|
||||||
<Paper>
|
<ComponentGlobal_LoadImage
|
||||||
<ComponentGlobal_LoadImage fileId={String(dataPorto?.logoId)} />
|
fileId={String(dataPorto?.logoId)}
|
||||||
</Paper>
|
/>
|
||||||
</Box>
|
</Paper>
|
||||||
|
</Box>
|
||||||
|
|
||||||
<Box>
|
<Box>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.Col span={2}>
|
<Grid.Col span={2}>
|
||||||
<IconBuildingSkyscraper />
|
<IconBuildingSkyscraper />
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={"auto"}>
|
<Grid.Col span={"auto"}>
|
||||||
<Text>{dataPorto?.namaBisnis}</Text>
|
<Text>{dataPorto?.namaBisnis}</Text>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.Col span={2}>
|
<Grid.Col span={2}>
|
||||||
<IconListDetails />
|
<IconListDetails />
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={"auto"}>
|
<Grid.Col span={"auto"}>
|
||||||
<Text>{dataPorto?.bidangBisnis}</Text>
|
<Text>{dataPorto?.bidangBisnis}</Text>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.Col span={2}>
|
<Grid.Col span={2}>
|
||||||
<IconPhoneCall />
|
<IconPhoneCall />
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={"auto"}>
|
<Grid.Col span={"auto"}>
|
||||||
<Text>{dataPorto?.tlpn}</Text>
|
<Text
|
||||||
</Grid.Col>
|
onClick={() => {
|
||||||
</Grid>
|
setOpenModal(true);
|
||||||
<Grid>
|
}}
|
||||||
<Grid.Col span={2}>
|
>
|
||||||
<IconMapPin />
|
+ {dataPorto?.tlpn}
|
||||||
</Grid.Col>
|
</Text>
|
||||||
<Grid.Col span={"auto"}>
|
</Grid.Col>
|
||||||
<Text>{dataPorto?.alamatKantor}</Text>
|
</Grid>
|
||||||
</Grid.Col>
|
<Grid>
|
||||||
</Grid>
|
<Grid.Col span={2}>
|
||||||
</Box>
|
<IconMapPin />
|
||||||
</SimpleGrid>
|
</Grid.Col>
|
||||||
</Stack>
|
<Grid.Col span={"auto"}>
|
||||||
|
<Text>{dataPorto?.alamatKantor}</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
</Box>
|
||||||
|
</SimpleGrid>
|
||||||
|
</Stack>
|
||||||
|
|
||||||
<Divider color={AccentColor.softblue} />
|
<Divider color={AccentColor.softblue} />
|
||||||
|
|
||||||
<Stack spacing={5}>
|
<Stack spacing={5}>
|
||||||
<Group spacing={"xs"}>
|
<Group spacing={"xs"}>
|
||||||
<IconPinned />
|
<IconPinned />
|
||||||
<Text fz={"sm"} fw={"bold"}>
|
<Text fz={"sm"} fw={"bold"}>
|
||||||
Tentang Kami
|
Tentang Kami
|
||||||
</Text>
|
</Text>
|
||||||
</Group>
|
</Group>
|
||||||
<Text px={"sm"}>{dataPorto?.deskripsi}</Text>
|
<Text px={"sm"}>{dataPorto?.deskripsi}</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
}
|
)}
|
||||||
|
</Paper>
|
||||||
|
|
||||||
</Paper>
|
<UIGlobal_Modal
|
||||||
</>
|
title={
|
||||||
)
|
"Anda akan dialihkan ke WhatsApp untuk melanjutkan percakapan. Tekan 'Lanjutkan' untuk melanjutkan."
|
||||||
}
|
}
|
||||||
|
opened={openModal}
|
||||||
|
close={() => {
|
||||||
|
setOpenModal(false);
|
||||||
|
}}
|
||||||
|
buttonKanan={
|
||||||
|
<Button radius={"xl"} color="yellow" c={MainColor.darkblue}>
|
||||||
|
<Link
|
||||||
|
style={{
|
||||||
|
color: "white",
|
||||||
|
textDecoration: "none",
|
||||||
|
}}
|
||||||
|
target="_blank"
|
||||||
|
href={`https://wa.me/+${dataPorto?.tlpn}?text=Hallo , saya tertarik dengan bisnis anda. Apa boleh saya minta informasi tentang bisnis ${dataPorto?.namaBisnis}.`}
|
||||||
|
>
|
||||||
|
Lanjutkan
|
||||||
|
</Link>
|
||||||
|
</Button>
|
||||||
|
}
|
||||||
|
buttonKiri={
|
||||||
|
<Button radius={"xl"} onClick={() => setOpenModal(false)}>
|
||||||
|
Batal
|
||||||
|
</Button>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,131 +1,193 @@
|
|||||||
import { AccentColor, MainColor } from "@/app_modules/_global/color";
|
import { AccentColor, MainColor } from "@/app_modules/_global/color";
|
||||||
import { apiGetUserProfile, IUserProfile } from "@/app_modules/user";
|
import { apiGetUserProfile, IUserProfile } from "@/app_modules/user";
|
||||||
import { Box, Center, Group, Stack, Text, ThemeIcon } from "@mantine/core";
|
import {
|
||||||
|
Box,
|
||||||
|
Button,
|
||||||
|
Center,
|
||||||
|
Group,
|
||||||
|
Stack,
|
||||||
|
Text,
|
||||||
|
ThemeIcon,
|
||||||
|
} from "@mantine/core";
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
import { IconBrandGmail, IconGenderFemale, IconGenderMale, IconHome, IconPhone } from "@tabler/icons-react";
|
import {
|
||||||
|
IconBrandGmail,
|
||||||
|
IconGenderFemale,
|
||||||
|
IconGenderMale,
|
||||||
|
IconHome,
|
||||||
|
IconPhone,
|
||||||
|
} from "@tabler/icons-react";
|
||||||
import { useParams } from "next/navigation";
|
import { useParams } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { Profile_ComponentAvatarProfile, Profile_ComponentLoadBackgroundImage } from "../profile/_component";
|
import {
|
||||||
|
Profile_ComponentAvatarProfile,
|
||||||
|
Profile_ComponentLoadBackgroundImage,
|
||||||
|
} from "../profile/_component";
|
||||||
import SkeletonProfile from "./skeleton_profile";
|
import SkeletonProfile from "./skeleton_profile";
|
||||||
|
import { UIGlobal_Modal } from "@/app_modules/_global/ui";
|
||||||
|
import Link from "next/link";
|
||||||
|
|
||||||
export default function ProfileDetail() {
|
export default function ProfileDetail() {
|
||||||
const param = useParams<{ id: string }>()
|
const param = useParams<{ id: string }>();
|
||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true);
|
||||||
const [dataProfile, setDataProfile] = useState<IUserProfile>()
|
const [dataProfile, setDataProfile] = useState<IUserProfile>();
|
||||||
const listInformation = [
|
const [openModal, setOpenModal] = useState(false);
|
||||||
{
|
|
||||||
icon: <IconPhone color={MainColor.white} />,
|
|
||||||
value: "+" + dataProfile?.nomor,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: <IconBrandGmail color={MainColor.white} />,
|
|
||||||
value: dataProfile?.email,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: <IconHome color={MainColor.white} />,
|
|
||||||
value: dataProfile?.alamat,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon:
|
|
||||||
dataProfile?.jenisKelamin === "Laki-laki" ? (
|
|
||||||
<IconGenderMale color={MainColor.white} />
|
|
||||||
) : (
|
|
||||||
<IconGenderFemale color={MainColor.white}/>
|
|
||||||
),
|
|
||||||
value: dataProfile?.jenisKelamin,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
|
const listInformation = [
|
||||||
|
{
|
||||||
|
icon: <IconPhone color={MainColor.white} />,
|
||||||
|
value: (
|
||||||
|
<Text span inherit onClick={() => setOpenModal(true)}>
|
||||||
|
{"+" + dataProfile?.nomor}
|
||||||
|
</Text>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: <IconBrandGmail color={MainColor.white} />,
|
||||||
|
value: dataProfile?.email,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: <IconHome color={MainColor.white} />,
|
||||||
|
value: dataProfile?.alamat,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon:
|
||||||
|
dataProfile?.jenisKelamin === "Laki-laki" ? (
|
||||||
|
<IconGenderMale color={MainColor.white} />
|
||||||
|
) : (
|
||||||
|
<IconGenderFemale color={MainColor.white} />
|
||||||
|
),
|
||||||
|
value: dataProfile?.jenisKelamin,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
async function getProfile() {
|
async function getProfile() {
|
||||||
try {
|
try {
|
||||||
setLoading(true)
|
setLoading(true);
|
||||||
const response = await apiGetUserProfile(`?profile=${param.id}`)
|
const response = await apiGetUserProfile(`?profile=${param.id}`);
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
setDataProfile(response.data);
|
setDataProfile(response.data);
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
} finally {
|
|
||||||
setLoading(false)
|
|
||||||
}
|
}
|
||||||
}
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
useShallowEffect(() => {
|
||||||
|
getProfile();
|
||||||
|
}, []);
|
||||||
|
|
||||||
useShallowEffect(() => {
|
return (
|
||||||
getProfile()
|
<>
|
||||||
}, []);
|
|
||||||
|
|
||||||
return <>
|
|
||||||
<Stack
|
<Stack
|
||||||
spacing={0}
|
spacing={0}
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: AccentColor.darkblue,
|
backgroundColor: AccentColor.darkblue,
|
||||||
border: `2px solid ${AccentColor.blue}`,
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
borderRadius: "10px ",
|
borderRadius: "10px ",
|
||||||
padding: "15px",
|
padding: "15px",
|
||||||
color: MainColor.white
|
color: MainColor.white,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{
|
{loading ? (
|
||||||
loading ?
|
<SkeletonProfile />
|
||||||
<SkeletonProfile /> :
|
) : (
|
||||||
<>
|
<>
|
||||||
<Box>
|
<Box>
|
||||||
<Profile_ComponentLoadBackgroundImage
|
<Profile_ComponentLoadBackgroundImage
|
||||||
fileId={dataProfile?.imageBackgroundId as any}
|
fileId={dataProfile?.imageBackgroundId as any}
|
||||||
size={500}
|
size={500}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
position: "relative",
|
position: "relative",
|
||||||
bottom: 60,
|
bottom: 60,
|
||||||
margin: "auto",
|
margin: "auto",
|
||||||
width: "100%",
|
width: "100%",
|
||||||
marginBottom: -30,
|
marginBottom: -30,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Center>
|
<Center>
|
||||||
<Profile_ComponentAvatarProfile
|
<Profile_ComponentAvatarProfile
|
||||||
fileId={dataProfile?.imageId as any}
|
fileId={dataProfile?.imageId as any}
|
||||||
style={{
|
style={{
|
||||||
borderStyle: "solid",
|
borderStyle: "solid",
|
||||||
borderColor: AccentColor.darkblue,
|
borderColor: AccentColor.darkblue,
|
||||||
borderWidth: "2px",
|
borderWidth: "2px",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Center>
|
</Center>
|
||||||
<Stack align="center" c={MainColor.white} mt={"xs"} spacing={0}>
|
<Stack align="center" c={MainColor.white} mt={"xs"} spacing={0}>
|
||||||
<Text fw={"bold"} lineClamp={1} c={MainColor.white}>
|
<Text fw={"bold"} lineClamp={1} c={MainColor.white}>
|
||||||
{dataProfile?.name}
|
{dataProfile?.name}
|
||||||
</Text>
|
</Text>
|
||||||
<Text fs={"italic"} fz={"sm"} c={MainColor.white} lineClamp={1}>
|
<Text
|
||||||
@{dataProfile?.username}
|
fs={"italic"}
|
||||||
</Text>
|
fz={"sm"}
|
||||||
</Stack>
|
c={MainColor.white}
|
||||||
</Box>
|
lineClamp={1}
|
||||||
</Box>
|
>
|
||||||
<Box>
|
@{dataProfile?.username}
|
||||||
<Stack spacing={"xs"}>
|
</Text>
|
||||||
{listInformation.map((e, i) => (
|
</Stack>
|
||||||
<Group key={i} align="flex-start">
|
</Box>
|
||||||
<ThemeIcon
|
</Box>
|
||||||
style={{
|
<Box>
|
||||||
backgroundColor: "transparent",
|
<Stack spacing={"xs"}>
|
||||||
}}
|
{listInformation.map((e, i) => (
|
||||||
>
|
<Group key={i} align="flex-start">
|
||||||
{e.icon}
|
<ThemeIcon
|
||||||
</ThemeIcon>
|
style={{
|
||||||
<Box w={"85%"}>
|
backgroundColor: "transparent",
|
||||||
<Text c={MainColor.white} fw={"bold"}>{e?.value}</Text>
|
}}
|
||||||
</Box>
|
>
|
||||||
</Group>
|
{e.icon}
|
||||||
))}
|
</ThemeIcon>
|
||||||
</Stack>
|
<Box w={"85%"}>
|
||||||
</Box>
|
<Text c={MainColor.white} fw={"bold"}>
|
||||||
</>
|
{e?.value}
|
||||||
}
|
</Text>
|
||||||
|
</Box>
|
||||||
|
</Group>
|
||||||
|
))}
|
||||||
|
</Stack>
|
||||||
|
</Box>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
</>;
|
|
||||||
}
|
<UIGlobal_Modal
|
||||||
|
title={
|
||||||
|
"Anda akan dialihkan ke WhatsApp untuk melanjutkan percakapan. Tekan 'Lanjutkan' untuk melanjutkan."
|
||||||
|
}
|
||||||
|
opened={openModal}
|
||||||
|
close={() => {
|
||||||
|
setOpenModal(false);
|
||||||
|
}}
|
||||||
|
buttonKanan={
|
||||||
|
<Button radius={"xl"} color="yellow" c={MainColor.darkblue}>
|
||||||
|
<Link
|
||||||
|
color="white"
|
||||||
|
style={{
|
||||||
|
color: "white",
|
||||||
|
textDecoration: "none",
|
||||||
|
}}
|
||||||
|
target="_blank"
|
||||||
|
href={`https://wa.me/+${dataProfile?.nomor}?text=Hallo , saya tertarik dengan profile anda sebagai rekan HIPMI. Apakah saya bisa melanjutkan percakapan?`}
|
||||||
|
>
|
||||||
|
Lanjutkan
|
||||||
|
</Link>
|
||||||
|
</Button>
|
||||||
|
}
|
||||||
|
buttonKiri={
|
||||||
|
<Button radius={"xl"} onClick={() => setOpenModal(false)}>
|
||||||
|
Batal
|
||||||
|
</Button>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ import { map_funGetOneById } from "../fun/get/fun_get_one_by_id";
|
|||||||
import { MODEL_MAP } from "../lib/interface";
|
import { MODEL_MAP } from "../lib/interface";
|
||||||
import { ComponentMap_LoadImageMap } from "./comp_load_image_map";
|
import { ComponentMap_LoadImageMap } from "./comp_load_image_map";
|
||||||
import { ComponentMap_SkeletonDrawerDetailData } from "./skeleton_detail_data";
|
import { ComponentMap_SkeletonDrawerDetailData } from "./skeleton_detail_data";
|
||||||
|
import { UIGlobal_Modal } from "@/app_modules/_global/ui";
|
||||||
|
import Link from "next/link";
|
||||||
|
|
||||||
export function ComponentMap_DetailData({
|
export function ComponentMap_DetailData({
|
||||||
mapId,
|
mapId,
|
||||||
@@ -30,6 +32,7 @@ export function ComponentMap_DetailData({
|
|||||||
const [data, setData] = useState<MODEL_MAP>();
|
const [data, setData] = useState<MODEL_MAP>();
|
||||||
const [dataUser, setDataUser] = useState<MODEL_USER>();
|
const [dataUser, setDataUser] = useState<MODEL_USER>();
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
const [openModal, setOpenModal] = useState(false);
|
||||||
|
|
||||||
useShallowEffect(() => {
|
useShallowEffect(() => {
|
||||||
onLoadData(setData, setDataUser);
|
onLoadData(setData, setDataUser);
|
||||||
@@ -46,9 +49,7 @@ export function ComponentMap_DetailData({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack mt={"lg"} spacing={"xl"} px={"md"}>
|
<Stack mt={"lg"} spacing={"xl"} px={"md"}>
|
||||||
<ComponentGlobal_AvatarAndUsername
|
<ComponentGlobal_AvatarAndUsername profile={dataUser?.Profile as any} />
|
||||||
profile={dataUser?.Profile as any}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<ComponentMap_LoadImageMap fileId={data.imageId} />
|
<ComponentMap_LoadImageMap fileId={data.imageId} />
|
||||||
|
|
||||||
@@ -74,7 +75,13 @@ export function ComponentMap_DetailData({
|
|||||||
<IconPhoneCall />
|
<IconPhoneCall />
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={"auto"}>
|
<Grid.Col span={"auto"}>
|
||||||
<Text>{data?.Portofolio.tlpn}</Text>
|
<Text
|
||||||
|
onClick={() => {
|
||||||
|
setOpenModal(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
+ {data?.Portofolio.tlpn}
|
||||||
|
</Text>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid>
|
<Grid>
|
||||||
@@ -127,6 +134,36 @@ export function ComponentMap_DetailData({
|
|||||||
</Button>
|
</Button>
|
||||||
</Group>
|
</Group>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
|
<UIGlobal_Modal
|
||||||
|
title={
|
||||||
|
"Anda akan dialihkan ke WhatsApp untuk melanjutkan percakapan. Tekan 'Lanjutkan' untuk melanjutkan."
|
||||||
|
}
|
||||||
|
opened={openModal}
|
||||||
|
close={() => {
|
||||||
|
setOpenModal(false);
|
||||||
|
}}
|
||||||
|
buttonKanan={
|
||||||
|
<Button radius={"xl"} color="yellow" c={MainColor.darkblue}>
|
||||||
|
<Link
|
||||||
|
color="white"
|
||||||
|
style={{
|
||||||
|
color: "white",
|
||||||
|
textDecoration: "none",
|
||||||
|
}}
|
||||||
|
target="_blank"
|
||||||
|
href={`https://wa.me/+${data?.Portofolio.tlpn}?text=Hallo , saya tertarik dengan bisnis anda. Apa boleh saya minta informasi tentang bisnis ${data?.Portofolio.namaBisnis} ?`}
|
||||||
|
>
|
||||||
|
Lanjutkan
|
||||||
|
</Link>
|
||||||
|
</Button>
|
||||||
|
}
|
||||||
|
buttonKiri={
|
||||||
|
<Button radius={"xl"} onClick={() => setOpenModal(false)}>
|
||||||
|
Batal
|
||||||
|
</Button>
|
||||||
|
}
|
||||||
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,13 +14,15 @@ import {
|
|||||||
import { useShallowEffect } from "@mantine/hooks";
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
import { redirect, useRouter } from "next/navigation";
|
import { redirect, useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
import { ComponentGlobal_CardStyles } from "../_global/component";
|
||||||
|
import { apiGetACtivationUser } from "../_global/lib/api_user";
|
||||||
|
import { clientLogger } from "@/util/clientLogger";
|
||||||
|
import _ from "lodash";
|
||||||
|
|
||||||
export default function WaitingRoom_View({
|
export default function WaitingRoom_View({
|
||||||
activationUser,
|
|
||||||
userLoginId,
|
userLoginId,
|
||||||
}: {
|
}: {
|
||||||
activationUser: boolean;
|
userLoginId?: string;
|
||||||
userLoginId: string;
|
|
||||||
}) {
|
}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
@@ -37,71 +39,61 @@ export default function WaitingRoom_View({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
useShallowEffect(() => {
|
const [data, setData] = useState<boolean | null>(null);
|
||||||
if (activationUser == true) {
|
|
||||||
return redirect("/");
|
|
||||||
}
|
|
||||||
}, [activationUser]);
|
|
||||||
|
|
||||||
const listhHuruf = [
|
useShallowEffect(() => {
|
||||||
{
|
onLoadData();
|
||||||
huruf: "H",
|
}, []);
|
||||||
},
|
|
||||||
{
|
async function onLoadData() {
|
||||||
huruf: "I",
|
try {
|
||||||
},
|
const respone = await apiGetACtivationUser();
|
||||||
{
|
if (respone) {
|
||||||
huruf: "P",
|
console.log(respone.data);
|
||||||
},
|
setData(respone.data);
|
||||||
{
|
}
|
||||||
huruf: "M",
|
} catch (error) {
|
||||||
},
|
clientLogger.error("Error get cookies user", error);
|
||||||
{
|
}
|
||||||
huruf: "I",
|
}
|
||||||
},
|
|
||||||
];
|
|
||||||
const customLOader = (
|
|
||||||
<Center>
|
|
||||||
<Group>
|
|
||||||
{listhHuruf.map((e, i) => (
|
|
||||||
<Center key={i} h={"100%"}>
|
|
||||||
<Skeleton height={50} circle radius={"100%"} />
|
|
||||||
<Text sx={{ position: "absolute" }} c={"gray.5"} fw={"bold"}>
|
|
||||||
{e.huruf}
|
|
||||||
</Text>
|
|
||||||
</Center>
|
|
||||||
))}
|
|
||||||
</Group>
|
|
||||||
</Center>
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<UIGlobal_LayoutDefault>
|
<UIGlobal_LayoutDefault>
|
||||||
<Center h={"100vh"}>
|
<Stack justify="cneter" h={"90vh"} mt={"xl"}>
|
||||||
<Stack align="center" spacing={50}>
|
<ComponentGlobal_CardStyles>
|
||||||
{/* {customLOader} */}
|
{_.isNull(data) ? (
|
||||||
|
<Stack>
|
||||||
|
{Array.from(new Array(4)).map((e, i) => (
|
||||||
|
<Skeleton key={i} h={20} w={"100%"} />
|
||||||
|
))}
|
||||||
|
</Stack>
|
||||||
|
) : (
|
||||||
|
<Stack align="center">
|
||||||
|
<Stack align="center" spacing={5} fs={"italic"}>
|
||||||
|
<Text fw={"bold"} c={"white"} align="center">
|
||||||
|
Permohonan akses Anda sedang dalam proses verifikasi oleh
|
||||||
|
admin.
|
||||||
|
</Text>
|
||||||
|
<Text fw={"bold"} c={"white"} align="center">
|
||||||
|
Harap tunggu, Anda akan menerima pemberitahuan melalui
|
||||||
|
Whatsapp setelah disetujui.
|
||||||
|
</Text>
|
||||||
|
</Stack>
|
||||||
|
|
||||||
<Stack align="center" spacing={5}>
|
{/* <Button
|
||||||
<Title order={3} c={"white"}>
|
color="red"
|
||||||
Anda telah berhasil mendaftar,
|
loaderPosition="center"
|
||||||
</Title>
|
loading={loading}
|
||||||
<Title order={3} c={"white"}>
|
radius={"xl"}
|
||||||
Mohon menunggu konfirmansi Admin !
|
onClick={() => onClickLogout()}
|
||||||
</Title>
|
>
|
||||||
</Stack>
|
Keluar
|
||||||
|
</Button> */}
|
||||||
<Button
|
</Stack>
|
||||||
color="red"
|
)}
|
||||||
loaderPosition="center"
|
</ComponentGlobal_CardStyles>
|
||||||
loading={loading}
|
</Stack>
|
||||||
radius={"xl"}
|
|
||||||
onClick={() => onClickLogout()}
|
|
||||||
>
|
|
||||||
Keluar
|
|
||||||
</Button>
|
|
||||||
</Stack>
|
|
||||||
</Center>
|
|
||||||
</UIGlobal_LayoutDefault>
|
</UIGlobal_LayoutDefault>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user