refactor: rename subscription references to subscribe plan and update related imports
This commit is contained in:
@@ -11,7 +11,7 @@ import { FormRegister } from '~/layouts/news/form-register'
|
||||
|
||||
import { FooterLinks } from './footer-links'
|
||||
import { FooterNewsletter } from './footer-newsletter'
|
||||
import FormSubscription from './form-subscription'
|
||||
import { FormSubscribePlan } from './form-subscribe-plan'
|
||||
import { HeaderMenu } from './header-menu'
|
||||
import { HeaderTop } from './header-top'
|
||||
|
||||
@@ -74,9 +74,9 @@ export const NewsDefaultLayout = (properties: PropsWithChildren) => {
|
||||
<PopupModal
|
||||
isOpen={isSubscribeOpen}
|
||||
onClose={() => setIsSubscribeOpen(false)}
|
||||
description="Selamat Datang, silakan Pilih Subscription Anda untuk melanjutkan!"
|
||||
description="Selamat Datang, silakan Pilih Subscribe Plan Anda untuk melanjutkan!"
|
||||
>
|
||||
<FormSubscription />
|
||||
<FormSubscribePlan />
|
||||
</PopupModal>
|
||||
|
||||
<SuccessModal
|
||||
|
||||
@@ -26,7 +26,7 @@ export const registerSchema = z
|
||||
.optional()
|
||||
.nullable()
|
||||
.refine((data) => !!data, {
|
||||
message: 'Please select a subscription',
|
||||
message: 'Please select a Subscribe Plan',
|
||||
}),
|
||||
})
|
||||
.refine((field) => field.password === field.rePassword, {
|
||||
@@ -42,7 +42,7 @@ export const FormRegister = () => {
|
||||
const [error, setError] = useState<string>()
|
||||
const fetcher = useFetcher()
|
||||
const loaderData = useRouteLoaderData<typeof loader>('routes/_news')
|
||||
const { subscriptionsData: subscriptions } = loaderData || {}
|
||||
const { subscribePlanData: subscribePlan } = loaderData || {}
|
||||
|
||||
const formMethods = useRemixForm<TRegisterSchema>({
|
||||
mode: 'onSubmit',
|
||||
@@ -107,9 +107,9 @@ export const FormRegister = () => {
|
||||
<Combobox
|
||||
id="subscribe_plan"
|
||||
name="subscribe_plan"
|
||||
label="Subscription"
|
||||
placeholder="Pilih Subscription"
|
||||
options={subscriptions}
|
||||
label="Subscribe Plan"
|
||||
placeholder="Pilih Subscribe Plan"
|
||||
options={subscribePlan}
|
||||
/>
|
||||
|
||||
{error && (
|
||||
|
||||
@@ -25,12 +25,12 @@ export const subscribeSchema = z.object({
|
||||
|
||||
export type TSubscribeSchema = z.infer<typeof subscribeSchema>
|
||||
|
||||
export default function FormSubscription() {
|
||||
export const FormSubscribePlan = () => {
|
||||
const { setIsSubscribeOpen, setIsSuccessOpen } = useNewsContext()
|
||||
const fetcher = useFetcher()
|
||||
const [error, setError] = useState<string>()
|
||||
const loaderData = useRouteLoaderData<typeof loader>('routes/_news')
|
||||
const { subscriptionsData: subscriptions } = loaderData || {}
|
||||
const { subscribePlanData: subscribePlan } = loaderData || {}
|
||||
|
||||
const formMethods = useRemixForm<TSubscribeSchema>({
|
||||
mode: 'onSubmit',
|
||||
@@ -64,9 +64,9 @@ export default function FormSubscription() {
|
||||
<Combobox
|
||||
id="subscribe_plan"
|
||||
name="subscribe_plan"
|
||||
label="Subscription"
|
||||
placeholder="Pilih Subscription"
|
||||
options={subscriptions}
|
||||
label="Subscribe Plan"
|
||||
placeholder="Pilih Subscribe Plan"
|
||||
options={subscribePlan}
|
||||
/>
|
||||
|
||||
{error && (
|
||||
@@ -13,7 +13,7 @@ type THeaderMenuMobile = {
|
||||
menu?: TCategoriesResponse['data']
|
||||
}
|
||||
|
||||
export default function HeaderMenuMobile(properties: THeaderMenuMobile) {
|
||||
export const HeaderMenuMobile = (properties: THeaderMenuMobile) => {
|
||||
const { menu } = properties
|
||||
const [isMenuOpen, setIsMenuOpen] = useState(false)
|
||||
const { setIsLoginOpen } = useNewsContext()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Link, useRouteLoaderData } from 'react-router'
|
||||
|
||||
import { Button } from '~/components/ui/button'
|
||||
import HeaderMenuMobile from '~/layouts/news/header-menu-mobile'
|
||||
import { HeaderMenuMobile } from '~/layouts/news/header-menu-mobile'
|
||||
import type { loader } from '~/routes/_news'
|
||||
|
||||
import { HeaderSearch } from './header-search'
|
||||
|
||||
Reference in New Issue
Block a user