import styled from "@emotion/styled"; import { inject, observer } from "mobx-react"; import React from "react"; import { FaChessBoard, FaTable } from "react-icons/fa"; import { FiSquare, FiType } from "react-icons/fi"; import { GoComment } from "react-icons/go"; import { LIGHT_PRIMARY_THREE, LIGHT_SECONDARY_FIVE, LIGHT_SHADOW, LIGHT_TERTIARY_ONE, LIGHT_TERTIARY_TWO, } from "../../shared/colors"; import { SlideObjectType } from "../../shared/types"; import { CurrentUser_me } from "../graphql/generated/types"; import { StoreProps } from "../platform/SlideshowStore"; import withPlatform, { PlatformProps } from "../platform/withPlatform"; type Props = { user: CurrentUser_me; } & PlatformProps & StoreProps; function SlideItemToggler(props: Props) { const slideItemSelector = props.store.createItemSelector.get(); return ( props.store.createItemSelector.set(SlideObjectType.TEXT)} > props.store.createItemSelector.set(SlideObjectType.RECTANGLE) } > props.store.createItemSelector.set(SlideObjectType.COMMENT) } > props.store.createItemSelector.set(SlideObjectType.AIRTABLE) } > props.store.createItemSelector.set(SlideObjectType.BOARD) } > ); } export default withPlatform(inject("store")(observer(SlideItemToggler))); const ItemToggler = styled.div<{ active: boolean }>` cursor: default; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid ${LIGHT_PRIMARY_THREE}; :hover { background-color: ${(props) => props.active ? LIGHT_PRIMARY_THREE : LIGHT_SECONDARY_FIVE}; border: 1px solid ${(props) => (props.active ? LIGHT_TERTIARY_TWO : LIGHT_SECONDARY_FIVE)}; } :first-of-type { border-top-left-radius: 8px; border-bottom-left-radius: 8px; } :last-of-type { border-top-right-radius: 8px; border-bottom-right-radius: 8px; } ${(props) => props.active && `background-color: ${LIGHT_PRIMARY_THREE}; border: 1px solid ${LIGHT_TERTIARY_ONE}; color: ${LIGHT_TERTIARY_ONE};`} transition: 0.08s ease-in-out; `; const Container = styled.div` position: absolute; z-index: 5; top: 16px; left: 16px; display: flex; height: 36px; width: 144px; background-color: ${LIGHT_PRIMARY_THREE}; border-radius: 8px; box-shadow: 0px 1px 5px 0px ${LIGHT_SHADOW}; `;