* Playthrough with top navigation * Sycky, but navigation works... * Adjust * grouping * It works, but is not great * Cleanups * Cleanups * hover color * Highlights * Highlights, part 2 * Background to body * Small adjustments (size, items) * Localize Modal/route switching * Remove light/full mode * Flatter single-entry menus * Adjustments for single-enrties (e.g. Kulupu) * Display NodeInfo * Misc * Content & Tabs sizing * Tab counters as bubbles * Alignment * Tabs styling * Adjust font color to defaults * Small tabs menu color adjustments * ... the previous, again, adjusted * Display Wiki/Github links * ar motions * Adjust Endpoints location * Ensure content grows to available height * Adjust tabs * Menu background adjustment * Adjust popup colors * Adjust highlights * Sligh breathing room * Adaptive header background * 2/3 * Adaptive is ok... for now. * Back to black... erm, gray * Lighten * Touchups. Stop playin, it is ok... * Sides readability * Cleanups. * Adjust. * Overall adjustments (theme). Fix Tag yellow. * Ok. Done. * Ship it.
56 lines
1.3 KiB
TypeScript
56 lines
1.3 KiB
TypeScript
// Copyright 2017-2020 @polkadot/app-accounts authors & contributors
|
|
// This software may be modified and distributed under the terms
|
|
// of the Apache-2.0 license. See the LICENSE file for details.
|
|
|
|
import React from 'react';
|
|
import styled from 'styled-components';
|
|
|
|
import Button from './Button';
|
|
|
|
interface Props {
|
|
button?: React.ReactNode;
|
|
children: React.ReactNode;
|
|
className?: string;
|
|
offset?: number | string;
|
|
onClose: () => void;
|
|
position: 'left' | 'right';
|
|
}
|
|
|
|
function Sidebar ({ button, children, className = '', onClose }: Props): React.ReactElement<Props> {
|
|
return (
|
|
<div className={`ui--Sidebar ${className}`}>
|
|
<Button.Group className='ui--Sidebar-buttons'>
|
|
{button}
|
|
<Button
|
|
icon='times'
|
|
isBasic
|
|
isCircular
|
|
onClick={onClose}
|
|
/>
|
|
</Button.Group>
|
|
{children}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default React.memo(styled(Sidebar)(({ offset = 0, position }: Props) => `
|
|
background: #f5f3f1;
|
|
bottom: 0;
|
|
box-shadow: ${position === 'right' ? '-6px' : '6px'} 0px 20px 0px rgba(0, 0, 0, 0.3);
|
|
margin-left: -0.125rem;
|
|
max-width: 24rem;
|
|
min-width: 24rem;
|
|
position: fixed;
|
|
padding: 1rem;
|
|
overflow-y: auto;
|
|
top: 0;
|
|
z-index: 999;
|
|
${position}: ${offset};
|
|
|
|
.ui--Sidebar-buttons {
|
|
position: absolute;
|
|
right: 0.5rem;
|
|
top: 0.5rem;
|
|
}
|
|
`));
|