5 Commits
0.2.1 ... 0.2.2

Author SHA1 Message Date
dc10fa6be4 chore: release v0.2.2
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 1m26s
2025-09-20 14:41:32 +05:00
39e84723b1 refactor: remove table captions from all tables 🔧 2025-09-20 14:40:55 +05:00
19043aa692 fix: set 100 MVR for default wallet topup amount 🔧 2025-09-20 14:25:48 +05:00
f2a17d522b fix: hide account information once the payment is verified/expired/cancelled 🔧 2025-09-20 14:17:48 +05:00
43b8e22196 fix: remove pagination if there is only 1 page 🔧 2025-09-20 14:09:12 +05:00
18 changed files with 1828 additions and 1846 deletions

View File

@@ -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))

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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}

View File

@@ -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 && (

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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
View File

@@ -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",

View File

@@ -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": {