* Added Overview page * Revised Getting Started page * Minor revision * Edited readme, minor modifications to docs * Removed sweep.yaml, .devcontainer, .ergomake * Moved security.md to .github, added contributing.md * changes as per code review * updated contributing.md * fixed broken links & added missing links in doc, improved structure * fixed link in wsl setup * fixed server link, added https cloning in yarn-setup * removed package-lock.json * added doc card, admonitions * removed underline from nav buttons * refactoring modules/ui * refactoring modules/ui * Change folder case * Fix theme location * Fix case 2 * Fix storybook --------- Co-authored-by: Nimra Ahmed <nimra1408@gmail.com> Co-authored-by: Nimra Ahmed <50912134+nimraahmed@users.noreply.github.com>
65 lines
1.7 KiB
TypeScript
65 lines
1.7 KiB
TypeScript
import { MouseEvent } from 'react';
|
|
import styled from '@emotion/styled';
|
|
|
|
import { IconComponent } from '@/ui/display/icon/types/IconComponent';
|
|
|
|
import {
|
|
FloatingIconButton,
|
|
FloatingIconButtonPosition,
|
|
FloatingIconButtonProps,
|
|
} from './FloatingIconButton';
|
|
|
|
const StyledFloatingIconButtonGroupContainer = styled.div`
|
|
backdrop-filter: blur(20px);
|
|
background-color: ${({ theme }) => theme.background.primary};
|
|
border-radius: ${({ theme }) => theme.border.radius.sm};
|
|
box-shadow: ${({ theme }) =>
|
|
`0px 2px 4px 0px ${theme.background.transparent.light}, 0px 0px 4px 0px ${theme.background.transparent.medium}`};
|
|
display: flex;
|
|
gap: 2px;
|
|
padding: 2px;
|
|
`;
|
|
|
|
export type FloatingIconButtonGroupProps = Pick<
|
|
FloatingIconButtonProps,
|
|
'className' | 'size'
|
|
> & {
|
|
iconButtons: {
|
|
Icon: IconComponent;
|
|
onClick?: (event: MouseEvent<any>) => void;
|
|
isActive?: boolean;
|
|
}[];
|
|
};
|
|
|
|
export const FloatingIconButtonGroup = ({
|
|
iconButtons,
|
|
size,
|
|
className,
|
|
}: FloatingIconButtonGroupProps) => (
|
|
<StyledFloatingIconButtonGroupContainer className={className}>
|
|
{iconButtons.map(({ Icon, onClick, isActive }, index) => {
|
|
const position: FloatingIconButtonPosition =
|
|
iconButtons.length === 1
|
|
? 'standalone'
|
|
: index === 0
|
|
? 'left'
|
|
: index === iconButtons.length - 1
|
|
? 'right'
|
|
: 'middle';
|
|
|
|
return (
|
|
<FloatingIconButton
|
|
key={`floating-icon-button-${index}`}
|
|
applyBlur={false}
|
|
applyShadow={false}
|
|
Icon={Icon}
|
|
onClick={onClick}
|
|
position={position}
|
|
size={size}
|
|
isActive={isActive}
|
|
/>
|
|
);
|
|
})}
|
|
</StyledFloatingIconButtonGroupContainer>
|
|
);
|