* POC displaying route in Tabs * WIP Add new menu style Co-authored-by: Krzysztof Jelski <krzysztof-jelski@users.noreply.github.com> * Rename Section to CurrentSection * Add new Tabs styling * WIP Add new menu styling * Set menu's max-width * Add theme styles to menu * Change font size and font weight * Remove r * Remove console logs * Update header styles * Fix settings link padding * Change nav link font weight * Change settings link font weight * Fix settings link paddings * Change nav links font size * Add menu padding * Change badge paddings * Change counter badge color to grey * Add space between menu items * Change chain name font styles * Remove color setting from chain css class * Restore previous whitish color * Move NodeInfo component to .menuContainer * Restore font-weights * Increase the max-width of chain name * Set darker color for TabsSectionDelimiter * Center vertically the left chain icon * Change ChainInfo's elements align and font-sizes * storke highlight * Restore ChainInfo alignment * Revert badges colors * Align right search bar * Change menu styling to prevent menu lists blending * Remove scrollbar from tabs * Resolve problem with search bar placement * Add margin-bottom to settings tab * Change setting padding when there is no badge * Make tab underline to ignore badge and move it under tabs bar * WIP Change menu * Apply contrast to menu hover * Add bright menu hover for chains with dark chain color * Add chain color to menu list * Set menu list hover * Add badge styles * Align items badge Co-authored-by: Krzysztof Jelski <krzysztof-jelski@users.noreply.github.com> Co-authored-by: Krzysztof Jelski <krzysztof@ethworks.io> Co-authored-by: alexcherman <sashacherman@gmail.com> Co-authored-by: Jaco Greeff <jacogr@gmail.com> Co-authored-by: Ewa Kowalska <ewcia.kowalska@gmail.com>
86 lines
1.8 KiB
TypeScript
86 lines
1.8 KiB
TypeScript
// Copyright 2017-2021 @polkadot/react-components authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import React from 'react';
|
|
import ReactMd from 'react-markdown';
|
|
import styled from 'styled-components';
|
|
|
|
import { useToggle } from '@polkadot/react-hooks';
|
|
|
|
import Icon from './Icon';
|
|
|
|
interface Props {
|
|
className?: string;
|
|
md: string;
|
|
}
|
|
|
|
function HelpOverlay ({ className = '', md }: Props): React.ReactElement<Props> {
|
|
const [isVisible, toggleVisible] = useToggle();
|
|
|
|
return (
|
|
<div className={`ui--HelpOverlay ${className}`}>
|
|
<div className='help-button'>
|
|
<Icon
|
|
icon='question-circle'
|
|
onClick={toggleVisible}
|
|
/>
|
|
</div>
|
|
<div className={`help-slideout ${isVisible ? 'open' : 'closed'}`}>
|
|
<div className='help-button'>
|
|
<Icon
|
|
icon='times'
|
|
onClick={toggleVisible}
|
|
/>
|
|
</div>
|
|
<ReactMd
|
|
className='help-content'
|
|
escapeHtml={false}
|
|
source={md}
|
|
/>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default React.memo(styled(HelpOverlay)`
|
|
.help-button {
|
|
color: var(--color-text);
|
|
cursor: pointer;
|
|
font-size: 2rem;
|
|
padding: 0.35rem 1.5rem 0 0;
|
|
}
|
|
|
|
> .help-button {
|
|
position: absolute;
|
|
right: 0rem;
|
|
top: 0rem;
|
|
z-index: 10;
|
|
}
|
|
|
|
.help-slideout {
|
|
background: var(--bg-page);
|
|
box-shadow: -6px 0px 20px 0px rgba(0, 0, 0, 0.3);
|
|
bottom: 0;
|
|
max-width: 50rem;
|
|
overflow-y: scroll;
|
|
position: fixed;
|
|
right: -50rem;
|
|
top: 0;
|
|
transition-duration: .5s;
|
|
transition-property: all;
|
|
z-index: 225; /* 5 more than menubar */
|
|
|
|
.help-button {
|
|
text-align: right;
|
|
}
|
|
|
|
.help-content {
|
|
padding: 1rem 1.5rem 5rem;
|
|
}
|
|
|
|
&.open {
|
|
right: 0;
|
|
}
|
|
}
|
|
`);
|