diff --git a/.github/assets/slrn_groups-dark.gif b/.github/assets/slrn_groups-dark.gif new file mode 100644 index 0000000..78cdebd Binary files /dev/null and b/.github/assets/slrn_groups-dark.gif differ diff --git a/.github/assets/slrn_groups-light.gif b/.github/assets/slrn_groups-light.gif new file mode 100644 index 0000000..f28105d Binary files /dev/null and b/.github/assets/slrn_groups-light.gif differ diff --git a/README.md b/README.md index 4c947bf..82b6dc6 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,41 @@ # slrn_groups +![Lint](https://github.com/solareon/slrn_groups/actions/workflows/lint.yml/badge.svg) +![CI](https://github.com/solareon/slrn_groups/actions/workflows/ci.yml/badge.svg) + A group app for [lb-phone](https://lbphone.com/) the provides `qb-phone` compatible exports. This should work with most resources that expect a `qb-phone` style group. **QBOX/QB/ESX/ND/OX supported with bridge** -![CI](https://github.com/solareon/slrn_groups/actions/workflows/ci.yml/badge.svg) -![Lint](https://github.com/solareon/slrn_groups/actions/workflows/lint.yml/badge.svg) +# Preview + +Light Mode | Dark Mode +:-------------------------:|:-------------------------: +![Light mode preview image](.github/assets/slrn_groups-light.gif) | ![Dark mode preview image](.github/assets/slrn_groups-dark.gif) -## Installation + +# Installation Download the [release version](https://github.com/solareon/slrn_groups/releases) and copy to your server. +# Customizing and building from source +Download the latest commit and navigate to the ui folder +```bash copy +pnpm i +``` +Then to preview the UI. You can also switch the UI path in the app registration (switch the commented lines) and then the game will display the preview running from vite. +```bash copy +pnpm start +``` +Or to build for production +```bash copy +pnpm build +``` + # Support - [Discord](https://discord.gg/TZFBBHvG6E) # Credits - [FjamZoo](https://github.com/FjamZoo) for rewriting groups layer +- [MaxReinold](https://github.com/MaxReinold) for making a slick UI - [RijayJH](https://github.com/RijayJH/rj_groups-for-lb_phone) for original idea - [overextended](https://github.com/overextended) for ox_lib diff --git a/ui/src/App.tsx b/ui/src/App.tsx index a8c11f1..7de0b80 100644 --- a/ui/src/App.tsx +++ b/ui/src/App.tsx @@ -92,7 +92,7 @@ const App = () => { return (
@@ -102,7 +102,7 @@ const App = () => { )}
 
-
Groups
+
Groups
{currentPage === "GroupDashboard" && ( { return (
-

+

{confirmation.message}

-
+
{disabledReason ? disabledReason : String.fromCharCode(160)}
diff --git a/ui/src/components/GroupDashboard.tsx b/ui/src/components/GroupDashboard.tsx index 4296f14..e44a000 100644 --- a/ui/src/components/GroupDashboard.tsx +++ b/ui/src/components/GroupDashboard.tsx @@ -54,25 +54,17 @@ const GroupDashboard = ({ setCurrentPage, fetchNui }) => { setShowPlayerList(true)} /> {isLeader && ( deleteGroup(group)} /> )} - {isMember && !isLeader && ( - leaveGroup(group)} - size="xl" - /> - )}
); @@ -82,34 +74,31 @@ const GroupDashboard = ({ setCurrentPage, fetchNui }) => {
- - - + ):''}

{currentGroups?.length > 0 ? ( - 'Create a group or join an existing group below' + inGroup?'You are already in a group.':'Create a group or join an existing group below' ) : ( 'Create a group to get started' )} @@ -120,10 +109,9 @@ const GroupDashboard = ({ setCurrentPage, fetchNui }) => { let isMember = group.id === inGroup; return ( - //
{ @@ -132,21 +120,19 @@ const GroupDashboard = ({ setCurrentPage, fetchNui }) => { } }} > -
- - {group.name} +
+ + {group.memberCount} + + + {group.name}
<> {isMember && renderIcons(isLeader, isMember, group)} - - - {group.memberCount} -
- //
); })} diff --git a/ui/src/components/GroupJob.tsx b/ui/src/components/GroupJob.tsx index 4df1d1b..f32212b 100644 --- a/ui/src/components/GroupJob.tsx +++ b/ui/src/components/GroupJob.tsx @@ -44,23 +44,23 @@ const GroupJob: React.FC = ({ setCurrentPage, fetchNui }) => { return (
-
+
- + {groupJobSteps && groupJobSteps.length > 0 ? "Here are the current group tasks" : "No tasks available"} @@ -81,10 +81,7 @@ const GroupJob: React.FC = ({ setCurrentPage, fetchNui }) => { />
- {/*
- {step.isDone ? "1 / 1" : "0 / 1"} -
*/} -
{step.name}
+
{step.name}
))} diff --git a/ui/src/components/JoinGroup.tsx b/ui/src/components/JoinGroup.tsx index b56e4a0..847aaeb 100644 --- a/ui/src/components/JoinGroup.tsx +++ b/ui/src/components/JoinGroup.tsx @@ -2,12 +2,7 @@ import React, { useState, useEffect } from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faXmark } from "@fortawesome/free-solid-svg-icons"; -const JoinGroup: React.FC = ({ - groupId, - groupName, - onSelect, - onClose, -}) => { +const JoinGroup: React.FC = ({ groupId, groupName, onSelect, onClose }) => { const [password, setPassword] = useState(""); const [disabledReason, setDisabledReason] = useState(""); const [isSubmitDisabled, setIsSubmitDisabled] = useState(true); @@ -29,28 +24,14 @@ const JoinGroup: React.FC = ({ return (
-
+
-

- Join Group -

+

Join {groupName}

-
+
- -
-
-
-
+
{disabledReason ? disabledReason : String.fromCharCode(160)}
diff --git a/ui/src/components/PlayerList.tsx b/ui/src/components/PlayerList.tsx index 2dc92be..d007d0e 100644 --- a/ui/src/components/PlayerList.tsx +++ b/ui/src/components/PlayerList.tsx @@ -30,38 +30,27 @@ const PlayerList: React.FC = ({ onClose, fetchNui }) => { return (
- - <> - {isLeader && - member.playerId !== - playerData.source && ( - <> - - removeGroupMember( - member - ) - } - /> - - )} - - {member.name} + + {member.name}{(isLeader && member.playerId !== playerData.source) && ( + removeGroupMember(member)} + /> + )}
); })}
diff --git a/ui/tailwind.config.js b/ui/tailwind.config.js index 021a6d8..fc63ff3 100644 --- a/ui/tailwind.config.js +++ b/ui/tailwind.config.js @@ -17,17 +17,17 @@ module.exports = { createThemes({ light: { text: '#030704', - background: '#fcfdfd', - primary: '#57b277', + background: '#e6ebed', + primary: '#fff', secondary: '#a7b7d7', accent: '#8981c5', danger: '#ff0000', success: '#8981c5', }, dark: { - text: '#f8fcf9', - background: '#020303', - primary: '#4da86d', + text: '#e5e7eb', + background: '#0d1016', + primary: '#191c21', secondary: '#283858', accent: '#423a7e', danger: '#ff0000',