diff --git a/frontend/src/app/agents/[agentsId]/page.jsx b/frontend/src/app/agents/[agentsId]/page.jsx index 51035fd..9d482c0 100644 --- a/frontend/src/app/agents/[agentsId]/page.jsx +++ b/frontend/src/app/agents/[agentsId]/page.jsx @@ -6,97 +6,174 @@ import TopToolTip from "@/app/components/topToolTip/TopToolTip"; import globalStyle from "../../globalStyle.module.css"; import createAgentStyle from "./styles.module.css"; import Prompts from "@/app/components/prompts/Prompts"; +import useAgentForm from "@/app/hooks/useAgentForm"; +import Alert from "@/app/components/alerts/Alert"; +import Checkbox from "@/app/components/customCheckbox/Checkbox"; const ViewAgentPage = () => { - const [isChecked, setIsChecked] = useState(false); - - const handleCheckboxChange = (e) => { - setIsChecked(e.target.checked); - }; + const [useVpn, setUseVpn] = useState(true); + const [enableLoki, setEnableLoki] = useState(true); + const { + register, + handleSubmit, + errors, + onSubmit, + triggerAlert, + setTriggerAlert, + } = useAgentForm(); return (
+ {triggerAlert && ( + setEditState(true)} + title="Create New Agent" + /> + )}
{/* Create agent Container */} -
- -
- {/* Header */} -
-
-

Agent Details

-
-
- {/* Agent name input */} -
- {/* Label */} -
-

Agent Name

- {/*

*

*/} -
- {/* Input Field */} - - -
- {/* Kubernetes API input */} -
- {/* Label */} -
-

Kubernetes API Proxy Name

- {/*

*

*/} -
- {/* Input Field */} - - -
- {/* Checkbox */} -
-
-
- {/* Checkbox */} -
- -
- {/* List */} -
-

- Use Tailscale VPN -

-

- Enable Tailscale for secure private networking. When - enabled,
the endpoint will be automatically - resolved from Tailscale. -

-
+
+
+
+
+ {/* AGENT FORM */} +
+
+

Agent Details

-
- {/* Agent endpoint */} -
- {/* Label */} -
-

Agent Endpoint

- {/*

*

*/} +
+
+

Agent Name

+ {/*

*

*/} +
+ +
- {/* Input Field */} - - +
+
+

Kubernetes API Proxy Name

+ {/*

*

*/} +
+ + +
+ setUseVpn(e.target.checked)} + label="Use Tailscale VPN" + description={ + <> + Enable Tailscale for secure private networking. When + enabled,
+ the endpoint will be automatically resolved from + Tailscale. + + } + /> + {/* Agent endpoint */} +
+
+

Tailscale Device Prefix

+ {/*

*

*/} +
+ + +
+
+
+

Tailscale Port

+ {/*

*

*/} +
+ + +
+
+ +
+ {/* Header */} +
+
+

Loki Integration (Optional)

+
+
+ setEnableLoki(e.target.checked)} + label="Enable Loki Logging" + description="Configure Loki for centralized logging and log streaming." + /> + + {enableLoki && ( + <> +
+
+

Loki Endpoint

+ {/*

*

*/} +
+ + +
+
+
+

Tenant Name

+ {/*

*

*/} +
+ + +
+
+
+

Password

+ {/*

*

*/} +
+ + +
+ + )}
-
+
diff --git a/frontend/src/app/agents/[agentsId]/styles.module.css b/frontend/src/app/agents/[agentsId]/styles.module.css index 61b9327..14d5251 100644 --- a/frontend/src/app/agents/[agentsId]/styles.module.css +++ b/frontend/src/app/agents/[agentsId]/styles.module.css @@ -1,23 +1,31 @@ -.createAgentContainer { +.formContainer { display: flex; flex-direction: column; - align-items: center; - gap: 48px; + align-items: flex-start; + gap: 10px; flex: 1 0 0; align-self: stretch; } +.createAgentContainer { + display: flex; + justify-content: center; + align-items: flex-start; + align-self: stretch; + gap: 16px; + flex: 1 1 auto; + padding-top: 48px; + height: calc(100vh - 100px - 70px); + overflow-y: auto; + scrollbar-width: none; +} + .inputMainContainer { display: flex; padding: 24px; flex-direction: column; align-items: flex-start; gap: 24px; - border-radius: 8px; - height: calc(100vh - 260px); - position: relative; - overflow: auto; - scrollbar-width: none; } .headerContainer { display: flex; @@ -34,9 +42,9 @@ flex: 1 0 0; } .headerTxt > p { - width: 163px; + /* width: 163px; */ + align-self: stretch; color: #d2d3e1; - color: color(display-p3 0.8235 0.8275 0.8784); font-family: Inter; font-size: 20px; font-style: normal; @@ -70,112 +78,11 @@ font-weight: 600; } -.checkboxMainContainer { +.lokiContainer { display: flex; + width: 548px; + padding: 24px; flex-direction: column; align-items: flex-start; - gap: 10px; - align-self: stretch; -} -.checkboxContainer { - display: flex; - align-items: flex-start; - align-self: stretch; -} -.checkbox { - display: flex; - padding: var(--Basic-Forms-Checkbox-Input-Sizing-Y-SM, 10px) - var(--Basic-Forms-Checkbox-Input-Sizing-X-SM, 12px); - align-items: flex-start; - gap: var(--Basic-Forms-Checkbox-Gap-Between, 16px); - flex: 1 0 0; - border-radius: var(--Basic-Forms-Checkbox-Border-Radius, 8px); - background: #1d1e2a; - background: color(display-p3 0.1137 0.1176 0.1608); -} -.check { - display: flex; - padding-top: var(--Basic-Forms-Checkbox-Inline-Y, 4px); - align-items: flex-start; - gap: var(--Basic-Forms-Checkbox-Inline-Gap-Between, 10px); -} -.hiddenCheckbox { - appearance: none; - -webkit-appearance: none; - -moz-appearance: none; - width: 16px; - height: 16px; - display: flex; - justify-content: center; - align-items: center; - border-radius: var(--Basic-Forms-Checkbox-Check-Icon-Border-Radius, 4px); - border: 1px solid - var(--Basic-Forms-Checkbox-Check-Icon-Border-Border-Active-Color, #0067fd); - border: 1px solid - var( - --Basic-Forms-Checkbox-Check-Icon-Border-Border-Active-Color, - color(display-p3 0.1451 0.3882 0.9216) - ); - cursor: pointer; - position: relative; -} -.hiddenCheckbox:checked { - border-radius: var(--Basic-Forms-Checkbox-Check-Icon-Border-Radius, 4px); - border: 1px solid - var(--Basic-Forms-Checkbox-Check-Icon-Border-Border-Active-Color, #0067fd); - border: 1px solid - var( - --Basic-Forms-Checkbox-Check-Icon-Border-Border-Active-Color, - color(display-p3 0.1451 0.3882 0.9216) - ); - background: var( - --Basic-Forms-Checkbox-Check-Icon-Background-Bg-Active-Color, - #0067fd - ); - background: var( - --Basic-Forms-Checkbox-Check-Icon-Background-Bg-Active-Color, - color(display-p3 0.1451 0.3882 0.9216) - ); -} -.hiddenCheckbox::after { - content: ""; - position: absolute; - inset: 0; - background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='8' viewBox='0 0 11 8' fill='none'%3E%3Cpath d='M9.83333 0.5L3.41667 6.91667L0.5 4' stroke='white' style='stroke:white;stroke-opacity:1;' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); - background-repeat: no-repeat; - background-position: center; - opacity: 0; -} -.hiddenCheckbox:checked::after { - opacity: 1; -} - -.list { - display: flex; - flex-direction: column; - align-items: flex-start; - gap: 4px; - flex: 1 0 0; -} -.placeholderTxt { - align-self: stretch; - color: #d2d3e1; - color: color(display-p3 0.8235 0.8275 0.8784); - font-family: Inter; - font-size: 16px; - font-style: normal; - font-weight: 500; - line-height: 24px; /* 150% */ - letter-spacing: 0.08px; -} -.secondaryTxt { - align-self: stretch; - color: #697281; - color: color(display-p3 0.4196 0.4471 0.502); - font-family: Inter; - font-size: 14px; - font-style: normal; - font-weight: 500; - line-height: 20px; /* 142.857% */ - letter-spacing: 0.07px; + gap: 24px; } diff --git a/frontend/src/app/agents/add/page.jsx b/frontend/src/app/agents/add/page.jsx index 545f146..f9abc0d 100644 --- a/frontend/src/app/agents/add/page.jsx +++ b/frontend/src/app/agents/add/page.jsx @@ -8,13 +8,11 @@ import createAgentStyle from "./styles.module.css"; import Prompts from "@/app/components/prompts/Prompts"; import useAgentForm from "@/app/hooks/useAgentForm"; import Alert from "@/app/components/alerts/Alert"; +import Checkbox from "@/app/components/customCheckbox/Checkbox"; const AddAgentPage = () => { - const [isChecked, setIsChecked] = useState(false); - - const handleCheckboxChange = (e) => { - setIsChecked(e.target.checked); - }; + const [useVpn, setUseVpn] = useState(false); + const [enableLoki, setEnableLoki] = useState(false); const { register, handleSubmit, @@ -42,94 +40,131 @@ const AddAgentPage = () => { state="add" requiredButtons={["title", "save"]} /> + {/* Create agent Container */} -
- -
- {/* Header */} -
-
-

Agent Details

-
-
- {/* Agent name input */} -
- {/* Label */} -
-

Agent Name

-

*

-
- {/* Input Field */} - - -
- {/* Kubernetes API input */} -
- {/* Label */} -
-

Kubernetes API Proxy Name

-

*

-
- {/* Input Field */} - - -
- {/* Checkbox */} -
-
-
- {/* Checkbox */} -
- -
- {/* List */} -
-

- Use Tailscale VPN -

-

- Enable Tailscale for secure private networking. When - enabled,
the endpoint will be automatically - resolved from Tailscale. -

-
+ +
+
+
+ {/* AGENT FORM */} +
+
+

Agent Details

-
- {/* Agent endpoint */} -
- {/* Label */} -
-

Agent Endpoint

-

*

+
+
+

Agent Name

+

*

+
+ +
- {/* Input Field */} - +
+

Kubernetes API Proxy Name

+

*

+
+ + +
+ setUseVpn(e.target.checked)} + label="Use Tailscale VPN" + description={ + <> + Enable Tailscale for secure private networking. When + enabled,
+ the endpoint will be automatically resolved from + Tailscale. + + } /> - + {/* Agent endpoint */} +
+
+

Agent Endpoint

+

*

+
+ + +
- -
+ +
+ {/* Header */} +
+
+

Loki Integration (Optional)

+
+
+ setEnableLoki(e.target.checked)} + label="Enable Loki Logging" + description="Configure Loki for centralized logging and log streaming." + /> + + {enableLoki && ( + <> +
+
+

Loki Endpoint

+ {/*

*

*/} +
+ + +
+
+
+

Tenant Name

+ {/*

*

*/} +
+ + +
+
+
+

Password

+ {/*

*

*/} +
+ + +
+ + )} +
+
+
diff --git a/frontend/src/app/agents/add/styles.module.css b/frontend/src/app/agents/add/styles.module.css index b110389..fd43530 100644 --- a/frontend/src/app/agents/add/styles.module.css +++ b/frontend/src/app/agents/add/styles.module.css @@ -1,24 +1,32 @@ -.createAgentContainer { +.formContainer { display: flex; flex-direction: column; - align-items: center; - gap: 48px; + align-items: flex-start; + gap: 10px; flex: 1 0 0; + padding-top: 48px; align-self: stretch; } +.createAgentContainer { + display: flex; + justify-content: center; + align-items: flex-start; + align-self: stretch; + /* Ibalhin ni ang padding sa formcontainer maoang nasa figma */ + gap: 16px; + flex: 1 1 auto; + height: calc(100vh - 100px - 48px - 110px); + overflow-y: auto; + scrollbar-width: none; +} + .inputMainContainer { display: flex; padding: 24px; flex-direction: column; align-items: flex-start; gap: 24px; - border-radius: 8px; - /* Remove ni kung mo ingon si sir grills */ - height: calc(100vh - 260px); - position: relative; - overflow: auto; - scrollbar-width: none; } .headerContainer { display: flex; @@ -35,9 +43,9 @@ flex: 1 0 0; } .headerTxt > p { - width: 163px; + /* width: 163px; */ + align-self: stretch; color: #d2d3e1; - color: color(display-p3 0.8235 0.8275 0.8784); font-family: Inter; font-size: 20px; font-style: normal; @@ -71,112 +79,11 @@ font-weight: 600; } -.checkboxMainContainer { +.lokiContainer { display: flex; + width: 548px; + padding: 24px; flex-direction: column; align-items: flex-start; - gap: 10px; - align-self: stretch; -} -.checkboxContainer { - display: flex; - align-items: flex-start; - align-self: stretch; -} -.checkbox { - display: flex; - padding: var(--Basic-Forms-Checkbox-Input-Sizing-Y-SM, 10px) - var(--Basic-Forms-Checkbox-Input-Sizing-X-SM, 12px); - align-items: flex-start; - gap: var(--Basic-Forms-Checkbox-Gap-Between, 16px); - flex: 1 0 0; - border-radius: var(--Basic-Forms-Checkbox-Border-Radius, 8px); - background: #1d1e2a; - background: color(display-p3 0.1137 0.1176 0.1608); -} -.check { - display: flex; - padding-top: var(--Basic-Forms-Checkbox-Inline-Y, 4px); - align-items: flex-start; - gap: var(--Basic-Forms-Checkbox-Inline-Gap-Between, 10px); -} -.hiddenCheckbox { - appearance: none; - -webkit-appearance: none; - -moz-appearance: none; - width: 16px; - height: 16px; - display: flex; - justify-content: center; - align-items: center; - border-radius: var(--Basic-Forms-Checkbox-Check-Icon-Border-Radius, 4px); - border: 1px solid - var(--Basic-Forms-Checkbox-Check-Icon-Border-Border-Active-Color, #0067fd); - border: 1px solid - var( - --Basic-Forms-Checkbox-Check-Icon-Border-Border-Active-Color, - color(display-p3 0.1451 0.3882 0.9216) - ); - cursor: pointer; - position: relative; -} -.hiddenCheckbox:checked { - border-radius: var(--Basic-Forms-Checkbox-Check-Icon-Border-Radius, 4px); - border: 1px solid - var(--Basic-Forms-Checkbox-Check-Icon-Border-Border-Active-Color, #0067fd); - border: 1px solid - var( - --Basic-Forms-Checkbox-Check-Icon-Border-Border-Active-Color, - color(display-p3 0.1451 0.3882 0.9216) - ); - background: var( - --Basic-Forms-Checkbox-Check-Icon-Background-Bg-Active-Color, - #0067fd - ); - background: var( - --Basic-Forms-Checkbox-Check-Icon-Background-Bg-Active-Color, - color(display-p3 0.1451 0.3882 0.9216) - ); -} -.hiddenCheckbox::after { - content: ""; - position: absolute; - inset: 0; - background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='8' viewBox='0 0 11 8' fill='none'%3E%3Cpath d='M9.83333 0.5L3.41667 6.91667L0.5 4' stroke='white' style='stroke:white;stroke-opacity:1;' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); - background-repeat: no-repeat; - background-position: center; - opacity: 0; -} -.hiddenCheckbox:checked::after { - opacity: 1; -} - -.list { - display: flex; - flex-direction: column; - align-items: flex-start; - gap: 4px; - flex: 1 0 0; -} -.placeholderTxt { - align-self: stretch; - color: #d2d3e1; - color: color(display-p3 0.8235 0.8275 0.8784); - font-family: Inter; - font-size: 16px; - font-style: normal; - font-weight: 500; - line-height: 24px; /* 150% */ - letter-spacing: 0.08px; -} -.secondaryTxt { - align-self: stretch; - color: #697281; - color: color(display-p3 0.4196 0.4471 0.502); - font-family: Inter; - font-size: 14px; - font-style: normal; - font-weight: 500; - line-height: 20px; /* 142.857% */ - letter-spacing: 0.07px; + gap: 24px; } diff --git a/frontend/src/app/components/customCheckbox/Checkbox.jsx b/frontend/src/app/components/customCheckbox/Checkbox.jsx new file mode 100644 index 0000000..a196786 --- /dev/null +++ b/frontend/src/app/components/customCheckbox/Checkbox.jsx @@ -0,0 +1,32 @@ +import React from "react"; +import styles from "./styles.module.css"; + +const Checkbox = ({ checked, onChange, label, description }) => { + return ( + <> + {/* Checkbox */} +
+
+
+ {/* Checkbox */} +
+ +
+ {/* List */} +
+

{label}

+

{description}

+
+
+
+
+ + ); +}; + +export default Checkbox; diff --git a/frontend/src/app/components/customCheckbox/styles.module.css b/frontend/src/app/components/customCheckbox/styles.module.css new file mode 100644 index 0000000..e400c14 --- /dev/null +++ b/frontend/src/app/components/customCheckbox/styles.module.css @@ -0,0 +1,105 @@ +.checkboxMainContainer { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 10px; + align-self: stretch; +} +.checkboxContainer { + display: flex; + align-items: flex-start; + align-self: stretch; +} +.checkbox { + display: flex; + padding: var(--Basic-Forms-Checkbox-Input-Sizing-Y-SM, 10px) + var(--Basic-Forms-Checkbox-Input-Sizing-X-SM, 12px); + align-items: flex-start; + gap: var(--Basic-Forms-Checkbox-Gap-Between, 16px); + flex: 1 0 0; + border-radius: var(--Basic-Forms-Checkbox-Border-Radius, 8px); + background: #1d1e2a; + background: color(display-p3 0.1137 0.1176 0.1608); +} +.check { + display: flex; + padding-top: var(--Basic-Forms-Checkbox-Inline-Y, 4px); + align-items: flex-start; + gap: var(--Basic-Forms-Checkbox-Inline-Gap-Between, 10px); +} +.hiddenCheckbox { + appearance: none; + -webkit-appearance: none; + -moz-appearance: none; + width: 16px; + height: 16px; + display: flex; + justify-content: center; + align-items: center; + cursor: pointer; + position: relative; + border-radius: var(--Basic-Forms-Checkbox-Check-Icon-Border-Radius, 4px); + border: 1px solid + var(--Basic-Forms-Checkbox-Check-Icon-Border-Border-Color, #e5e7eb); + + background: var(--Basic-Forms-Checkbox-Check-Icon-Background-Bg-Color, #fff); +} +.hiddenCheckbox:checked { + border-radius: var(--Basic-Forms-Checkbox-Check-Icon-Border-Radius, 4px); + border: 1px solid + var(--Basic-Forms-Checkbox-Check-Icon-Border-Border-Active-Color, #0067fd); + border: 1px solid + var( + --Basic-Forms-Checkbox-Check-Icon-Border-Border-Active-Color, + color(display-p3 0.1451 0.3882 0.9216) + ); + background: var( + --Basic-Forms-Checkbox-Check-Icon-Background-Bg-Active-Color, + #0067fd + ); + background: var( + --Basic-Forms-Checkbox-Check-Icon-Background-Bg-Active-Color, + color(display-p3 0.1451 0.3882 0.9216) + ); +} +.hiddenCheckbox::after { + content: ""; + position: absolute; + inset: 0; + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='8' viewBox='0 0 11 8' fill='none'%3E%3Cpath d='M9.83333 0.5L3.41667 6.91667L0.5 4' stroke='white' style='stroke:white;stroke-opacity:1;' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); + background-repeat: no-repeat; + background-position: center; + opacity: 0; +} +.hiddenCheckbox:checked::after { + opacity: 1; +} + +.list { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 4px; + flex: 1 0 0; +} +.placeholderTxt { + align-self: stretch; + color: #d2d3e1; + color: color(display-p3 0.8235 0.8275 0.8784); + font-family: Inter; + font-size: 16px; + font-style: normal; + font-weight: 500; + line-height: 24px; /* 150% */ + letter-spacing: 0.08px; +} +.secondaryTxt { + align-self: stretch; + color: #697281; + font-family: Inter; + font-size: 14px; + font-style: normal; + font-weight: 500; + line-height: 20px; /* 142.857% */ + letter-spacing: 0.07px; +} diff --git a/frontend/src/app/components/navbar/navright/Profile.jsx b/frontend/src/app/components/navbar/navright/Profile.jsx index c88ffe7..b5b9181 100644 --- a/frontend/src/app/components/navbar/navright/Profile.jsx +++ b/frontend/src/app/components/navbar/navright/Profile.jsx @@ -6,7 +6,6 @@ import useIsMobile from "@/app/hooks/useIsMobile"; const Profile = () => { const isMobile = useIsMobile(); const [open, setOpen] = useState(false); - const [user, setUser] = useState(""); const sampleData = [ { name: "JM Grills", diff --git a/frontend/src/app/roles/[rolesId]/styles.module.css b/frontend/src/app/roles/[rolesId]/styles.module.css index 45b92d1..7b9424a 100644 --- a/frontend/src/app/roles/[rolesId]/styles.module.css +++ b/frontend/src/app/roles/[rolesId]/styles.module.css @@ -22,7 +22,6 @@ align-items: flex-start; border-radius: 6px; background: #1d1e2a; - background: color(display-p3 0.1137 0.1176 0.1608); } .header { display: flex; diff --git a/frontend/src/app/roles/role-card/Card.jsx b/frontend/src/app/roles/role-card/Card.jsx new file mode 100644 index 0000000..49cd0be --- /dev/null +++ b/frontend/src/app/roles/role-card/Card.jsx @@ -0,0 +1,28 @@ +import DeleteIcon from "@/app/components/icons/delete"; +import React from "react"; + +const Card = (props) => { + return ( +
+
+
+

Name

+

{props?.user?.email}

+
+
+

Organization ID

+

{props?.user?.fullName}

+
+
+

Permissions

+

{props?.user?.createdAt}

+
+
+
+ +
+
+ ); +}; + +export default Card; diff --git a/frontend/src/app/roles/role-card/styles.module.css b/frontend/src/app/roles/role-card/styles.module.css new file mode 100644 index 0000000..5f16b70 --- /dev/null +++ b/frontend/src/app/roles/role-card/styles.module.css @@ -0,0 +1,43 @@ +.cardContainer { + display: flex; + padding: 16px 0; + align-items: flex-start; + gap: 16px; + align-self: stretch; + border-bottom: 1px solid #2c2d3d; + cursor: pointer; +} +.cardDetails { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 8px; + flex: 1 0 0; +} +.list { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 5px; + align-self: stretch; +} +.list p { + color: #85869b; + font-family: Inter; + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: normal; +} + +.list p:nth-child(2) { + color: #eeeffd; + font-family: Inter; + font-size: 16px; + font-weight: 500; +} +.cardAction { + display: flex; + align-items: center; + gap: 17px; +} diff --git a/frontend/src/app/roles/styles.module.css b/frontend/src/app/roles/styles.module.css index 57d40e9..1026fe7 100644 --- a/frontend/src/app/roles/styles.module.css +++ b/frontend/src/app/roles/styles.module.css @@ -22,7 +22,6 @@ padding: 12px 24px; text-align: left; color: #85869b; - color: color(display-p3 0.5216 0.5255 0.6); font-family: Inter; font-size: 13px; font-style: normal; @@ -41,7 +40,6 @@ .tableBody td { padding: 12px 24px; color: #eeeffd; - color: color(display-p3 0.9333 0.9373 0.9882); font-family: Inter; font-size: 13px; font-style: normal; @@ -55,9 +53,7 @@ } .tableBody tr:hover { 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: color(display-p3 0.5098 0.5294 1 / 0.05); } .tableActions { @@ -68,3 +64,16 @@ gap: 12px; align-self: stretch; } + +/* Mobile */ +.cardContainer { + display: flex; + padding: 0 16px; + padding-bottom: 50px; + height: calc(100vh - 170px); + flex-direction: column; + align-items: flex-start; + gap: 12px; + align-self: stretch; + overflow: auto; +} diff --git a/frontend/src/app/users/page.jsx b/frontend/src/app/users/page.jsx index 7df43a7..de337e0 100644 --- a/frontend/src/app/users/page.jsx +++ b/frontend/src/app/users/page.jsx @@ -8,25 +8,25 @@ import ViewIcon from "../components/icons/view"; import DeleteIcon from "../components/icons/delete"; import SuccessToast from "../components/toast/success/successToast"; import ActionButton from "../components/actionButton/ActionButton"; +import useIsMobile from "../hooks/useIsMobile"; +import MobileSearchBar from "../components/mobileSearchBar/MobileSearchBar"; +import Card from "./user-card/Card"; const UsersPage = () => { const router = useRouter(); - + const isMobile = useIsMobile(); const sampleData = [ { - id: 1, email: "nino.moonshot@gmail.com", fullName: "Nino Paul Cervantes", createdAt: "2024-10-21 08:01:31.474 +0000 UTC", }, { - id: 2, email: "nino.moonshot@gmail.com", fullName: "Nino Paul Cervantes", createdAt: "2024-10-21 08:01:31.474 +0000 UTC", }, { - id: 3, email: "nino.moonshot@gmail.com", fullName: "Nino Paul Cervantes", createdAt: "2024-10-21 08:01:31.474 +0000 UTC", @@ -42,6 +42,20 @@ const UsersPage = () => { topbarTitle="Users" requiredButtons={["title", "add", "search"]} /> + +
+ + {sampleData.map((user, index) => { + return ( + router.push(`/users/${index}`)} + /> + ); + })} +
+
@@ -56,8 +70,8 @@ const UsersPage = () => { {sampleData.map((user, index) => { return ( router.push(`/users/${user.id}`)} + key={index} + onClick={() => router.push(`/users/${index}`)} > diff --git a/frontend/src/app/users/styles.module.css b/frontend/src/app/users/styles.module.css index bb57e8a..464fe49 100644 --- a/frontend/src/app/users/styles.module.css +++ b/frontend/src/app/users/styles.module.css @@ -4,7 +4,6 @@ position: relative; overflow: auto; } - /* Table */ .table { width: 100%; @@ -22,9 +21,9 @@ padding: 12px 24px; text-align: left; color: #85869b; - color: color(display-p3 0.5216 0.5255 0.6); font-family: Inter; - font-size: 13px; + + font-size: var(--table-font-size); font-style: normal; flex: 1 0 0; font-weight: 500; @@ -40,9 +39,8 @@ .tableBody td { padding: 12px 24px; color: #eeeffd; - color: color(display-p3 0.9333 0.9373 0.9882); font-family: Inter; - font-size: 13px; + font-size: var(--table-font-size); font-style: normal; font-weight: 500; line-height: normal; @@ -54,9 +52,7 @@ } .tableBody tr:hover { 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: color(display-p3 0.5098 0.5294 1 / 0.05); } .tableActions { @@ -67,3 +63,24 @@ gap: 12px; align-self: stretch; } +.cardContainer { + display: none; +} + +@media (max-width: 768px) { + .cardContainer { + display: flex; + padding: 0 16px; + padding-bottom: 50px; + height: calc(100vh - 170px); + flex-direction: column; + align-items: flex-start; + gap: 12px; + align-self: stretch; + overflow: auto; + background-color: red; + } + .tableContainer { + display: none; + } +} diff --git a/frontend/src/app/users/user-card/Card.jsx b/frontend/src/app/users/user-card/Card.jsx new file mode 100644 index 0000000..f680019 --- /dev/null +++ b/frontend/src/app/users/user-card/Card.jsx @@ -0,0 +1,29 @@ +import DeleteIcon from "@/app/components/icons/delete"; +import React from "react"; +import styles from "./styles.module.css"; + +const Card = (props) => { + return ( +
+
+
+

Email

+

{props?.user?.email}

+
+
+

Full Name

+

{props?.user?.fullName}

+
+
+

Date Created

+

{props?.user?.createdAt}

+
+
+
+ +
+
+ ); +}; + +export default Card; diff --git a/frontend/src/app/users/user-card/styles.module.css b/frontend/src/app/users/user-card/styles.module.css new file mode 100644 index 0000000..c8b254f --- /dev/null +++ b/frontend/src/app/users/user-card/styles.module.css @@ -0,0 +1,44 @@ +.cardContainer { + display: flex; + padding: 16px 0; + align-items: flex-start; + gap: 16px; + align-self: stretch; + border-bottom: 1px solid #2c2d3d; + cursor: pointer; + background-color: green; +} +.cardDetails { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 8px; + flex: 1 0 0; +} +.list { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 5px; + align-self: stretch; +} +.list p { + color: #85869b; + font-family: Inter; + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: normal; +} + +.list p:nth-child(2) { + color: #eeeffd; + font-family: Inter; + font-size: 16px; + font-weight: 500; +} +.cardAction { + display: flex; + align-items: center; + gap: 17px; +}
{user.email} {user.fullName}