Loading güncellemesi
This commit is contained in:
parent
948925816f
commit
56afb103df
11 changed files with 22 additions and 11 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import DynamicRenderer from './DynamicRenderer'
|
import DynamicRenderer from './DynamicRenderer'
|
||||||
import { useComponents } from '@/contexts/ComponentContext'
|
import { useComponents } from '@/contexts/ComponentContext'
|
||||||
|
import { Loading } from '../shared'
|
||||||
|
|
||||||
export interface ComponentPreviewProps {
|
export interface ComponentPreviewProps {
|
||||||
componentName?: string
|
componentName?: string
|
||||||
|
|
@ -19,7 +20,7 @@ const ComponentPreview: React.FC<ComponentPreviewProps> = ({ componentName, clas
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center justify-center min-h-screen bg-gray-50">
|
<div className="flex items-center justify-center min-h-screen bg-gray-50">
|
||||||
<div className="text-center">
|
<div className="text-center">
|
||||||
<div className="w-12 h-12 border-4 border-blue-500 border-t-transparent rounded-full animate-spin mx-auto"></div>
|
<Loading loading={true} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import axios from 'axios'
|
||||||
import { useComponents } from '../../contexts/ComponentContext'
|
import { useComponents } from '../../contexts/ComponentContext'
|
||||||
import ErrorBoundary from './ErrorBoundary'
|
import ErrorBoundary from './ErrorBoundary'
|
||||||
import { toast } from '../ui'
|
import { toast } from '../ui'
|
||||||
|
import { Loading } from '../shared'
|
||||||
|
|
||||||
const compileComponent = (code: string, scope: Record<string, any> = {}) => {
|
const compileComponent = (code: string, scope: Record<string, any> = {}) => {
|
||||||
const transpiled = Babel.transform(code, {
|
const transpiled = Babel.transform(code, {
|
||||||
|
|
@ -194,7 +195,7 @@ const DynamicRenderer: React.FC<DynamicRendererProps> = ({
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center justify-center min-h-screen bg-gray-50">
|
<div className="flex items-center justify-center min-h-screen bg-gray-50">
|
||||||
<div className="text-center">
|
<div className="text-center">
|
||||||
<div className="w-12 h-12 border-4 border-blue-500 border-t-transparent rounded-full animate-spin mx-auto"></div>
|
<Loading loading={!Component} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import {
|
||||||
} from 'react-icons/fa'
|
} from 'react-icons/fa'
|
||||||
import { ROUTES_ENUM } from '@/routes/route.constant'
|
import { ROUTES_ENUM } from '@/routes/route.constant'
|
||||||
import { useLocalization } from '@/utils/hooks/useLocalization'
|
import { useLocalization } from '@/utils/hooks/useLocalization'
|
||||||
|
import { Loading } from '../shared'
|
||||||
|
|
||||||
const ComponentManager: React.FC = () => {
|
const ComponentManager: React.FC = () => {
|
||||||
const { components, loading, updateComponent, deleteComponent } = useComponents()
|
const { components, loading, updateComponent, deleteComponent } = useComponents()
|
||||||
|
|
@ -157,7 +158,7 @@ const ComponentManager: React.FC = () => {
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<div className="flex items-center justify-center min-h-screen bg-gray-50">
|
<div className="flex items-center justify-center min-h-screen bg-gray-50">
|
||||||
<div className="text-center">
|
<div className="text-center">
|
||||||
<div className="w-12 h-12 border-4 border-blue-500 border-t-transparent rounded-full animate-spin mx-auto"></div>
|
<Loading loading={loading} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) : filteredComponents?.length > 0 ? (
|
) : filteredComponents?.length > 0 ? (
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import { addItemToCart, CartState } from '@/utils/cartUtils'
|
||||||
import { BillingCycle, ProductDto } from '@/proxy/order/models'
|
import { BillingCycle, ProductDto } from '@/proxy/order/models'
|
||||||
import { OrderService } from '@/services/order.service'
|
import { OrderService } from '@/services/order.service'
|
||||||
import { useLocalization } from '@/utils/hooks/useLocalization'
|
import { useLocalization } from '@/utils/hooks/useLocalization'
|
||||||
|
import { Loading } from '../shared'
|
||||||
|
|
||||||
interface ProductCatalogProps {
|
interface ProductCatalogProps {
|
||||||
searchQuery: string
|
searchQuery: string
|
||||||
|
|
@ -149,7 +150,7 @@ export const ProductCatalog: React.FC<ProductCatalogProps> = ({
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<div className="flex items-center justify-center min-h-screen bg-gray-50">
|
<div className="flex items-center justify-center min-h-screen bg-gray-50">
|
||||||
<div className="text-center">
|
<div className="text-center">
|
||||||
<div className="w-12 h-12 border-4 border-blue-500 border-t-transparent rounded-full animate-spin mx-auto"></div>
|
<Loading loading={loading} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import navigationIcon from '@/configs/navigation-icon.config'
|
||||||
import { AboutDto } from '@/proxy/about/models'
|
import { AboutDto } from '@/proxy/about/models'
|
||||||
import { getAbout } from '@/services/about'
|
import { getAbout } from '@/services/about'
|
||||||
import { useLocalization } from '@/utils/hooks/useLocalization'
|
import { useLocalization } from '@/utils/hooks/useLocalization'
|
||||||
|
import Loading from '@/components/shared/Loading'
|
||||||
|
|
||||||
const About: React.FC = () => {
|
const About: React.FC = () => {
|
||||||
const { translate } = useLocalization()
|
const { translate } = useLocalization()
|
||||||
|
|
@ -42,7 +43,7 @@ const About: React.FC = () => {
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center justify-center min-h-screen bg-gray-50">
|
<div className="flex items-center justify-center min-h-screen bg-gray-50">
|
||||||
<div className="text-center">
|
<div className="text-center">
|
||||||
<div className="w-12 h-12 border-4 border-blue-500 border-t-transparent rounded-full animate-spin mx-auto"></div>
|
<Loading loading={loading} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import { BlogCategory, BlogPost } from '@/proxy/blog/blog'
|
||||||
import { blogService } from '@/services/blog.service'
|
import { blogService } from '@/services/blog.service'
|
||||||
import { useLocalization } from '@/utils/hooks/useLocalization'
|
import { useLocalization } from '@/utils/hooks/useLocalization'
|
||||||
import { Helmet } from 'react-helmet'
|
import { Helmet } from 'react-helmet'
|
||||||
|
import { Loading } from '@/components/shared'
|
||||||
|
|
||||||
const Blog = () => {
|
const Blog = () => {
|
||||||
const { translate } = useLocalization()
|
const { translate } = useLocalization()
|
||||||
|
|
@ -66,7 +67,7 @@ const Blog = () => {
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center justify-center min-h-screen bg-gray-50">
|
<div className="flex items-center justify-center min-h-screen bg-gray-50">
|
||||||
<div className="text-center">
|
<div className="text-center">
|
||||||
<div className="w-12 h-12 border-4 border-blue-500 border-t-transparent rounded-full animate-spin mx-auto"></div>
|
<Loading loading={loading} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import { useLocalization } from '@/utils/hooks/useLocalization'
|
||||||
import { useStoreState } from '@/store/store'
|
import { useStoreState } from '@/store/store'
|
||||||
import { ROUTES_ENUM } from '@/routes/route.constant'
|
import { ROUTES_ENUM } from '@/routes/route.constant'
|
||||||
import { Helmet } from 'react-helmet'
|
import { Helmet } from 'react-helmet'
|
||||||
|
import { Loading } from '@/components/shared'
|
||||||
|
|
||||||
interface PostData {
|
interface PostData {
|
||||||
image?: string
|
image?: string
|
||||||
|
|
@ -56,7 +57,7 @@ const BlogDetail: React.FC = () => {
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center justify-center min-h-screen bg-gray-50">
|
<div className="flex items-center justify-center min-h-screen bg-gray-50">
|
||||||
<div className="text-center">
|
<div className="text-center">
|
||||||
<div className="w-12 h-12 border-4 border-blue-500 border-t-transparent rounded-full animate-spin mx-auto"></div>
|
<Loading loading={loading} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import { useLocalization } from '@/utils/hooks/useLocalization'
|
||||||
import { Helmet } from 'react-helmet'
|
import { Helmet } from 'react-helmet'
|
||||||
import { ContactDto } from '@/proxy/contact/models'
|
import { ContactDto } from '@/proxy/contact/models'
|
||||||
import { getContact } from '@/services/contact'
|
import { getContact } from '@/services/contact'
|
||||||
|
import { Loading } from '@/components/shared'
|
||||||
|
|
||||||
const Contact: React.FC = () => {
|
const Contact: React.FC = () => {
|
||||||
const { translate } = useLocalization()
|
const { translate } = useLocalization()
|
||||||
|
|
@ -41,7 +42,7 @@ const Contact: React.FC = () => {
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center justify-center min-h-screen bg-gray-50">
|
<div className="flex items-center justify-center min-h-screen bg-gray-50">
|
||||||
<div className="text-center">
|
<div className="text-center">
|
||||||
<div className="w-12 h-12 border-4 border-blue-500 border-t-transparent rounded-full animate-spin mx-auto"></div>
|
<Loading loading={loading} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import { Cart } from '@/components/orders/Cart'
|
import { Cart } from '@/components/orders/Cart'
|
||||||
import { PaymentForm } from '@/components/orders/PaymentForm'
|
import { PaymentForm } from '@/components/orders/PaymentForm'
|
||||||
|
import { Loading } from '@/components/shared'
|
||||||
import { CustomTenantDto } from '@/proxy/config/models'
|
import { CustomTenantDto } from '@/proxy/config/models'
|
||||||
import { OrderDto } from '@/proxy/order/models'
|
import { OrderDto } from '@/proxy/order/models'
|
||||||
import { ROUTES_ENUM } from '@/routes/route.constant'
|
import { ROUTES_ENUM } from '@/routes/route.constant'
|
||||||
|
|
@ -111,7 +112,7 @@ const Payment: React.FC = () => {
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center justify-center min-h-screen bg-gray-50">
|
<div className="flex items-center justify-center min-h-screen bg-gray-50">
|
||||||
<div className="text-center">
|
<div className="text-center">
|
||||||
<div className="w-12 h-12 border-4 border-blue-500 border-t-transparent rounded-full animate-spin mx-auto"></div>
|
<Loading loading={!tenant} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import { Helmet } from 'react-helmet'
|
||||||
import { ServiceDto } from '@/proxy/services/models'
|
import { ServiceDto } from '@/proxy/services/models'
|
||||||
import { getServices } from '@/services/service.service'
|
import { getServices } from '@/services/service.service'
|
||||||
import navigationIcon from '@/configs/navigation-icon.config'
|
import navigationIcon from '@/configs/navigation-icon.config'
|
||||||
|
import { Loading } from '@/components/shared'
|
||||||
|
|
||||||
const Services: React.FC = () => {
|
const Services: React.FC = () => {
|
||||||
const { translate } = useLocalization()
|
const { translate } = useLocalization()
|
||||||
|
|
@ -63,7 +64,7 @@ const Services: React.FC = () => {
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center justify-center min-h-screen bg-gray-50">
|
<div className="flex items-center justify-center min-h-screen bg-gray-50">
|
||||||
<div className="text-center">
|
<div className="text-center">
|
||||||
<div className="w-12 h-12 border-4 border-blue-500 border-t-transparent rounded-full animate-spin mx-auto"></div>
|
<Loading loading={loading} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { OrderSuccess } from '@/components/orders/OrderSuccess'
|
import { OrderSuccess } from '@/components/orders/OrderSuccess'
|
||||||
|
import { Loading } from '@/components/shared'
|
||||||
import { ROUTES_ENUM } from '@/routes/route.constant'
|
import { ROUTES_ENUM } from '@/routes/route.constant'
|
||||||
import { useLocalization } from '@/utils/hooks/useLocalization'
|
import { useLocalization } from '@/utils/hooks/useLocalization'
|
||||||
import React, { useState, useEffect } from 'react'
|
import React, { useState, useEffect } from 'react'
|
||||||
|
|
@ -30,7 +31,7 @@ const Success: React.FC = () => {
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center justify-center min-h-screen bg-gray-50">
|
<div className="flex items-center justify-center min-h-screen bg-gray-50">
|
||||||
<div className="text-center">
|
<div className="text-center">
|
||||||
<div className="w-12 h-12 border-4 border-blue-500 border-t-transparent rounded-full animate-spin mx-auto"></div>
|
<Loading loading={!orderId} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue