mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-11-06 01:36:59 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dc10fa6be4 | |||
| 39e84723b1 | |||
| 19043aa692 | |||
| f2a17d522b | |||
| 43b8e22196 |
@@ -1,5 +1,12 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## <small>0.2.2 (2025-09-20)</small>
|
||||||
|
|
||||||
|
* refactor: remove table captions from all tables 🔧 ([39e8472](https://github.com/i701/sarlink-portal/commit/39e8472))
|
||||||
|
* fix: hide account information once the payment is verified/expired/cancelled 🔧 ([f2a17d5](https://github.com/i701/sarlink-portal/commit/f2a17d5))
|
||||||
|
* fix: remove pagination if there is only 1 page 🔧 ([43b8e22](https://github.com/i701/sarlink-portal/commit/43b8e22))
|
||||||
|
* fix: set 100 MVR for default wallet topup amount 🔧 ([19043aa](https://github.com/i701/sarlink-portal/commit/19043aa))
|
||||||
|
|
||||||
## <small>0.2.1 (2025-09-20)</small>
|
## <small>0.2.1 (2025-09-20)</small>
|
||||||
|
|
||||||
* fix: add release script 🔧 ([e5298aa](https://github.com/i701/sarlink-portal/commit/e5298aa))
|
* fix: add release script 🔧 ([e5298aa](https://github.com/i701/sarlink-portal/commit/e5298aa))
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { Skeleton } from "@/components/ui/skeleton";
|
|||||||
import {
|
import {
|
||||||
Table,
|
Table,
|
||||||
TableBody,
|
TableBody,
|
||||||
TableCaption,
|
|
||||||
TableCell,
|
TableCell,
|
||||||
TableFooter,
|
TableFooter,
|
||||||
TableHead,
|
TableHead,
|
||||||
@@ -16,7 +15,6 @@ export default function DevicesTableSkeleton() {
|
|||||||
<>
|
<>
|
||||||
<div className="hidden sm:block">
|
<div className="hidden sm:block">
|
||||||
<Table className="overflow-scroll">
|
<Table className="overflow-scroll">
|
||||||
<TableCaption>Table of all devices.</TableCaption>
|
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableHead>Device Name</TableHead>
|
<TableHead>Device Name</TableHead>
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import { authOptions } from "@/app/auth";
|
|||||||
import {
|
import {
|
||||||
Table,
|
Table,
|
||||||
TableBody,
|
TableBody,
|
||||||
TableCaption,
|
|
||||||
TableCell,
|
TableCell,
|
||||||
TableFooter,
|
TableFooter,
|
||||||
TableHead,
|
TableHead,
|
||||||
@@ -64,7 +63,6 @@ export async function AdminDevicesTable({
|
|||||||
<>
|
<>
|
||||||
<div>
|
<div>
|
||||||
<Table className="overflow-scroll">
|
<Table className="overflow-scroll">
|
||||||
<TableCaption>Table of all devices.</TableCaption>
|
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableHead>Device Name</TableHead>
|
<TableHead>Device Name</TableHead>
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { getTopups } from "@/actions/payment";
|
|||||||
import {
|
import {
|
||||||
Table,
|
Table,
|
||||||
TableBody,
|
TableBody,
|
||||||
TableCaption,
|
|
||||||
TableCell,
|
TableCell,
|
||||||
TableFooter,
|
TableFooter,
|
||||||
TableHead,
|
TableHead,
|
||||||
@@ -56,7 +55,6 @@ export async function AdminTopupsTable({
|
|||||||
<>
|
<>
|
||||||
<div>
|
<div>
|
||||||
<Table className="overflow-scroll">
|
<Table className="overflow-scroll">
|
||||||
<TableCaption>Table of all topups.</TableCaption>
|
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableHead>User</TableHead>
|
<TableHead>User</TableHead>
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import { Button } from "@/components/ui/button";
|
|||||||
import {
|
import {
|
||||||
Table,
|
Table,
|
||||||
TableBody,
|
TableBody,
|
||||||
TableCaption,
|
|
||||||
TableCell,
|
TableCell,
|
||||||
TableFooter,
|
TableFooter,
|
||||||
TableHead,
|
TableHead,
|
||||||
@@ -60,7 +59,6 @@ export async function UsersPaymentsTable({
|
|||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<Table className="overflow-scroll">
|
<Table className="overflow-scroll">
|
||||||
<TableCaption>Table of all users.</TableCaption>
|
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableHead>Devices paid</TableHead>
|
<TableHead>Devices paid</TableHead>
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { authOptions } from "@/app/auth";
|
|||||||
import {
|
import {
|
||||||
Table,
|
Table,
|
||||||
TableBody,
|
TableBody,
|
||||||
TableCaption,
|
|
||||||
TableCell,
|
TableCell,
|
||||||
TableFooter,
|
TableFooter,
|
||||||
TableHead,
|
TableHead,
|
||||||
@@ -71,7 +70,6 @@ export async function DevicesTable({
|
|||||||
<>
|
<>
|
||||||
<div className="hidden sm:block">
|
<div className="hidden sm:block">
|
||||||
<Table className="overflow-scroll">
|
<Table className="overflow-scroll">
|
||||||
<TableCaption>Table of all devices.</TableCaption>
|
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableHead>Device Name</TableHead>
|
<TableHead>Device Name</TableHead>
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { cn } from "@/lib/utils";
|
|
||||||
import { Minus, Plus } from "lucide-react";
|
import { Minus, Plus } from "lucide-react";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import {
|
import {
|
||||||
@@ -8,18 +7,19 @@ import {
|
|||||||
Label,
|
Label,
|
||||||
NumberField,
|
NumberField,
|
||||||
} from "react-aria-components";
|
} from "react-aria-components";
|
||||||
|
import { cn } from "@/lib/utils";
|
||||||
|
|
||||||
export default function NumberInput({
|
export default function NumberInput({
|
||||||
maxAllowed,
|
maxAllowed,
|
||||||
label,
|
label,
|
||||||
value,
|
value = 100,
|
||||||
onChange,
|
onChange,
|
||||||
className,
|
className,
|
||||||
isDisabled,
|
isDisabled,
|
||||||
}: {
|
}: {
|
||||||
maxAllowed?: number;
|
maxAllowed?: number;
|
||||||
label: string;
|
label: string;
|
||||||
value: number;
|
value?: number;
|
||||||
onChange: (value: number) => void;
|
onChange: (value: number) => void;
|
||||||
className?: string;
|
className?: string;
|
||||||
isDisabled?: boolean;
|
isDisabled?: boolean;
|
||||||
@@ -31,6 +31,7 @@ export default function NumberInput({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [maxAllowed, value, onChange]);
|
}, [maxAllowed, value, onChange]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NumberField
|
<NumberField
|
||||||
isDisabled={isDisabled}
|
isDisabled={isDisabled}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import { Button } from "@/components/ui/button";
|
|
||||||
import { ArrowLeftIcon, ArrowRightIcon } from "lucide-react";
|
import { ArrowLeftIcon, ArrowRightIcon } from "lucide-react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter, useSearchParams } from "next/navigation";
|
import { useRouter, useSearchParams } from "next/navigation";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
|
import { Button } from "@/components/ui/button";
|
||||||
|
|
||||||
type PaginationProps = {
|
type PaginationProps = {
|
||||||
totalPages: number;
|
totalPages: number;
|
||||||
@@ -71,6 +71,10 @@ export default function Pagination({
|
|||||||
|
|
||||||
const pageNumbers = generatePageNumbers();
|
const pageNumbers = generatePageNumbers();
|
||||||
|
|
||||||
|
if (totalPages <= 1) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center justify-center space-x-2 my-4">
|
<div className="flex items-center justify-center space-x-2 my-4">
|
||||||
{currentPage > 1 && (
|
{currentPage > 1 && (
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { getPayments } from "@/actions/payment";
|
|||||||
import {
|
import {
|
||||||
Table,
|
Table,
|
||||||
TableBody,
|
TableBody,
|
||||||
TableCaption,
|
|
||||||
TableCell,
|
TableCell,
|
||||||
TableFooter,
|
TableFooter,
|
||||||
TableHead,
|
TableHead,
|
||||||
@@ -59,7 +58,6 @@ export async function PaymentsTable({
|
|||||||
<>
|
<>
|
||||||
<div className="hidden sm:block">
|
<div className="hidden sm:block">
|
||||||
<Table className="overflow-scroll">
|
<Table className="overflow-scroll">
|
||||||
<TableCaption>Table of all devices.</TableCaption>
|
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableHead>Details</TableHead>
|
<TableHead>Details</TableHead>
|
||||||
|
|||||||
@@ -61,6 +61,9 @@ export default function TopupToPay({
|
|||||||
<div className="m-2 flex items-end justify-end p-2 text-sm text-foreground border rounded">
|
<div className="m-2 flex items-end justify-end p-2 text-sm text-foreground border rounded">
|
||||||
<Table>
|
<Table>
|
||||||
<TableCaption>
|
<TableCaption>
|
||||||
|
{!topup?.paid ||
|
||||||
|
topup?.is_expired ||
|
||||||
|
(topup?.status !== "CANCELLED" && (
|
||||||
<div className="max-w-sm mx-auto">
|
<div className="max-w-sm mx-auto">
|
||||||
<p>Please send the following amount to the payment address</p>
|
<p>Please send the following amount to the payment address</p>
|
||||||
<AccountInfomation
|
<AccountInfomation
|
||||||
@@ -101,6 +104,7 @@ export default function TopupToPay({
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
))}
|
||||||
</TableCaption>
|
</TableCaption>
|
||||||
<TableBody className="">
|
<TableBody className="">
|
||||||
<TableRow>
|
<TableRow>
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { getTopups } from "@/actions/payment";
|
|||||||
import {
|
import {
|
||||||
Table,
|
Table,
|
||||||
TableBody,
|
TableBody,
|
||||||
TableCaption,
|
|
||||||
TableCell,
|
TableCell,
|
||||||
TableFooter,
|
TableFooter,
|
||||||
TableHead,
|
TableHead,
|
||||||
@@ -59,7 +58,6 @@ export async function TopupsTable({
|
|||||||
<>
|
<>
|
||||||
<div className="hidden sm:block">
|
<div className="hidden sm:block">
|
||||||
<Table className="overflow-scroll">
|
<Table className="overflow-scroll">
|
||||||
<TableCaption>Table of all topups.</TableCaption>
|
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableHead>Details</TableHead>
|
<TableHead>Details</TableHead>
|
||||||
|
|||||||
@@ -1,18 +1,3 @@
|
|||||||
// import {
|
|
||||||
// Table,
|
|
||||||
// TableBody,
|
|
||||||
// TableCaption,
|
|
||||||
// TableCell,
|
|
||||||
// TableFooter,
|
|
||||||
// TableHead,
|
|
||||||
// TableHeader,
|
|
||||||
// TableRow,
|
|
||||||
// } from "@/components/ui/table";
|
|
||||||
// import Link from "next/link";
|
|
||||||
// import Pagination from "./pagination";
|
|
||||||
// import { Badge } from "./ui/badge";
|
|
||||||
// import { Button } from "./ui/button";
|
|
||||||
|
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { redirect } from "next/navigation";
|
import { redirect } from "next/navigation";
|
||||||
import { getUsers } from "@/queries/users";
|
import { getUsers } from "@/queries/users";
|
||||||
@@ -24,7 +9,6 @@ import { Button } from "./ui/button";
|
|||||||
import {
|
import {
|
||||||
Table,
|
Table,
|
||||||
TableBody,
|
TableBody,
|
||||||
TableCaption,
|
|
||||||
TableCell,
|
TableCell,
|
||||||
TableFooter,
|
TableFooter,
|
||||||
TableHead,
|
TableHead,
|
||||||
@@ -72,7 +56,6 @@ export async function UsersTable({
|
|||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<Table className="overflow-scroll">
|
<Table className="overflow-scroll">
|
||||||
<TableCaption>Table of all users.</TableCaption>
|
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableHead>Name</TableHead>
|
<TableHead>Name</TableHead>
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { redirect } from "next/navigation";
|
|||||||
import {
|
import {
|
||||||
Table,
|
Table,
|
||||||
TableBody,
|
TableBody,
|
||||||
TableCaption,
|
|
||||||
TableCell,
|
TableCell,
|
||||||
TableFooter,
|
TableFooter,
|
||||||
TableHead,
|
TableHead,
|
||||||
@@ -79,7 +78,6 @@ export async function WalletTransactionsTable({
|
|||||||
</div>
|
</div>
|
||||||
<div className="hidden sm:block">
|
<div className="hidden sm:block">
|
||||||
<Table className="overflow-scroll">
|
<Table className="overflow-scroll">
|
||||||
<TableCaption>Table of all transactions.</TableCaption>
|
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableHead>Description</TableHead>
|
<TableHead>Description</TableHead>
|
||||||
|
|||||||
@@ -39,8 +39,7 @@ export function Wallet({ walletBalance }: { walletBalance: number }) {
|
|||||||
<Drawer open={isOpen} onOpenChange={setIsOpen}>
|
<Drawer open={isOpen} onOpenChange={setIsOpen}>
|
||||||
<DrawerTrigger asChild>
|
<DrawerTrigger asChild>
|
||||||
<Button onClick={() => setIsOpen(!isOpen)} variant="outline">
|
<Button onClick={() => setIsOpen(!isOpen)} variant="outline">
|
||||||
{walletBalance}{" "}
|
{walletBalance} MVR
|
||||||
MVR
|
|
||||||
<Wallet2 />
|
<Wallet2 />
|
||||||
</Button>
|
</Button>
|
||||||
</DrawerTrigger>
|
</DrawerTrigger>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export const discountPercentageAtom = atom(75);
|
|||||||
export const numberOfDevicesAtom = atom(1);
|
export const numberOfDevicesAtom = atom(1);
|
||||||
export const numberOfDaysAtom = atom(30);
|
export const numberOfDaysAtom = atom(30);
|
||||||
export const numberOfMonths = atom(1);
|
export const numberOfMonths = atom(1);
|
||||||
export const walletTopUpValue = atom(1);
|
export const walletTopUpValue = atom(100);
|
||||||
export const formulaResultAtom = atom("");
|
export const formulaResultAtom = atom("");
|
||||||
export const deviceCartAtom = atom<Device[]>([]);
|
export const deviceCartAtom = atom<Device[]>([]);
|
||||||
export const cartDrawerOpenAtom = atom(false);
|
export const cartDrawerOpenAtom = atom(false);
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "sarlink-portal",
|
"name": "sarlink-portal",
|
||||||
"version": "0.2.1",
|
"version": "0.2.2",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "sarlink-portal",
|
"name": "sarlink-portal",
|
||||||
"version": "0.2.1",
|
"version": "0.2.2",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@commitlint/cli": "^19.8.1",
|
"@commitlint/cli": "^19.8.1",
|
||||||
"@commitlint/config-conventional": "^19.8.1",
|
"@commitlint/config-conventional": "^19.8.1",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sarlink-portal",
|
"name": "sarlink-portal",
|
||||||
"version": "0.2.1",
|
"version": "0.2.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user