Merge branch 'DEVELOPMENT' of https://gitea.internship.project-moonshot.com/Laux/Frontend-Internal-Developer-Platform into DEVELOPMENT
This commit is contained in:
@@ -9,10 +9,13 @@ import Prompts from "@/app/components/prompts/Prompts";
|
|||||||
import useAgentForm from "@/app/hooks/useAgentForm";
|
import useAgentForm from "@/app/hooks/useAgentForm";
|
||||||
import Alert from "@/app/components/alerts/Alert";
|
import Alert from "@/app/components/alerts/Alert";
|
||||||
import Checkbox from "@/app/components/customCheckbox/Checkbox";
|
import Checkbox from "@/app/components/customCheckbox/Checkbox";
|
||||||
|
import useIsMobile from "@/app/hooks/useIsMobile";
|
||||||
|
|
||||||
const ViewAgentPage = () => {
|
const ViewAgentPage = () => {
|
||||||
const [useVpn, setUseVpn] = useState(true);
|
const [useVpn, setUseVpn] = useState(false);
|
||||||
const [enableLoki, setEnableLoki] = useState(true);
|
const [enableLoki, setEnableLoki] = useState(false);
|
||||||
|
const isMobile = useIsMobile();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
register,
|
register,
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
@@ -50,7 +53,7 @@ const ViewAgentPage = () => {
|
|||||||
{/* AGENT FORM */}
|
{/* AGENT FORM */}
|
||||||
<div className={createAgentStyle.headerContainer}>
|
<div className={createAgentStyle.headerContainer}>
|
||||||
<div className={createAgentStyle.headerTxt}>
|
<div className={createAgentStyle.headerTxt}>
|
||||||
<p>Agent Details</p>
|
{isMobile ? "" : <p>Agent Details</p>}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={createAgentStyle.inputContainer}>
|
<div className={createAgentStyle.inputContainer}>
|
||||||
@@ -90,35 +93,51 @@ const ViewAgentPage = () => {
|
|||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{/* Agent endpoint */}
|
{useVpn ? (
|
||||||
<div className={createAgentStyle.inputContainer}>
|
<>
|
||||||
<div className={createAgentStyle.labelContainer}>
|
<div className={createAgentStyle.inputContainer}>
|
||||||
<p>Tailscale Device Prefix</p>
|
<div className={createAgentStyle.labelContainer}>
|
||||||
{/* <p className={createAgentStyle.required}>*</p> */}
|
<p>Tailscale Device Prefix</p>
|
||||||
|
<p className={createAgentStyle.required}>*</p>
|
||||||
|
</div>
|
||||||
|
<TextField
|
||||||
|
placeHolder="doks-onecbdev-agent"
|
||||||
|
{...register("agentEndpoint", { required: true })}
|
||||||
|
hasError={!!errors.agentEndpoint}
|
||||||
|
/>
|
||||||
|
<Prompts show={false} />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={createAgentStyle.inputContainer}>
|
||||||
|
<div className={createAgentStyle.labelContainer}>
|
||||||
|
<p>Tailscale Port</p>
|
||||||
|
<p className={createAgentStyle.required}>*</p>
|
||||||
|
</div>
|
||||||
|
<TextField
|
||||||
|
placeHolder="6969"
|
||||||
|
{...register("agentEndpoint", { required: true })}
|
||||||
|
hasError={!!errors.agentEndpoint}
|
||||||
|
/>
|
||||||
|
<Prompts show={false} />
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<div className={createAgentStyle.inputContainer}>
|
||||||
|
<div className={createAgentStyle.labelContainer}>
|
||||||
|
<p>Agent Endpoint</p>
|
||||||
|
<p className={createAgentStyle.required}>*</p>
|
||||||
|
</div>
|
||||||
|
<TextField
|
||||||
|
placeHolder="e.g., http://agent-01.example.com:8080"
|
||||||
|
{...register("agentEndpoint", { required: true })}
|
||||||
|
hasError={!!errors.agentEndpoint}
|
||||||
|
/>
|
||||||
|
<Prompts show={false} />
|
||||||
</div>
|
</div>
|
||||||
<TextField
|
)}
|
||||||
placeHolder="doks-onecbdev-agent"
|
|
||||||
{...register("agentEndpoint", { required: true })}
|
|
||||||
hasError={!!errors.agentEndpoint}
|
|
||||||
/>
|
|
||||||
<Prompts show={false} />
|
|
||||||
</div>
|
|
||||||
<div className={createAgentStyle.inputContainer}>
|
|
||||||
<div className={createAgentStyle.labelContainer}>
|
|
||||||
<p>Tailscale Port</p>
|
|
||||||
{/* <p className={createAgentStyle.required}>*</p> */}
|
|
||||||
</div>
|
|
||||||
<TextField
|
|
||||||
placeHolder="6969"
|
|
||||||
{...register("agentEndpoint", { required: true })}
|
|
||||||
hasError={!!errors.agentEndpoint}
|
|
||||||
/>
|
|
||||||
<Prompts show={false} />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={createAgentStyle.lokiContainer}>
|
<div className={createAgentStyle.lokiContainer}>
|
||||||
{/* Header */}
|
|
||||||
<div className={createAgentStyle.headerContainer}>
|
<div className={createAgentStyle.headerContainer}>
|
||||||
<div className={createAgentStyle.headerTxt}>
|
<div className={createAgentStyle.headerTxt}>
|
||||||
<p>Loki Integration (Optional)</p>
|
<p>Loki Integration (Optional)</p>
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
flex: 1 0 0;
|
flex: 1 0 0;
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
}
|
}
|
||||||
|
|
||||||
.createAgentContainer {
|
.createAgentContainer {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@@ -30,7 +29,7 @@
|
|||||||
.headerContainer {
|
.headerContainer {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
gap: 17px;
|
gap: 50px;
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
}
|
}
|
||||||
.headerContainer > div {
|
.headerContainer > div {
|
||||||
@@ -66,7 +65,6 @@
|
|||||||
}
|
}
|
||||||
.labelContainer > p {
|
.labelContainer > p {
|
||||||
color: #d2d3e1;
|
color: #d2d3e1;
|
||||||
color: color(display-p3 0.8235 0.8275 0.8784);
|
|
||||||
font-family: Inter;
|
font-family: Inter;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
@@ -80,9 +78,59 @@
|
|||||||
|
|
||||||
.lokiContainer {
|
.lokiContainer {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
width: 548px;
|
width: 548px;
|
||||||
padding: 24px;
|
padding: 24px;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
gap: 24px;
|
gap: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1024px) {
|
||||||
|
.createAgentContainer {
|
||||||
|
display: flex;
|
||||||
|
padding: 16px 16px; /*did some math 32 ang orig top*/
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: flex-start;
|
||||||
|
gap: 24px;
|
||||||
|
height: calc(100vh - 100px - 60px);
|
||||||
|
align-self: stretch;
|
||||||
|
}
|
||||||
|
.div {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.inputMainContainer {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 16px;
|
||||||
|
padding: 0px;
|
||||||
|
/* align-self: stretch; */
|
||||||
|
}
|
||||||
|
.lokiContainer {
|
||||||
|
display: flex;
|
||||||
|
gap: 16px;
|
||||||
|
align-self: stretch;
|
||||||
|
border-radius: 8px;
|
||||||
|
width: 500px;
|
||||||
|
padding: 24px 0 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.inputMainContainer {
|
||||||
|
align-self: stretch;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.lokiContainer {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.inputContainer {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.headerTxt > p {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -9,10 +9,12 @@ import Prompts from "@/app/components/prompts/Prompts";
|
|||||||
import useAgentForm from "@/app/hooks/useAgentForm";
|
import useAgentForm from "@/app/hooks/useAgentForm";
|
||||||
import Alert from "@/app/components/alerts/Alert";
|
import Alert from "@/app/components/alerts/Alert";
|
||||||
import Checkbox from "@/app/components/customCheckbox/Checkbox";
|
import Checkbox from "@/app/components/customCheckbox/Checkbox";
|
||||||
|
import useIsMobile from "@/app/hooks/useIsMobile";
|
||||||
|
|
||||||
const AddAgentPage = () => {
|
const AddAgentPage = () => {
|
||||||
const [useVpn, setUseVpn] = useState(false);
|
const [useVpn, setUseVpn] = useState(false);
|
||||||
const [enableLoki, setEnableLoki] = useState(false);
|
const [enableLoki, setEnableLoki] = useState(false);
|
||||||
|
const isMobile = useIsMobile();
|
||||||
const {
|
const {
|
||||||
register,
|
register,
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
@@ -40,7 +42,7 @@ const AddAgentPage = () => {
|
|||||||
state="add"
|
state="add"
|
||||||
requiredButtons={["title", "save"]}
|
requiredButtons={["title", "save"]}
|
||||||
/>
|
/>
|
||||||
<TopToolTip />
|
{isMobile ? "" : <TopToolTip />}
|
||||||
{/* Create agent Container */}
|
{/* Create agent Container */}
|
||||||
<form
|
<form
|
||||||
className={createAgentStyle.formContainer}
|
className={createAgentStyle.formContainer}
|
||||||
@@ -48,12 +50,11 @@ const AddAgentPage = () => {
|
|||||||
onSubmit={handleSubmit(onSubmit)}
|
onSubmit={handleSubmit(onSubmit)}
|
||||||
>
|
>
|
||||||
<div className={createAgentStyle.createAgentContainer}>
|
<div className={createAgentStyle.createAgentContainer}>
|
||||||
<div className={createAgentStyle.div}></div>
|
|
||||||
<div className={createAgentStyle.inputMainContainer}>
|
<div className={createAgentStyle.inputMainContainer}>
|
||||||
{/* AGENT FORM */}
|
{/* AGENT FORM */}
|
||||||
<div className={createAgentStyle.headerContainer}>
|
<div className={createAgentStyle.headerContainer}>
|
||||||
<div className={createAgentStyle.headerTxt}>
|
<div className={createAgentStyle.headerTxt}>
|
||||||
<p>Agent Details</p>
|
{isMobile ? "" : <p>Agent Details</p>}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={createAgentStyle.inputContainer}>
|
<div className={createAgentStyle.inputContainer}>
|
||||||
@@ -93,19 +94,48 @@ const AddAgentPage = () => {
|
|||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{/* Agent endpoint */}
|
{useVpn ? (
|
||||||
<div className={createAgentStyle.inputContainer}>
|
<>
|
||||||
<div className={createAgentStyle.labelContainer}>
|
<div className={createAgentStyle.inputContainer}>
|
||||||
<p>Agent Endpoint</p>
|
<div className={createAgentStyle.labelContainer}>
|
||||||
<p className={createAgentStyle.required}>*</p>
|
<p>Tailscale Device Prefix</p>
|
||||||
|
<p className={createAgentStyle.required}>*</p>
|
||||||
|
</div>
|
||||||
|
<TextField
|
||||||
|
placeHolder="doks-onecbdev-agent"
|
||||||
|
{...register("agentEndpoint", { required: true })}
|
||||||
|
hasError={!!errors.agentEndpoint}
|
||||||
|
/>
|
||||||
|
<Prompts show={false} />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={createAgentStyle.inputContainer}>
|
||||||
|
<div className={createAgentStyle.labelContainer}>
|
||||||
|
<p>Tailscale Port</p>
|
||||||
|
<p className={createAgentStyle.required}>*</p>
|
||||||
|
</div>
|
||||||
|
<TextField
|
||||||
|
placeHolder="6969"
|
||||||
|
{...register("agentEndpoint", { required: true })}
|
||||||
|
hasError={!!errors.agentEndpoint}
|
||||||
|
/>
|
||||||
|
<Prompts show={false} />
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<div className={createAgentStyle.inputContainer}>
|
||||||
|
<div className={createAgentStyle.labelContainer}>
|
||||||
|
<p>Agent Endpoint</p>
|
||||||
|
<p className={createAgentStyle.required}>*</p>
|
||||||
|
</div>
|
||||||
|
<TextField
|
||||||
|
placeHolder="e.g., http://agent-01.example.com:8080"
|
||||||
|
{...register("agentEndpoint", { required: true })}
|
||||||
|
hasError={!!errors.agentEndpoint}
|
||||||
|
/>
|
||||||
|
<Prompts show={false} />
|
||||||
</div>
|
</div>
|
||||||
<TextField
|
)}
|
||||||
placeHolder="e.g., http://agent-01.example.com:8080"
|
|
||||||
{...register("agentEndpoint", { required: true })}
|
|
||||||
hasError={!!errors.agentEndpoint}
|
|
||||||
/>
|
|
||||||
<Prompts show={false} />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={createAgentStyle.lokiContainer}>
|
<div className={createAgentStyle.lokiContainer}>
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
flex: 1 0 0;
|
flex: 1 0 0;
|
||||||
padding-top: 48px;
|
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -14,9 +13,10 @@
|
|||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
/* Ibalhin ni ang padding sa formcontainer maoang nasa figma */
|
/* Ibalhin ni ang padding sa formcontainer maoang nasa figma */
|
||||||
|
padding-top: 48px;
|
||||||
gap: 16px;
|
gap: 16px;
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
height: calc(100vh - 100px - 48px - 110px);
|
height: calc(100vh - 100px - 5px - 110px);
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
scrollbar-width: none;
|
scrollbar-width: none;
|
||||||
}
|
}
|
||||||
@@ -31,17 +31,9 @@
|
|||||||
.headerContainer {
|
.headerContainer {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
gap: 17px;
|
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
}
|
}
|
||||||
.headerContainer > div {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: flex-start;
|
|
||||||
gap: 5px;
|
|
||||||
flex: 1 0 0;
|
|
||||||
}
|
|
||||||
.headerTxt > p {
|
.headerTxt > p {
|
||||||
/* width: 163px; */
|
/* width: 163px; */
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
@@ -87,3 +79,52 @@
|
|||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
gap: 24px;
|
gap: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1024px) {
|
||||||
|
.createAgentContainer {
|
||||||
|
display: flex;
|
||||||
|
padding: 16px 16px; /*did some math 32 ang orig top*/
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: flex-start;
|
||||||
|
height: calc(100vh - 100px - 5px - 50px);
|
||||||
|
gap: 24px;
|
||||||
|
align-self: stretch;
|
||||||
|
}
|
||||||
|
.div {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.inputMainContainer {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 16px;
|
||||||
|
padding: 0px;
|
||||||
|
/* align-self: stretch; */
|
||||||
|
}
|
||||||
|
.lokiContainer {
|
||||||
|
display: flex;
|
||||||
|
gap: 16px;
|
||||||
|
align-self: stretch;
|
||||||
|
border-radius: 8px;
|
||||||
|
width: 500px;
|
||||||
|
padding: 24px 0 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.inputMainContainer {
|
||||||
|
align-self: stretch;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.lokiContainer {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.inputContainer {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.headerTxt > p {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
32
frontend/src/app/components/icons/plus.jsx
Normal file
32
frontend/src/app/components/icons/plus.jsx
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
import React from "react";
|
||||||
|
|
||||||
|
const plus = () => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width={24}
|
||||||
|
height={24}
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M12 5.29199V18.7087"
|
||||||
|
stroke="#333649"
|
||||||
|
strokeWidth={2}
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
/>
|
||||||
|
<path
|
||||||
|
d="M5.29102 12H18.7077"
|
||||||
|
stroke="#333649"
|
||||||
|
strokeWidth={2}
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default plus;
|
||||||
39
frontend/src/app/components/mobileToggleTab/Toggle.jsx
Normal file
39
frontend/src/app/components/mobileToggleTab/Toggle.jsx
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
import React from "react";
|
||||||
|
import styles from "./styles.module.css";
|
||||||
|
import MobileSearchBar from "@/app/components/mobileSearchBar/MobileSearchBar";
|
||||||
|
import useIsMobile from "@/app/hooks/useIsMobile";
|
||||||
|
import PlusIcon from "../icons/plus";
|
||||||
|
|
||||||
|
const Toggle = ({ tabs = [], activeTab, onChange }) => {
|
||||||
|
const isMobile = useIsMobile();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={styles.toggleContainer}>
|
||||||
|
<div className={styles.buttonToggles}>
|
||||||
|
{tabs.map((tab) => (
|
||||||
|
<button
|
||||||
|
key={tab.value}
|
||||||
|
className={`${styles.buttonStyle} ${activeTab === tab.value ? styles.active : ""}`}
|
||||||
|
onClick={() => onChange(tab.value)}
|
||||||
|
>
|
||||||
|
{tab.label}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{isMobile && activeTab === "permissions" && (
|
||||||
|
<div className={styles.container}>
|
||||||
|
<div className={styles.searchBar}>
|
||||||
|
<MobileSearchBar />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button>
|
||||||
|
<PlusIcon />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Toggle;
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
.toggleContainer {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 950px) {
|
||||||
|
.toggleContainer {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-self: stretch;
|
||||||
|
gap: 16px;
|
||||||
|
}
|
||||||
|
.buttonToggles {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 16px;
|
||||||
|
align-self: stretch;
|
||||||
|
}
|
||||||
|
.container {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 16px;
|
||||||
|
flex: 1 0 0;
|
||||||
|
padding: 8px 0;
|
||||||
|
}
|
||||||
|
.searchBar {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container > button {
|
||||||
|
display: flex;
|
||||||
|
padding: 8px;
|
||||||
|
border: none;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: end;
|
||||||
|
gap: 12px;
|
||||||
|
border-radius: 6px;
|
||||||
|
background: #27293b;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttonStyle {
|
||||||
|
display: flex;
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
padding: 24px 4px 16px 4px;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 5px;
|
||||||
|
color: #85869b;
|
||||||
|
font-family: Inter;
|
||||||
|
font-size: 18px;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: normal;
|
||||||
|
letter-spacing: 0.18px;
|
||||||
|
}
|
||||||
|
.active {
|
||||||
|
border-bottom: 1px solid #959aff;
|
||||||
|
color: #959aff;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -91,7 +91,7 @@
|
|||||||
background: #2d3143;
|
background: #2d3143;
|
||||||
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.25);
|
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.25);
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 4;
|
z-index: 30;
|
||||||
top: 100%;
|
top: 100%;
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
|||||||
@@ -16,10 +16,9 @@
|
|||||||
gap: 10px;
|
gap: 10px;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
}
|
}
|
||||||
.profileBadge:hover {
|
.profileBadgeButton:hover {
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
background: #21232f;
|
background: #21232f;
|
||||||
background: color(display-p3 0.1294 0.1373 0.1804);
|
|
||||||
}
|
}
|
||||||
.nameRole {
|
.nameRole {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -79,12 +78,10 @@
|
|||||||
left: 0;
|
left: 0;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
background: #2d3144;
|
background: #2d3144;
|
||||||
background: color(display-p3 0.1787 0.1913 0.2605);
|
|
||||||
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.25);
|
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.25);
|
||||||
box-shadow: 0 2px 15px 0 color(display-p3 0 0 0 / 0.25);
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 10;
|
z-index: 30;
|
||||||
top: 100%;
|
top: 100%;
|
||||||
margin-top: 3px;
|
margin-top: 3px;
|
||||||
animation-name: dropDownAnimation;
|
animation-name: dropDownAnimation;
|
||||||
|
|||||||
@@ -3,54 +3,30 @@ import DeleteIcon from "../icons/delete";
|
|||||||
import FileIcon from "../icons/file";
|
import FileIcon from "../icons/file";
|
||||||
import editUserStyle from "./styles.module.css";
|
import editUserStyle from "./styles.module.css";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import PlusIcon from "../icons/plus";
|
||||||
|
|
||||||
const Permissions = ({ sampleData = [] }) => {
|
const Permissions = ({ sampleData = [] }) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* Permissions */}
|
{/* Permissions */}
|
||||||
<div className={editUserStyle.userPermissions}>
|
<div className={editUserStyle.permissionsContainer}>
|
||||||
{/* Add permissions */}
|
<div className={editUserStyle.permissionsHeader}>
|
||||||
<div className={editUserStyle.imanginaryDiv}></div>
|
<p>Permissions</p>
|
||||||
<div className={editUserStyle.permissionsContainer}>
|
<div className={editUserStyle.svgContainer}>
|
||||||
{/* Header */}
|
{/* Button ni */}
|
||||||
<div className={editUserStyle.permissionsHeader}>
|
<button>
|
||||||
<p>Permissions</p>
|
<PlusIcon />
|
||||||
<div className={editUserStyle.svgContainer}>
|
</button>
|
||||||
<div>
|
|
||||||
<svg
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
width={24}
|
|
||||||
height={24}
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
d="M12 5.29199V18.7087"
|
|
||||||
stroke="#333649"
|
|
||||||
strokeWidth={2}
|
|
||||||
strokeLinecap="round"
|
|
||||||
strokeLinejoin="round"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
d="M5.29102 12H18.7077"
|
|
||||||
stroke="#333649"
|
|
||||||
strokeWidth={2}
|
|
||||||
strokeLinecap="round"
|
|
||||||
strokeLinejoin="round"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{sampleData.length === 0 ? (
|
{sampleData.length === 0 ? (
|
||||||
// Default Message
|
<div className={editUserStyle.permissionDefaultState}>
|
||||||
<div className={editUserStyle.permissionDefaultState}>
|
<p>No permission added yet</p>
|
||||||
<p>No permission added yet</p>
|
</div>
|
||||||
</div>
|
) : (
|
||||||
) : (
|
<div className={editUserStyle.permissionsList}>
|
||||||
// Sampple Data(static)
|
{sampleData.map((perm, index) => {
|
||||||
sampleData.map((perm, index) => {
|
|
||||||
return (
|
return (
|
||||||
<div className={editUserStyle.permissions} key={index}>
|
<div className={editUserStyle.permissions} key={index}>
|
||||||
<div className={editUserStyle.permissionsItem}>
|
<div className={editUserStyle.permissionsItem}>
|
||||||
@@ -62,9 +38,9 @@ const Permissions = ({ sampleData = [] }) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})
|
})}
|
||||||
)}
|
</div>
|
||||||
</div>
|
)}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,19 +1,3 @@
|
|||||||
.imanginaryDiv {
|
|
||||||
padding: 18px;
|
|
||||||
}
|
|
||||||
.userPermissions {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: flex-start;
|
|
||||||
flex: 1 0 0;
|
|
||||||
align-self: stretch;
|
|
||||||
border-radius: 6px;
|
|
||||||
height: calc(100vh - 175px);
|
|
||||||
position: relative;
|
|
||||||
overflow: auto;
|
|
||||||
scrollbar-width: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.permissionsContainer {
|
.permissionsContainer {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 24px;
|
padding: 24px;
|
||||||
@@ -22,7 +6,6 @@
|
|||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
background: #1d1e2a;
|
background: #1d1e2a;
|
||||||
background: color(display-p3 0.1138 0.1191 0.1616);
|
|
||||||
}
|
}
|
||||||
.permissionsHeader {
|
.permissionsHeader {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -39,9 +22,7 @@
|
|||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
gap: 5px;
|
gap: 5px;
|
||||||
flex: 1 0 0;
|
flex: 1 0 0;
|
||||||
|
|
||||||
color: #d2d3e1;
|
color: #d2d3e1;
|
||||||
color: color(display-p3 0.8235 0.8275 0.8784);
|
|
||||||
font-family: Inter;
|
font-family: Inter;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
@@ -58,27 +39,26 @@
|
|||||||
gap: 5px;
|
gap: 5px;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
background: #27293b;
|
background: #27293b;
|
||||||
background: color(display-p3 0.1529 0.1608 0.2275);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.svgContainer > div {
|
.svgContainer > button {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
|
border: none;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
background: #27293b;
|
background: #27293b;
|
||||||
background: color(display-p3 0.1529 0.1608 0.2275);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.permissionDefaultState {
|
.permissionDefaultState {
|
||||||
display: flex;
|
align-items: center;
|
||||||
|
gap: 12px;
|
||||||
|
flex: 1 0 0;
|
||||||
|
align-self: stretch;
|
||||||
height: 43.813px;
|
height: 43.813px;
|
||||||
padding: 8px 16px;
|
padding: 8px 16px;
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
align-self: stretch;
|
|
||||||
}
|
}
|
||||||
.permissionDefaultState p {
|
.permissionDefaultState p {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -88,29 +68,28 @@
|
|||||||
flex: 1 0 0;
|
flex: 1 0 0;
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
color: #85869b;
|
color: #85869b;
|
||||||
color: color(display-p3 0.5216 0.5255 0.6);
|
|
||||||
font-family: Inter;
|
font-family: Inter;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
}
|
}
|
||||||
|
.permissionsList {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
.permissions {
|
.permissions {
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 43.813px;
|
height: 43.813px;
|
||||||
padding: 8px 16px;
|
padding: 8px 8px 8px 16px;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
border-bottom: 0.5px solid #2e3042;
|
border-bottom: 0.5px solid #2e3042;
|
||||||
border-bottom: 0.5px solid color(display-p3 0.1831 0.189 0.2535);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.permissions:hover {
|
.permissions:hover {
|
||||||
border-bottom: 1px solid rgba(129, 135, 255, 0.25);
|
border-bottom: 1px solid rgba(129, 135, 255, 0.25);
|
||||||
border-bottom: 1px solid color(display-p3 0.5098 0.5294 1 / 0.25);
|
|
||||||
background: rgba(129, 135, 255, 0.05);
|
background: rgba(129, 135, 255, 0.05);
|
||||||
background: color(display-p3 0.5098 0.5294 1 / 0.05);
|
|
||||||
}
|
}
|
||||||
.permissionsItem {
|
.permissionsItem {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -121,7 +100,6 @@
|
|||||||
}
|
}
|
||||||
.permissionsItem > p {
|
.permissionsItem > p {
|
||||||
color: #d2d3e1;
|
color: #d2d3e1;
|
||||||
color: color(display-p3 0.8235 0.8275 0.8784);
|
|
||||||
font-family: Inter;
|
font-family: Inter;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
@@ -151,35 +129,40 @@
|
|||||||
stroke: color(display-p3 1 1 1);
|
stroke: color(display-p3 1 1 1);
|
||||||
border-radius: 100px;
|
border-radius: 100px;
|
||||||
border: 1px solid #959aff;
|
border: 1px solid #959aff;
|
||||||
border: 1px solid color(display-p3 0.5892 0.6031 0.9766);
|
|
||||||
background: linear-gradient(180deg, #696b95 0%, #20202d 100%);
|
background: linear-gradient(180deg, #696b95 0%, #20202d 100%);
|
||||||
background: linear-gradient(
|
|
||||||
180deg,
|
|
||||||
color(display-p3 0.4118 0.4196 0.5725) 0%,
|
|
||||||
color(display-p3 0.1241 0.1265 0.1725) 100%
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.permissionDefaultState {
|
@media (max-width: 768px) {
|
||||||
display: flex;
|
.permissionsContainer {
|
||||||
height: 43.813px;
|
border-radius: 4px;
|
||||||
padding: 8px 16px;
|
padding: 0 0 24px 0;
|
||||||
justify-content: center;
|
}
|
||||||
align-items: center;
|
.permissionsHeader {
|
||||||
align-self: stretch;
|
padding: 12px 16px;
|
||||||
}
|
}
|
||||||
.permissionDefaultState p {
|
|
||||||
display: flex;
|
.permissionsHeader > p {
|
||||||
justify-content: center;
|
color: #fff;
|
||||||
align-items: center;
|
font-size: 18px;
|
||||||
gap: 12px;
|
align-self: stretch;
|
||||||
flex: 1 0 0;
|
}
|
||||||
align-self: stretch;
|
|
||||||
color: #85869b;
|
.svgContainer {
|
||||||
color: color(display-p3 0.5216 0.5255 0.6);
|
display: none;
|
||||||
font-family: Inter;
|
}
|
||||||
font-size: 16px;
|
.permissionDefaultState {
|
||||||
font-style: normal;
|
gap: 12px;
|
||||||
font-weight: 400;
|
align-self: stretch;
|
||||||
line-height: normal;
|
padding: 24px 16px 0 16px;
|
||||||
|
}
|
||||||
|
.permissionsList {
|
||||||
|
padding-top: 16px;
|
||||||
|
}
|
||||||
|
.permissions {
|
||||||
|
padding: 8px 16px;
|
||||||
|
}
|
||||||
|
.permissionDefaultState > p {
|
||||||
|
font-weight: 500;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import TextField from "@/app/components/fields/textfield";
|
|||||||
import Prompts from "@/app/components/prompts/Prompts";
|
import Prompts from "@/app/components/prompts/Prompts";
|
||||||
import useRoleForm from "@/app/hooks/useRolesForm";
|
import useRoleForm from "@/app/hooks/useRolesForm";
|
||||||
import Alert from "@/app/components/alerts/Alert";
|
import Alert from "@/app/components/alerts/Alert";
|
||||||
|
import useIsMobile from "@/app/hooks/useIsMobile";
|
||||||
|
|
||||||
const AddCredentialPage = () => {
|
const AddCredentialPage = () => {
|
||||||
const {
|
const {
|
||||||
@@ -18,7 +19,10 @@ const AddCredentialPage = () => {
|
|||||||
triggerAlert,
|
triggerAlert,
|
||||||
setTriggerAlert,
|
setTriggerAlert,
|
||||||
} = useRoleForm();
|
} = useRoleForm();
|
||||||
|
|
||||||
const [selectedFile, setSelectedFile] = useState(null);
|
const [selectedFile, setSelectedFile] = useState(null);
|
||||||
|
const isMobile = useIsMobile();
|
||||||
|
|
||||||
// Click
|
// Click
|
||||||
const handleFileChange = (e) => {
|
const handleFileChange = (e) => {
|
||||||
const file = e.target.files[0];
|
const file = e.target.files[0];
|
||||||
@@ -27,6 +31,7 @@ const AddCredentialPage = () => {
|
|||||||
console.log(file); //send this to backend later
|
console.log(file); //send this to backend later
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Drag/Drop
|
// Drag/Drop
|
||||||
const handleDrop = (e) => {
|
const handleDrop = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -39,6 +44,7 @@ const AddCredentialPage = () => {
|
|||||||
const handleDragOver = (e) => {
|
const handleDragOver = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={globalStyle.section}>
|
<div className={globalStyle.section}>
|
||||||
{triggerAlert && (
|
{triggerAlert && (
|
||||||
@@ -59,7 +65,7 @@ const AddCredentialPage = () => {
|
|||||||
/>
|
/>
|
||||||
{/* Create Crediantial Container */}
|
{/* Create Crediantial Container */}
|
||||||
<div className={createCredStyle.createCredContainer}>
|
<div className={createCredStyle.createCredContainer}>
|
||||||
<TopToolTip />
|
{isMobile ? "" : <TopToolTip />}
|
||||||
<form
|
<form
|
||||||
className={createCredStyle.inputFieldContainer}
|
className={createCredStyle.inputFieldContainer}
|
||||||
id="form"
|
id="form"
|
||||||
@@ -81,13 +87,11 @@ const AddCredentialPage = () => {
|
|||||||
<Prompts show={false} />
|
<Prompts show={false} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* Upload File */}
|
|
||||||
<div className={createCredStyle.uploadFile}>
|
<div className={createCredStyle.uploadFile}>
|
||||||
{/* Label */}
|
|
||||||
<div className={createCredStyle.label}>
|
<div className={createCredStyle.label}>
|
||||||
<p>Upload File</p>
|
<p className={createCredStyle.labelTxt}>Upload File</p>
|
||||||
{/* Optional or Required */}
|
{/* Optional or Required */}
|
||||||
<p className={createCredStyle.optionalTxt}>(Optional)</p>{" "}
|
{/* <p className={createCredStyle.optionalTxt}>(Optional)</p>{" "} */}
|
||||||
</div>
|
</div>
|
||||||
{/* Upload File */}
|
{/* Upload File */}
|
||||||
<label
|
<label
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
|
align-self: stretch;
|
||||||
}
|
}
|
||||||
.label {
|
.label {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -31,7 +32,6 @@
|
|||||||
}
|
}
|
||||||
.labelTxt {
|
.labelTxt {
|
||||||
color: #d2d3e1;
|
color: #d2d3e1;
|
||||||
color: color(display-p3 0.8235 0.8275 0.8784);
|
|
||||||
font-family: Inter;
|
font-family: Inter;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
@@ -60,9 +60,8 @@
|
|||||||
}
|
}
|
||||||
.label > .optionalTxt {
|
.label > .optionalTxt {
|
||||||
color: #85869b;
|
color: #85869b;
|
||||||
color: color(display-p3 0.5216 0.5255 0.6);
|
|
||||||
font-family: Inter;
|
font-family: Inter;
|
||||||
font-size: 16 px;
|
font-size: 16px;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
@@ -77,22 +76,18 @@
|
|||||||
gap: 10px;
|
gap: 10px;
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
border: 1px dashed #5980f1;
|
border: 2px dashed #5980f1;
|
||||||
border: 2px dashed color(display-p3 0.3804 0.4959 0.9137);
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
.upload:hover {
|
.upload:hover {
|
||||||
background: rgba(129, 135, 255, 0.25);
|
background: rgba(129, 135, 255, 0.25);
|
||||||
background: color(display-p3 0.5098 0.5294 1 / 0.25);
|
|
||||||
}
|
}
|
||||||
.upload:hover .chooseTxt {
|
.upload:hover .chooseTxt {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
color: color(display-p3 1 1 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.chooseTxt {
|
.chooseTxt {
|
||||||
color: #5980f1;
|
color: #5980f1;
|
||||||
color: color(display-p3 0.3804 0.4959 0.9137);
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-family: Inter;
|
font-family: Inter;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
@@ -104,7 +99,6 @@
|
|||||||
|
|
||||||
.dragTxt {
|
.dragTxt {
|
||||||
color: #85869b;
|
color: #85869b;
|
||||||
color: color(display-p3 0.5216 0.5255 0.6);
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-family: Inter;
|
font-family: Inter;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
@@ -113,3 +107,28 @@
|
|||||||
line-height: normal;
|
line-height: normal;
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Mobile */
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.createCredContainer {
|
||||||
|
padding: 32px 16px 0 16px;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inputFieldContainer {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
padding: 0px;
|
||||||
|
gap: 24px;
|
||||||
|
align-self: stretch;
|
||||||
|
}
|
||||||
|
|
||||||
|
.projectName {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upload {
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import React from "react";
|
"use client";
|
||||||
|
import React, { useState } from "react";
|
||||||
import TopHeader from "@/app/components/topHeader/TopHeader";
|
import TopHeader from "@/app/components/topHeader/TopHeader";
|
||||||
import globalStyle from "../../globalStyle.module.css";
|
import globalStyle from "../../globalStyle.module.css";
|
||||||
import editRoleStyle from "./styles.module.css";
|
import editRoleStyle from "./styles.module.css";
|
||||||
import TextField from "@/app/components/fields/textfield";
|
import TextField from "@/app/components/fields/textfield";
|
||||||
import Permissions from "@/app/components/permissions/Permissions";
|
import Permissions from "@/app/components/permissions/Permissions";
|
||||||
|
import Toggle from "@/app/components/mobileToggleTab/Toggle";
|
||||||
|
|
||||||
const ViewRolePage = () => {
|
const ViewRolePage = () => {
|
||||||
const sampleData = [
|
const sampleData = [
|
||||||
@@ -22,6 +24,8 @@ const ViewRolePage = () => {
|
|||||||
{ permission: "service.delete" },
|
{ permission: "service.delete" },
|
||||||
{ permission: "service.update" },
|
{ permission: "service.update" },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const [activeTab, setActiveTab] = useState("details");
|
||||||
return (
|
return (
|
||||||
<div className={globalStyle.section}>
|
<div className={globalStyle.section}>
|
||||||
<div className={globalStyle.mainContainer}>
|
<div className={globalStyle.mainContainer}>
|
||||||
@@ -32,23 +36,30 @@ const ViewRolePage = () => {
|
|||||||
state="view"
|
state="view"
|
||||||
requiredButtons={["back", "title", "edit", "download"]}
|
requiredButtons={["back", "title", "edit", "download"]}
|
||||||
/>
|
/>
|
||||||
<div className={editRoleStyle.addRoleContainer}>
|
<div className={editRoleStyle.editRoleContainer}>
|
||||||
|
{/* Mobile Toggle */}
|
||||||
|
<Toggle
|
||||||
|
activeTab={activeTab}
|
||||||
|
onChange={setActiveTab}
|
||||||
|
tabs={[
|
||||||
|
{ label: "Role Details", value: "details" },
|
||||||
|
{ label: "Permissions", value: "permissions" },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
{/* Input fields Container */}
|
{/* Input fields Container */}
|
||||||
<div className={editRoleStyle.inputFieldContainer}>
|
<div className={editRoleStyle.inputFieldContainer}>
|
||||||
{/* User Details */}
|
{/* User Details */}
|
||||||
<div className={editRoleStyle.userDetails}>
|
<div
|
||||||
{/* Header */}
|
className={`${editRoleStyle.roleDetails} ${activeTab !== "details" ? editRoleStyle.hiddenMobile : ""}`}
|
||||||
|
>
|
||||||
<div className={editRoleStyle.header}>
|
<div className={editRoleStyle.header}>
|
||||||
<div>
|
<div>
|
||||||
<p>Role Details</p>
|
<p>Role Details</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* Input fields */}
|
|
||||||
<form className={editRoleStyle.fields}>
|
<form className={editRoleStyle.fields}>
|
||||||
{/* Email */}
|
|
||||||
<div className={editRoleStyle.inputMainContainer}>
|
<div className={editRoleStyle.inputMainContainer}>
|
||||||
<div className={editRoleStyle.inputContainer}>
|
<div className={editRoleStyle.inputContainer}>
|
||||||
{/* Label */}
|
|
||||||
<div className={editRoleStyle.label}>
|
<div className={editRoleStyle.label}>
|
||||||
<p>Name</p>
|
<p>Name</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -77,7 +88,12 @@ const ViewRolePage = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Permissions */}
|
{/* Permissions */}
|
||||||
<Permissions sampleData={sampleData} />
|
<div
|
||||||
|
className={`${editRoleStyle.userPermissions} ${activeTab !== "permissions" ? editRoleStyle.hiddenMobile : ""}`}
|
||||||
|
>
|
||||||
|
<div className={editRoleStyle.imanginaryDiv}></div>
|
||||||
|
<Permissions sampleData={sampleData} />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.addRoleContainer {
|
.editRoleContainer {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 0px 144px 0px 144px;
|
padding: 0px 144px 0px 144px;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
flex: 1 0 0;
|
flex: 1 0 0;
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
}
|
}
|
||||||
.userDetails {
|
.roleDetails {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 400px;
|
width: 400px;
|
||||||
padding: 20px 24px 48px 24px;
|
padding: 20px 24px 48px 24px;
|
||||||
@@ -23,6 +23,21 @@
|
|||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
background: #1d1e2a;
|
background: #1d1e2a;
|
||||||
}
|
}
|
||||||
|
.imanginaryDiv {
|
||||||
|
padding: 18px;
|
||||||
|
}
|
||||||
|
.userPermissions {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
flex: 1 0 0;
|
||||||
|
align-self: stretch;
|
||||||
|
height: calc(100vh - 175px);
|
||||||
|
position: relative;
|
||||||
|
overflow-y: auto;
|
||||||
|
scrollbar-width: none;
|
||||||
|
padding-bottom: 60px;
|
||||||
|
}
|
||||||
.header {
|
.header {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding-bottom: 24px;
|
padding-bottom: 24px;
|
||||||
@@ -41,7 +56,6 @@
|
|||||||
.header > div > p {
|
.header > div > p {
|
||||||
width: 163px;
|
width: 163px;
|
||||||
color: #d2d3e1;
|
color: #d2d3e1;
|
||||||
color: color(display-p3 0.8235 0.8275 0.8784);
|
|
||||||
font-family: Inter;
|
font-family: Inter;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
@@ -78,7 +92,6 @@
|
|||||||
}
|
}
|
||||||
.label > p {
|
.label > p {
|
||||||
color: #d2d3e1;
|
color: #d2d3e1;
|
||||||
color: color(display-p3 0.8235 0.8275 0.8784);
|
|
||||||
font-family: Inter;
|
font-family: Inter;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
@@ -93,6 +106,36 @@
|
|||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
}
|
}
|
||||||
|
|
||||||
.imanginaryDiv {
|
@media (max-width: 950px) {
|
||||||
padding: 18px;
|
.hiddenMobile {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.editRoleContainer {
|
||||||
|
align-self: stretch;
|
||||||
|
padding: 0 16px;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 0px;
|
||||||
|
}
|
||||||
|
.imanginaryDiv {
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
.header {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.roleDetails {
|
||||||
|
background: none;
|
||||||
|
padding: 0px 0px 0px 0px;
|
||||||
|
margin-top: 32x;
|
||||||
|
}
|
||||||
|
|
||||||
|
.userPermissions {
|
||||||
|
height: calc(100vh - 295px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.roleDetails {
|
||||||
|
background: none;
|
||||||
|
padding: 0px 0px 0px 0px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import React from "react";
|
import React, { useState } from "react";
|
||||||
import TopHeader from "@/app/components/topHeader/TopHeader";
|
import TopHeader from "@/app/components/topHeader/TopHeader";
|
||||||
import globalStyle from "../../globalStyle.module.css";
|
import globalStyle from "../../globalStyle.module.css";
|
||||||
import addRoleStyle from "./styles.module.css";
|
import addRoleStyle from "./styles.module.css";
|
||||||
@@ -7,8 +7,11 @@ import TextField from "@/app/components/fields/textfield";
|
|||||||
import Permissions from "@/app/components/permissions/Permissions";
|
import Permissions from "@/app/components/permissions/Permissions";
|
||||||
import useUserForm from "@/app/hooks/useUserForm";
|
import useUserForm from "@/app/hooks/useUserForm";
|
||||||
import Alert from "@/app/components/alerts/Alert";
|
import Alert from "@/app/components/alerts/Alert";
|
||||||
|
import Toggle from "@/app/components/mobileToggleTab/Toggle";
|
||||||
|
|
||||||
const AddRolePage = () => {
|
const AddRolePage = () => {
|
||||||
|
// Mobile
|
||||||
|
const [activeTab, setActiveTab] = useState("details");
|
||||||
const {
|
const {
|
||||||
register,
|
register,
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
@@ -36,47 +39,50 @@ const AddRolePage = () => {
|
|||||||
requiredButtons={["title", "save"]}
|
requiredButtons={["title", "save"]}
|
||||||
/>
|
/>
|
||||||
<div className={addRoleStyle.addRoleContainer}>
|
<div className={addRoleStyle.addRoleContainer}>
|
||||||
|
<Toggle
|
||||||
|
activeTab={activeTab}
|
||||||
|
onChange={setActiveTab}
|
||||||
|
tabs={[
|
||||||
|
{ label: "Role Details", value: "details" },
|
||||||
|
{ label: "Permissions", value: "permissions" },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
{/* Input fields Container */}
|
{/* Input fields Container */}
|
||||||
<div className={addRoleStyle.inputFieldContainer}>
|
<div className={addRoleStyle.inputFieldContainer}>
|
||||||
{/* User Details */}
|
{/* User Details */}
|
||||||
<div className={addRoleStyle.roleDetails}>
|
<div
|
||||||
{/* Header */}
|
className={`${addRoleStyle.roleDetails} ${activeTab !== "details" ? addRoleStyle.hiddenMobile : ""}`}
|
||||||
|
>
|
||||||
<div className={addRoleStyle.header}>
|
<div className={addRoleStyle.header}>
|
||||||
<div>
|
<div>
|
||||||
<p>Role Details</p>
|
<p>Role Details</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* Input fields */}
|
{/* Ibalhin ning form na tag */}
|
||||||
<form
|
<form
|
||||||
className={addRoleStyle.fields}
|
className={addRoleStyle.fields}
|
||||||
id="form"
|
id="form"
|
||||||
onSubmit={handleSubmit(onSubmit)}
|
onSubmit={handleSubmit(onSubmit)}
|
||||||
>
|
>
|
||||||
{/* Email */}
|
|
||||||
<div className={addRoleStyle.inputMainContainer}>
|
<div className={addRoleStyle.inputMainContainer}>
|
||||||
<div className={addRoleStyle.inputContainer}>
|
<div className={addRoleStyle.inputContainer}>
|
||||||
{/* Label */}
|
|
||||||
<div className={addRoleStyle.label}>
|
<div className={addRoleStyle.label}>
|
||||||
<p>Name</p>
|
<p>Name</p>
|
||||||
</div>
|
</div>
|
||||||
{/* Input field */}
|
|
||||||
<div className={addRoleStyle.inputField}>
|
<div className={addRoleStyle.inputField}>
|
||||||
<TextField
|
<TextField
|
||||||
placeHolder="Enter name"
|
placeHolder="Enter role name"
|
||||||
{...register("roleName", { required: true })}
|
{...register("roleName", { required: true })}
|
||||||
hasError={!!errors.roleName}
|
hasError={!!errors.roleName}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* Full Name */}
|
|
||||||
<div className={addRoleStyle.inputMainContainer}>
|
<div className={addRoleStyle.inputMainContainer}>
|
||||||
<div className={addRoleStyle.inputContainer}>
|
<div className={addRoleStyle.inputContainer}>
|
||||||
{/* Label */}
|
|
||||||
<div className={addRoleStyle.label}>
|
<div className={addRoleStyle.label}>
|
||||||
<p>Organization ID</p>
|
<p>Organization ID</p>
|
||||||
</div>
|
</div>
|
||||||
{/* Input field */}
|
|
||||||
<div className={addRoleStyle.inputField}>
|
<div className={addRoleStyle.inputField}>
|
||||||
<TextField
|
<TextField
|
||||||
placeHolder="Enter organization ID"
|
placeHolder="Enter organization ID"
|
||||||
@@ -90,7 +96,12 @@ const AddRolePage = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Permissions */}
|
{/* Permissions */}
|
||||||
<Permissions />
|
<div
|
||||||
|
className={`${addRoleStyle.userPermissions} ${activeTab !== "permissions" ? addRoleStyle.hiddenMobile : ""}`}
|
||||||
|
>
|
||||||
|
<div className={addRoleStyle.imanginaryDiv}></div>
|
||||||
|
<Permissions />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -22,7 +22,21 @@
|
|||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
background: #1d1e2a;
|
background: #1d1e2a;
|
||||||
background: color(display-p3 0.1137 0.1176 0.1608);
|
}
|
||||||
|
.imanginaryDiv {
|
||||||
|
padding: 18px;
|
||||||
|
}
|
||||||
|
.userPermissions {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
flex: 1 0 0;
|
||||||
|
align-self: stretch;
|
||||||
|
height: calc(100vh - 175px);
|
||||||
|
position: relative;
|
||||||
|
overflow: auto;
|
||||||
|
scrollbar-width: none;
|
||||||
|
padding-bottom: 60px;
|
||||||
}
|
}
|
||||||
.header {
|
.header {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -42,7 +56,6 @@
|
|||||||
.header > div > p {
|
.header > div > p {
|
||||||
width: 163px;
|
width: 163px;
|
||||||
color: #d2d3e1;
|
color: #d2d3e1;
|
||||||
color: color(display-p3 0.8235 0.8275 0.8784);
|
|
||||||
font-family: Inter;
|
font-family: Inter;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
@@ -79,7 +92,6 @@
|
|||||||
}
|
}
|
||||||
.label > p {
|
.label > p {
|
||||||
color: #d2d3e1;
|
color: #d2d3e1;
|
||||||
color: color(display-p3 0.8235 0.8275 0.8784);
|
|
||||||
font-family: Inter;
|
font-family: Inter;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
@@ -93,6 +105,35 @@
|
|||||||
gap: 8px;
|
gap: 8px;
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
}
|
}
|
||||||
.imanginaryDiv {
|
@media (max-width: 950px) {
|
||||||
padding: 18px;
|
.hiddenMobile {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.addRoleContainer {
|
||||||
|
align-self: stretch;
|
||||||
|
padding: 0 16px;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 0px;
|
||||||
|
}
|
||||||
|
.imanginaryDiv {
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
.header {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.roleDetails {
|
||||||
|
background: none;
|
||||||
|
padding: 0px 0px 0px 0px;
|
||||||
|
margin-top: 32px;
|
||||||
|
}
|
||||||
|
.userPermissions {
|
||||||
|
height: calc(100vh - 295px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.roleDetails {
|
||||||
|
background: none;
|
||||||
|
padding: 0px 0px 0px 0px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,37 +9,34 @@ import ViewIcon from "../components/icons/view";
|
|||||||
import DeleteIcon from "../components/icons/delete";
|
import DeleteIcon from "../components/icons/delete";
|
||||||
import SuccessToast from "../components/toast/success/successToast";
|
import SuccessToast from "../components/toast/success/successToast";
|
||||||
import ActionButton from "../components/actionButton/ActionButton";
|
import ActionButton from "../components/actionButton/ActionButton";
|
||||||
|
import MobileSearchBar from "../components/mobileSearchBar/MobileSearchBar";
|
||||||
|
import Card from "./role-card/Card";
|
||||||
|
|
||||||
const RolesPage = () => {
|
const RolesPage = () => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const sampleData = [
|
const sampleData = [
|
||||||
{
|
{
|
||||||
id: 1,
|
|
||||||
name: "organization-owner",
|
name: "organization-owner",
|
||||||
orgId: "67160a5ae69144ff19aafb86",
|
orgId: "67160a5ae69144ff19aafb86",
|
||||||
permissions: "35 Permissions",
|
permissions: "35 Permissions",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 2,
|
|
||||||
name: "organization-owner",
|
name: "organization-owner",
|
||||||
orgId: "67160a5ae69144ff19aafb86",
|
orgId: "67160a5ae69144ff19aafb86",
|
||||||
permissions: "35 Permissions",
|
permissions: "35 Permissions",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 3,
|
|
||||||
name: "organization-owner",
|
name: "organization-owner",
|
||||||
orgId: "67160a5ae69144ff19aafb86",
|
orgId: "67160a5ae69144ff19aafb86",
|
||||||
permissions: "35 Permissions",
|
permissions: "35 Permissions",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 4,
|
|
||||||
name: "organization-owner",
|
name: "organization-owner",
|
||||||
orgId: "67160a5ae69144ff19aafb86",
|
orgId: "67160a5ae69144ff19aafb86",
|
||||||
permissions: "35 Permissions",
|
permissions: "35 Permissions",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 5,
|
|
||||||
name: "organization-owner",
|
name: "organization-owner",
|
||||||
orgId: "67160a5ae69144ff19aafb86",
|
orgId: "67160a5ae69144ff19aafb86",
|
||||||
permissions: "35 Permissions",
|
permissions: "35 Permissions",
|
||||||
@@ -55,6 +52,21 @@ const RolesPage = () => {
|
|||||||
topbarTitle="Roles"
|
topbarTitle="Roles"
|
||||||
requiredButtons={["title", "add", "search"]}
|
requiredButtons={["title", "add", "search"]}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{/* Mobile View */}
|
||||||
|
<div className={styles.cardContainer}>
|
||||||
|
<MobileSearchBar />
|
||||||
|
{sampleData.map((role, index) => {
|
||||||
|
return (
|
||||||
|
<Card
|
||||||
|
role={role}
|
||||||
|
key={index}
|
||||||
|
onClick={() => router.push(`/roles/${index}`)}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* Users Table */}
|
{/* Users Table */}
|
||||||
<div className={styles.tableContainer}>
|
<div className={styles.tableContainer}>
|
||||||
<table className={styles.table}>
|
<table className={styles.table}>
|
||||||
@@ -71,8 +83,8 @@ const RolesPage = () => {
|
|||||||
//role or user?
|
//role or user?
|
||||||
return (
|
return (
|
||||||
<tr
|
<tr
|
||||||
key={role.id}
|
key={index}
|
||||||
onClick={() => router.push(`/roles/${role.id}`)}
|
onClick={() => router.push(`/roles/${index}`)}
|
||||||
>
|
>
|
||||||
<td>{role.name}</td>
|
<td>{role.name}</td>
|
||||||
<td>{role.orgId}</td>
|
<td>{role.orgId}</td>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import DeleteIcon from "@/app/components/icons/delete";
|
import DeleteIcon from "@/app/components/icons/delete";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import styles from "./styles.module.css";
|
||||||
|
|
||||||
const Card = (props) => {
|
const Card = (props) => {
|
||||||
return (
|
return (
|
||||||
@@ -7,15 +8,15 @@ const Card = (props) => {
|
|||||||
<div className={styles.cardDetails}>
|
<div className={styles.cardDetails}>
|
||||||
<div className={styles.list}>
|
<div className={styles.list}>
|
||||||
<p>Name</p>
|
<p>Name</p>
|
||||||
<p>{props?.user?.email}</p>
|
<p>{props?.role?.name}</p>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.list}>
|
<div className={styles.list}>
|
||||||
<p>Organization ID</p>
|
<p>Organization ID</p>
|
||||||
<p>{props?.user?.fullName}</p>
|
<p>{props?.role?.orgId}</p>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.list}>
|
<div className={styles.list}>
|
||||||
<p>Permissions</p>
|
<p>Permissions</p>
|
||||||
<p>{props?.user?.createdAt}</p>
|
<p>{props?.role?.permissions}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.cardAction}>
|
<div className={styles.cardAction}>
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
color: #85869b;
|
color: #85869b;
|
||||||
font-family: Inter;
|
font-family: Inter;
|
||||||
font-size: 13px;
|
font-size: var(--table-font-size);
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
flex: 1 0 0;
|
flex: 1 0 0;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
padding: 12px 24px;
|
padding: 12px 24px;
|
||||||
color: #eeeffd;
|
color: #eeeffd;
|
||||||
font-family: Inter;
|
font-family: Inter;
|
||||||
font-size: 13px;
|
font-size: var(--table-font-size);
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
@@ -65,15 +65,23 @@
|
|||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Mobile */
|
|
||||||
.cardContainer {
|
.cardContainer {
|
||||||
display: flex;
|
display: none;
|
||||||
padding: 0 16px;
|
}
|
||||||
padding-bottom: 50px;
|
|
||||||
height: calc(100vh - 170px);
|
@media (max-width: 768px) {
|
||||||
flex-direction: column;
|
.cardContainer {
|
||||||
align-items: flex-start;
|
display: flex;
|
||||||
gap: 12px;
|
padding: 0 16px;
|
||||||
align-self: stretch;
|
padding-bottom: 50px;
|
||||||
overflow: auto;
|
height: calc(100vh - 170px);
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 12px;
|
||||||
|
align-self: stretch;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
.tableContainer {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { useState } from "react";
|
|||||||
import TextField from "@/app/components/fields/textfield";
|
import TextField from "@/app/components/fields/textfield";
|
||||||
import SelectField from "@/app/components/select/SelectField";
|
import SelectField from "@/app/components/select/SelectField";
|
||||||
import Permissions from "@/app/components/permissions/Permissions";
|
import Permissions from "@/app/components/permissions/Permissions";
|
||||||
|
import Toggle from "@/app/components/mobileToggleTab/Toggle";
|
||||||
|
|
||||||
const ViewUserPage = () => {
|
const ViewUserPage = () => {
|
||||||
const sampleData = [
|
const sampleData = [
|
||||||
@@ -26,6 +27,9 @@ const ViewUserPage = () => {
|
|||||||
{ permission: "service.update" },
|
{ permission: "service.update" },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Mobile
|
||||||
|
const [activeTab, setActiveTab] = useState("details");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={globalStyle.section}>
|
<div className={globalStyle.section}>
|
||||||
<div className={globalStyle.mainContainer}>
|
<div className={globalStyle.mainContainer}>
|
||||||
@@ -36,12 +40,22 @@ const ViewUserPage = () => {
|
|||||||
state="view"
|
state="view"
|
||||||
requiredButtons={["back", "title", "edit", "download"]}
|
requiredButtons={["back", "title", "edit", "download"]}
|
||||||
/>
|
/>
|
||||||
<div className={editUserStyle.addUserContainer}>
|
<div className={editUserStyle.editUserContainer}>
|
||||||
|
{/* Mobile Toggle */}
|
||||||
|
<Toggle
|
||||||
|
activeTab={activeTab}
|
||||||
|
onChange={setActiveTab}
|
||||||
|
tabs={[
|
||||||
|
{ label: "User Details", value: "details" },
|
||||||
|
{ label: "Permissions", value: "permissions" },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
{/* Input fields Container */}
|
{/* Input fields Container */}
|
||||||
<div className={editUserStyle.inputFieldContainer}>
|
<div className={editUserStyle.inputFieldContainer}>
|
||||||
{/* User Details */}
|
{/* User Details */}
|
||||||
<div className={editUserStyle.userDetails}>
|
<div
|
||||||
{/* Header */}
|
className={`${editUserStyle.userDetails} ${activeTab !== "details" ? editUserStyle.hiddenMobile : ""}`}
|
||||||
|
>
|
||||||
<div className={editUserStyle.header}>
|
<div className={editUserStyle.header}>
|
||||||
<div>
|
<div>
|
||||||
<p>User Details</p>
|
<p>User Details</p>
|
||||||
@@ -61,10 +75,8 @@ const ViewUserPage = () => {
|
|||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{/* Email */}
|
|
||||||
<div className={editUserStyle.inputMainContainer}>
|
<div className={editUserStyle.inputMainContainer}>
|
||||||
<div className={editUserStyle.inputContainer}>
|
<div className={editUserStyle.inputContainer}>
|
||||||
{/* Label */}
|
|
||||||
<div className={editUserStyle.label}>
|
<div className={editUserStyle.label}>
|
||||||
<p>Email</p>
|
<p>Email</p>
|
||||||
{/* <p className={editUserStyle.optionalTxt}>(Optional)</p> */}
|
{/* <p className={editUserStyle.optionalTxt}>(Optional)</p> */}
|
||||||
@@ -98,7 +110,12 @@ const ViewUserPage = () => {
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
{/* Permissions */}
|
{/* Permissions */}
|
||||||
<Permissions sampleData={sampleData} />
|
<div
|
||||||
|
className={`${editUserStyle.userPermissions} ${activeTab !== "permissions" ? editUserStyle.hiddenMobile : ""}`}
|
||||||
|
>
|
||||||
|
<div className={editUserStyle.imanginaryDiv}></div>
|
||||||
|
<Permissions sampleData={sampleData} />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
.addUserContainer {
|
.editUserContainer {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 0px 144px 0 144px;
|
padding: 0px 144px 0 144px;
|
||||||
align-items: flex-start;
|
/* align-items: flex-start; */
|
||||||
gap: 24px;
|
gap: 24px;
|
||||||
flex: 1 0 0;
|
flex: 1 0 0;
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
position: relative;
|
/* position: relative; */
|
||||||
}
|
}
|
||||||
.inputFieldContainer {
|
.inputFieldContainer {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -24,6 +24,22 @@
|
|||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
background: #1d1e2a;
|
background: #1d1e2a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.imanginaryDiv {
|
||||||
|
padding: 18px;
|
||||||
|
}
|
||||||
|
.userPermissions {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
flex: 1 0 0;
|
||||||
|
align-self: stretch;
|
||||||
|
height: calc(100vh - 175px);
|
||||||
|
position: relative;
|
||||||
|
overflow-y: auto;
|
||||||
|
scrollbar-width: none;
|
||||||
|
padding-bottom: 60px;
|
||||||
|
}
|
||||||
.header {
|
.header {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding-bottom: 24px;
|
padding-bottom: 24px;
|
||||||
@@ -42,7 +58,6 @@
|
|||||||
.header > div > p {
|
.header > div > p {
|
||||||
width: 163px;
|
width: 163px;
|
||||||
color: #d2d3e1;
|
color: #d2d3e1;
|
||||||
color: color(display-p3 0.8235 0.8275 0.8784);
|
|
||||||
font-family: Inter;
|
font-family: Inter;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
@@ -113,6 +128,37 @@
|
|||||||
gap: 8px;
|
gap: 8px;
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
}
|
}
|
||||||
.imanginaryDiv {
|
|
||||||
padding: 18px;
|
@media (max-width: 950px) {
|
||||||
|
.hiddenMobile {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.editUserContainer {
|
||||||
|
align-self: stretch;
|
||||||
|
padding: 0 16px;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 0px;
|
||||||
|
}
|
||||||
|
.imanginaryDiv {
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
.header {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.userDetails {
|
||||||
|
background: none;
|
||||||
|
padding: 0px 0px 0px 0px;
|
||||||
|
margin-top: 32x;
|
||||||
|
}
|
||||||
|
|
||||||
|
.userPermissions {
|
||||||
|
height: calc(100vh - 295px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.userDetails {
|
||||||
|
background: none;
|
||||||
|
padding: 0px 0px 0px 0px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import React from "react";
|
import React, { useState } from "react";
|
||||||
import TopHeader from "@/app/components/topHeader/TopHeader";
|
import TopHeader from "@/app/components/topHeader/TopHeader";
|
||||||
import globalStyle from "../../globalStyle.module.css";
|
import globalStyle from "../../globalStyle.module.css";
|
||||||
import addUserStyle from "./styles.module.css";
|
import addUserStyle from "./styles.module.css";
|
||||||
@@ -8,7 +8,11 @@ import SelectField from "@/app/components/select/SelectField";
|
|||||||
import Permissions from "@/app/components/permissions/Permissions";
|
import Permissions from "@/app/components/permissions/Permissions";
|
||||||
import useUserForm from "@/app/hooks/useUserForm";
|
import useUserForm from "@/app/hooks/useUserForm";
|
||||||
import Alert from "@/app/components/alerts/Alert";
|
import Alert from "@/app/components/alerts/Alert";
|
||||||
|
import Toggle from "@/app/components/mobileToggleTab/Toggle";
|
||||||
|
|
||||||
const AddUserPage = () => {
|
const AddUserPage = () => {
|
||||||
|
// Mobile
|
||||||
|
const [activeTab, setActiveTab] = useState("details");
|
||||||
const {
|
const {
|
||||||
register,
|
register,
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
@@ -36,24 +40,34 @@ const AddUserPage = () => {
|
|||||||
state="add"
|
state="add"
|
||||||
requiredButtons={["title", "save"]}
|
requiredButtons={["title", "save"]}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className={addUserStyle.addUserContainer}>
|
<div className={addUserStyle.addUserContainer}>
|
||||||
{/* Input fields Container */}
|
{/* Mobile Toggle */}
|
||||||
|
<Toggle
|
||||||
|
activeTab={activeTab}
|
||||||
|
onChange={setActiveTab}
|
||||||
|
tabs={[
|
||||||
|
{ label: "User Details", value: "details" },
|
||||||
|
{ label: "Permissions", value: "permissions" },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
{/* Input fields Container */}
|
||||||
<div className={addUserStyle.inputFieldContainer}>
|
<div className={addUserStyle.inputFieldContainer}>
|
||||||
{/* User Details */}
|
{/* User Details */}
|
||||||
<div className={addUserStyle.userDetails}>
|
<div
|
||||||
{/* Header */}
|
className={`${addUserStyle.userDetails} ${activeTab !== "details" ? addUserStyle.hiddenMobile : ""}`}
|
||||||
|
>
|
||||||
<div className={addUserStyle.header}>
|
<div className={addUserStyle.header}>
|
||||||
<div>
|
<div>
|
||||||
<p>User Details</p>
|
<p>User Details</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* Input fields */}
|
{/* Ibalhin ning form na tag */}
|
||||||
<form
|
<form
|
||||||
className={addUserStyle.fields}
|
className={addUserStyle.fields}
|
||||||
id="form"
|
id="form"
|
||||||
onSubmit={handleSubmit(onSubmit)}
|
onSubmit={handleSubmit(onSubmit)}
|
||||||
>
|
>
|
||||||
{/* Role and Dropdown */}
|
|
||||||
<div className={addUserStyle.roleField}>
|
<div className={addUserStyle.roleField}>
|
||||||
<p>Role</p>
|
<p>Role</p>
|
||||||
<SelectField
|
<SelectField
|
||||||
@@ -68,11 +82,9 @@ const AddUserPage = () => {
|
|||||||
{/* Email */}
|
{/* Email */}
|
||||||
<div className={addUserStyle.inputMainContainer}>
|
<div className={addUserStyle.inputMainContainer}>
|
||||||
<div className={addUserStyle.inputContainer}>
|
<div className={addUserStyle.inputContainer}>
|
||||||
{/* Label */}
|
|
||||||
<div className={addUserStyle.label}>
|
<div className={addUserStyle.label}>
|
||||||
<p>Email</p>
|
<p>Email</p>
|
||||||
</div>
|
</div>
|
||||||
{/* Input field */}
|
|
||||||
<div className={addUserStyle.inputField}>
|
<div className={addUserStyle.inputField}>
|
||||||
<TextField
|
<TextField
|
||||||
placeHolder="Enter email"
|
placeHolder="Enter email"
|
||||||
@@ -85,11 +97,9 @@ const AddUserPage = () => {
|
|||||||
{/* Full Name */}
|
{/* Full Name */}
|
||||||
<div className={addUserStyle.inputMainContainer}>
|
<div className={addUserStyle.inputMainContainer}>
|
||||||
<div className={addUserStyle.inputContainer}>
|
<div className={addUserStyle.inputContainer}>
|
||||||
{/* Label */}
|
|
||||||
<div className={addUserStyle.label}>
|
<div className={addUserStyle.label}>
|
||||||
<p>Full Name</p>
|
<p>Full Name</p>
|
||||||
</div>
|
</div>
|
||||||
{/* Input field */}
|
|
||||||
<div className={addUserStyle.inputField}>
|
<div className={addUserStyle.inputField}>
|
||||||
<TextField
|
<TextField
|
||||||
placeHolder="Enter full name"
|
placeHolder="Enter full name"
|
||||||
@@ -103,7 +113,12 @@ const AddUserPage = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Permissions */}
|
{/* Permissions */}
|
||||||
<Permissions />
|
<div
|
||||||
|
className={`${addUserStyle.userPermissions} ${activeTab !== "permissions" ? addUserStyle.hiddenMobile : ""}`}
|
||||||
|
>
|
||||||
|
<div className={addUserStyle.imanginaryDiv}></div>
|
||||||
|
<Permissions />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -22,7 +22,22 @@
|
|||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
background: #1d1e2a;
|
background: #1d1e2a;
|
||||||
background: color(display-p3 0.1137 0.1176 0.1608);
|
}
|
||||||
|
|
||||||
|
.imanginaryDiv {
|
||||||
|
padding: 18px;
|
||||||
|
}
|
||||||
|
.userPermissions {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
flex: 1 0 0;
|
||||||
|
align-self: stretch;
|
||||||
|
height: calc(100vh - 175px);
|
||||||
|
position: relative;
|
||||||
|
overflow: auto;
|
||||||
|
scrollbar-width: none;
|
||||||
|
padding-bottom: 60px;
|
||||||
}
|
}
|
||||||
.header {
|
.header {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -42,7 +57,6 @@
|
|||||||
.header > div > p {
|
.header > div > p {
|
||||||
width: 163px;
|
width: 163px;
|
||||||
color: #d2d3e1;
|
color: #d2d3e1;
|
||||||
color: color(display-p3 0.8235 0.8275 0.8784);
|
|
||||||
font-family: Inter;
|
font-family: Inter;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
@@ -79,7 +93,6 @@
|
|||||||
}
|
}
|
||||||
.label > p {
|
.label > p {
|
||||||
color: #d2d3e1;
|
color: #d2d3e1;
|
||||||
color: color(display-p3 0.8235 0.8275 0.8784);
|
|
||||||
font-family: Inter;
|
font-family: Inter;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
@@ -100,6 +113,37 @@
|
|||||||
gap: 8px;
|
gap: 8px;
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
}
|
}
|
||||||
.imanginaryDiv {
|
|
||||||
padding: 18px;
|
@media (max-width: 950px) {
|
||||||
|
.hiddenMobile {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.addUserContainer {
|
||||||
|
align-self: stretch;
|
||||||
|
padding: 0 16px;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 0px;
|
||||||
|
}
|
||||||
|
.imanginaryDiv {
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
.header {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.userDetails {
|
||||||
|
background: none;
|
||||||
|
padding: 0px 0px 0px 0px;
|
||||||
|
margin-top: 32px;
|
||||||
|
}
|
||||||
|
.userPermissions {
|
||||||
|
height: calc(100vh - 295px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.userDetails {
|
||||||
|
background: none;
|
||||||
|
padding: 0px 0px 0px 0px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
color: #85869b;
|
color: #85869b;
|
||||||
font-family: Inter;
|
font-family: Inter;
|
||||||
|
|
||||||
font-size: var(--table-font-size);
|
font-size: var(--table-font-size);
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
flex: 1 0 0;
|
flex: 1 0 0;
|
||||||
@@ -78,7 +77,6 @@
|
|||||||
gap: 12px;
|
gap: 12px;
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
background-color: red;
|
|
||||||
}
|
}
|
||||||
.tableContainer {
|
.tableContainer {
|
||||||
display: none;
|
display: none;
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
border-bottom: 1px solid #2c2d3d;
|
border-bottom: 1px solid #2c2d3d;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
background-color: green;
|
|
||||||
}
|
}
|
||||||
.cardDetails {
|
.cardDetails {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
Reference in New Issue
Block a user