2022-03-11 03:13:10 +01:00
|
|
|
/*
|
|
|
|
This file is part of GNU Taler
|
|
|
|
(C) 2021 Taler Systems S.A.
|
|
|
|
|
|
|
|
GNU Taler is free software; you can redistribute it and/or modify it under the
|
|
|
|
terms of the GNU General Public License as published by the Free Software
|
|
|
|
Foundation; either version 3, or (at your option) any later version.
|
|
|
|
|
|
|
|
GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
|
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along with
|
|
|
|
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @author Sebastian Javier Marchano (sebasjm)
|
|
|
|
*/
|
|
|
|
|
2022-03-11 06:17:40 +01:00
|
|
|
import { Fragment, h, VNode } from "preact";
|
2022-03-29 04:41:07 +02:00
|
|
|
import { Avatar } from "../mui/Avatar.js";
|
|
|
|
import { Typography } from "../mui/Typography.js";
|
2022-03-29 05:45:17 +02:00
|
|
|
import { Banner } from "./Banner.js";
|
|
|
|
import { SvgIcon } from "./styled/index.js";
|
|
|
|
import wifiIcon from "../svg/wifi.svg";
|
2022-03-11 03:13:10 +01:00
|
|
|
export default {
|
|
|
|
title: "mui/banner",
|
|
|
|
component: Banner,
|
|
|
|
};
|
|
|
|
|
2022-03-29 05:45:17 +02:00
|
|
|
function Wrapper({ children }: any): VNode {
|
2022-03-11 03:13:10 +01:00
|
|
|
return (
|
|
|
|
<div
|
|
|
|
style={{
|
|
|
|
display: "flex",
|
|
|
|
backgroundColor: "lightgray",
|
|
|
|
padding: 10,
|
|
|
|
width: "100%",
|
|
|
|
// width: 400,
|
|
|
|
// height: 400,
|
|
|
|
justifyContent: "center",
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<div style={{ flexGrow: 1 }}>{children}</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2022-03-11 06:17:40 +01:00
|
|
|
function SignalWifiOffIcon({ ...rest }: any): VNode {
|
2022-03-29 05:45:17 +02:00
|
|
|
return <SvgIcon {...rest} dangerouslySetInnerHTML={{ __html: wifiIcon }} />;
|
2022-03-11 06:17:40 +01:00
|
|
|
}
|
2022-03-11 03:13:10 +01:00
|
|
|
|
2022-03-29 14:58:06 +02:00
|
|
|
export const BasicExample = (): VNode => (
|
2022-03-11 03:13:10 +01:00
|
|
|
<Fragment>
|
|
|
|
<Wrapper>
|
2022-03-11 06:17:40 +01:00
|
|
|
<p>
|
|
|
|
Example taken from:
|
|
|
|
<a
|
|
|
|
target="_blank"
|
|
|
|
rel="noreferrer"
|
|
|
|
href="https://medium.com/material-ui/introducing-material-ui-design-system-93e921beb8df"
|
|
|
|
>
|
|
|
|
https://medium.com/material-ui/introducing-material-ui-design-system-93e921beb8df
|
|
|
|
</a>
|
|
|
|
</p>
|
|
|
|
<Banner
|
|
|
|
elements={[
|
|
|
|
{
|
2022-03-24 20:02:38 +01:00
|
|
|
icon: <SignalWifiOffIcon color="gray" />,
|
2022-03-11 06:17:40 +01:00
|
|
|
description: (
|
|
|
|
<Typography>
|
|
|
|
You have lost connection to the internet. This app is offline.
|
|
|
|
</Typography>
|
|
|
|
),
|
|
|
|
},
|
|
|
|
]}
|
|
|
|
confirm={{
|
|
|
|
label: "turn on wifi",
|
|
|
|
action: () => {
|
|
|
|
return null;
|
|
|
|
},
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</Wrapper>
|
|
|
|
</Fragment>
|
|
|
|
);
|
|
|
|
|
2022-03-29 14:58:06 +02:00
|
|
|
export const PendingOperation = (): VNode => (
|
2022-03-11 06:17:40 +01:00
|
|
|
<Fragment>
|
|
|
|
<Wrapper>
|
|
|
|
<Banner
|
|
|
|
title="PENDING TRANSACTIONS"
|
2022-03-11 15:14:27 +01:00
|
|
|
style={{ backgroundColor: "lightcyan", padding: 8 }}
|
2022-03-11 06:17:40 +01:00
|
|
|
elements={[
|
|
|
|
{
|
|
|
|
icon: (
|
|
|
|
<Avatar
|
|
|
|
style={{
|
|
|
|
border: "solid blue 1px",
|
|
|
|
color: "blue",
|
|
|
|
boxSizing: "border-box",
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
P
|
|
|
|
</Avatar>
|
|
|
|
),
|
|
|
|
description: (
|
2022-04-05 17:16:09 +02:00
|
|
|
<Fragment>
|
|
|
|
<Typography inline bold>
|
|
|
|
EUR 37.95
|
|
|
|
</Typography>
|
|
|
|
|
|
|
|
<Typography inline>- 5 feb 2022</Typography>
|
|
|
|
</Fragment>
|
2022-03-11 06:17:40 +01:00
|
|
|
),
|
|
|
|
},
|
|
|
|
]}
|
|
|
|
/>
|
2022-03-11 03:13:10 +01:00
|
|
|
</Wrapper>
|
|
|
|
</Fragment>
|
|
|
|
);
|