summaryrefslogtreecommitdiff
path: root/src/containers
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2021-04-24 18:43:52 +0300
committereug-vs <eug-vs@keemail.me>2021-04-24 18:46:36 +0300
commitaa04c35e73ddd1f2d38de68e437c0c3d697d42e2 (patch)
treef08bdf09dc9671d0b9843cf8ceaee308fd5edd64 /src/containers
parent7db2d671b266d422606a845683a1c3a2ea75d68a (diff)
downloadcommercel-ui-aa04c35e73ddd1f2d38de68e437c0c3d697d42e2.tar.gz
feat: add loading indicator stubs
Diffstat (limited to 'src/containers')
-rw-r--r--src/containers/Page.tsx14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/containers/Page.tsx b/src/containers/Page.tsx
index 887e839..2d6fd14 100644
--- a/src/containers/Page.tsx
+++ b/src/containers/Page.tsx
@@ -7,15 +7,21 @@ interface Props {
title?: string;
actions?: Action[];
filters?: JSX.Element;
+ isValidating?: boolean;
className?: string;
}
const style = 'mb-2 flex justify-between md:flex-row md:items-center';
-const Page: React.FC<Props> = ({ title, actions, filters, className, children }) => (
- <Paper className="xl:m-5">
- <div className={`${style} ${(actions?.length || 0) > 1 ? 'flex-col items-start' : 'flex-row items-center'}`}>
- <span className="text-2xl font-bold">{title}</span>
+const Spinner: React.FC = () => <> O</>; // TODO: replace with spinner
+
+const Page: React.FC<Props> = ({ title, actions, filters, isValidating, className, children }) => (
+ <Paper className="xl:m-5 overflow-x-auto">
+ <div className={`${style} flex-col items-start`}>
+ <span className="text-2xl font-bold">
+ {title}
+ {isValidating && <Spinner />}
+ </span>
<div className="flex">
{filters}
{actions?.map(action => (<Button {...action} key={action.name} size="sm">{action.name}</Button>))}