Cloud settings -> billing (#3469)

This commit is contained in:
pablonyx 2024-12-14 18:10:50 -08:00 committed by GitHub
parent 8a422683e3
commit d388643a04
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 15 additions and 18 deletions

0
billing Normal file
View File

View File

@ -85,8 +85,8 @@ export default function BillingInformationPage() {
{popup} {popup}
<h2 className="text-2xl font-bold mb-6 text-gray-800 flex items-center"> <h2 className="text-2xl font-bold mb-6 text-gray-800 flex items-center">
<CreditCard className="mr-4 text-gray-600" size={24} /> {/* <CreditCard className="mr-4 text-gray-600" size={24} /> */}
Billing Information Subscription Details
</h2> </h2>
<div className="space-y-4"> <div className="space-y-4">

View File

@ -1,6 +1,6 @@
import { AdminPageTitle } from "@/components/admin/Title"; import { AdminPageTitle } from "@/components/admin/Title";
import BillingInformationPage from "./BillingInformationPage"; import BillingInformationPage from "./BillingInformationPage";
import { FaCloud } from "react-icons/fa"; import { MdOutlineCreditCard } from "react-icons/md";
export interface BillingInformation { export interface BillingInformation {
seats: number; seats: number;
@ -14,8 +14,8 @@ export default function page() {
return ( return (
<div className="container max-w-4xl"> <div className="container max-w-4xl">
<AdminPageTitle <AdminPageTitle
title="Cloud Settings" title="Billing Information"
icon={<FaCloud size={32} className="my-auto" />} icon={<MdOutlineCreditCard size={32} className="my-auto" />}
/> />
<BillingInformationPage /> <BillingInformationPage />
</div> </div>

View File

@ -30,7 +30,7 @@ import { User } from "@/lib/types";
import { usePathname } from "next/navigation"; import { usePathname } from "next/navigation";
import { SettingsContext } from "../settings/SettingsProvider"; import { SettingsContext } from "../settings/SettingsProvider";
import { useContext } from "react"; import { useContext } from "react";
import { Cloud } from "@phosphor-icons/react"; import { MdOutlineCreditCard } from "react-icons/md";
export function ClientLayout({ export function ClientLayout({
user, user,
@ -386,14 +386,14 @@ export function ClientLayout({
{ {
name: ( name: (
<div className="flex"> <div className="flex">
<Cloud <MdOutlineCreditCard
className="text-icon-settings-sidebar" className="text-icon-settings-sidebar"
size={18} size={18}
/> />
<div className="ml-1">Cloud Settings</div> <div className="ml-1">Billing</div>
</div> </div>
), ),
link: "/admin/cloud-settings", link: "/admin/billing",
}, },
] ]
: []), : []),

View File

@ -7,7 +7,7 @@ import {
import { redirect } from "next/navigation"; import { redirect } from "next/navigation";
import { ClientLayout } from "./ClientLayout"; import { ClientLayout } from "./ClientLayout";
import { import {
SERVER_SIDE_ONLY__CLOUD_ENABLED, NEXT_PUBLIC_CLOUD_ENABLED,
SERVER_SIDE_ONLY__PAID_ENTERPRISE_FEATURES_ENABLED, SERVER_SIDE_ONLY__PAID_ENTERPRISE_FEATURES_ENABLED,
} from "@/lib/constants"; } from "@/lib/constants";
import { AnnouncementBanner } from "../header/AnnouncementBanner"; import { AnnouncementBanner } from "../header/AnnouncementBanner";
@ -45,7 +45,7 @@ export async function Layout({ children }: { children: React.ReactNode }) {
return ( return (
<ClientLayout <ClientLayout
enableEnterprise={SERVER_SIDE_ONLY__PAID_ENTERPRISE_FEATURES_ENABLED} enableEnterprise={SERVER_SIDE_ONLY__PAID_ENTERPRISE_FEATURES_ENABLED}
enableCloud={SERVER_SIDE_ONLY__CLOUD_ENABLED} enableCloud={NEXT_PUBLIC_CLOUD_ENABLED}
user={user} user={user}
> >
<AnnouncementBanner /> <AnnouncementBanner />

View File

@ -82,7 +82,7 @@ export function AnnouncementBanner() {
Your trial is ending soon - submit your billing information to Your trial is ending soon - submit your billing information to
continue using Onyx.{" "} continue using Onyx.{" "}
<Link <Link
href="/admin/cloud-settings" href="/admin/billing"
className="ml-2 underline cursor-pointer" className="ml-2 underline cursor-pointer"
> >
Update here Update here

View File

@ -74,7 +74,4 @@ export const NEXT_PUBLIC_CLOUD_ENABLED =
export const REGISTRATION_URL = export const REGISTRATION_URL =
process.env.INTERNAL_URL || "http://127.0.0.1:3001"; process.env.INTERNAL_URL || "http://127.0.0.1:3001";
export const SERVER_SIDE_ONLY__CLOUD_ENABLED =
process.env.NEXT_PUBLIC_CLOUD_ENABLED?.toLowerCase() === "true";
export const TEST_ENV = process.env.TEST_ENV?.toLowerCase() === "true"; export const TEST_ENV = process.env.TEST_ENV?.toLowerCase() === "true";

View File

@ -2,7 +2,7 @@ import { cookies } from "next/headers";
import { User } from "./types"; import { User } from "./types";
import { buildUrl } from "./utilsSS"; import { buildUrl } from "./utilsSS";
import { ReadonlyRequestCookies } from "next/dist/server/web/spec-extension/adapters/request-cookies"; import { ReadonlyRequestCookies } from "next/dist/server/web/spec-extension/adapters/request-cookies";
import { AuthType, SERVER_SIDE_ONLY__CLOUD_ENABLED } from "./constants"; import { AuthType, NEXT_PUBLIC_CLOUD_ENABLED } from "./constants";
export interface AuthTypeMetadata { export interface AuthTypeMetadata {
authType: AuthType; authType: AuthType;
@ -22,7 +22,7 @@ export const getAuthTypeMetadataSS = async (): Promise<AuthTypeMetadata> => {
let authType: AuthType; let authType: AuthType;
// Override fasapi users auth so we can use both // Override fasapi users auth so we can use both
if (SERVER_SIDE_ONLY__CLOUD_ENABLED) { if (NEXT_PUBLIC_CLOUD_ENABLED) {
authType = "cloud"; authType = "cloud";
} else { } else {
authType = data.auth_type as AuthType; authType = data.auth_type as AuthType;

View File

@ -14,7 +14,7 @@ export const config = {
"/admin/standard-answer/:path*", "/admin/standard-answer/:path*",
// Cloud only // Cloud only
"/admin/cloud-settings/:path*", "/admin/billing/:path*",
], ],
}; };