/* eslint-disable sort-keys */
import { AppContainer } from '../../../components/AppContainer';
import { Avatar } from '../../../components/Avatar';
import { Box } from '../../../components/Box';
import { Button } from '../../../components/Button';
import { Card } from '../../../components/Card';
import { CircledIcon } from '../../../components/CircledIcon';
import { Col, Grid, Row } from '../../../components/Grid';
import { ComponentMeta, ComponentStory } from '@storybook/react';
import { Countdown } from '../../../components/Countdown';
import { Display, Text } from '../../../components/Typography';
import { Divider } from '../../../components/Divider';
import {
Sidebar,
SidebarMenuGroup,
SidebarMenuItem,
SidebarMenuItemProps,
SidebarUserButton
} from '../../../components/Sidebar';
import { ViewContainer } from '../../../components/ViewContainer';
import React from 'react';
import base from 'paths.macro';
const commonMenu = [
{ icon: 'users', label: 'Communities' },
{ icon: 'tray', label: 'Governance' },
{ icon: 'barChart2', label: 'Global Dashboard' },
{ icon: 'impactMarket', label: 'About Us' }
] as SidebarMenuItemProps[];
const menus = [
[
{ flag: 'Claim', icon: 'coins', isActive: true, label: 'UBI' },
{ icon: 'bookOpen', label: 'Learn & Earn' },
{ icon: 'flash', label: 'Stories', flag: 4 }
]
] as SidebarMenuItemProps[][];
const footerMenu = [
{ icon: 'help', label: 'Help' },
{ icon: 'settings', label: 'Settings' },
{ icon: 'flag', label: 'Report Suspicious Activity' },
{ icon: 'bell', label: 'Notifications' }
];
const SidebarFooter = (props: { withButton?: boolean }) => {
const { withButton } = props;
if (withButton) {
return (
);
}
return (
console.log('User button action')}
photo={{ url: 'https://picsum.photos/40' }}
/>
);
};
const MobileActions = (props: { withButton?: boolean }) => {
const { withButton } = props;
if (withButton) {
return (
);
}
return ;
};
export default {
title: `Components/${base.replace('/src/stories/2-base/', '')}App Layout`
} as ComponentMeta;
const Template: ComponentStory = args => {
const { notLoggedIn, sidebarIsLoading, viewContainerIsLoading } = args;
return (
}
isLoading={sidebarIsLoading}
mobileActions={}
>
{!notLoggedIn &&
menus.map((group, index) => (
{group.map((item, groupIndex) => (
console.log(item)} />
))}
))}
{commonMenu.map((item, index) => (
console.log(item)} />
))}
{!notLoggedIn && (
{footerMenu.map((item, index) => (
console.log(item)} />
))}
)}
App Layout components
This is composed by `AppContainer`, `Sidebar` and `ViewContainer` components. Check the structure
using the tab 'Docs' then click in 'Show code'.
Almost there...
When this countdown ends, you will be able to claim your Unconditional Basic
Income (UBI) of ~R$10.5.
);
};
export const AppLayout = Template.bind({});
AppLayout.args = {
notLoggedIn: false,
sidebarIsLoading: false,
viewContainerIsLoading: false
};