12345678910111213141516171819202122232425262728293031323334353637 |
- import React from 'react';
- import Icon from '../Icon';
- import { ToggleButton } from './styled';
- type Props = {
- displayMode: string;
- toggleDisplayMode: (state: string) => void;
- };
- const FullScreenButton: React.FC<Props> = ({
- displayMode,
- toggleDisplayMode,
- }: Props) => {
- return (
- <ToggleButton>
- {displayMode === 'normal' ? (
- <Icon
- glyph="tool-close"
- onClick={(): void => {
- toggleDisplayMode('full');
- }}
- />
- ) : (
- <Icon
- glyph="tool-open"
- onClick={(): void => {
- toggleDisplayMode('normal');
- }}
- />
- )}
- </ToggleButton>
- );
- };
- export default FullScreenButton;
|