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