UNPKG

jobiqo-cl

Version:

[![CircleCI](https://circleci.com/gh/jobiqo/jobiqo-cl.svg?style=svg&circle-token=5a24efa5b8bbc4879276123e77d0d3f35ca7144c)](https://circleci.com/gh/jobiqo/jobiqo-cl)

43 lines (40 loc) 1.04 kB
import React__default from 'react'; import styled from 'styled-components'; /** * @file index.tsx * * @fileoverview A wrapper to include multiple form actions inside. */ const StyledFormActionsWrapper = styled.div ` button { margin-top: 0.5rem; width: auto; } ${props => props.theme.mediaQueries.small} { display: flex; width: 100%; button { margin-top: 0; ${props => props.orientation === 'left' ? ` margin-left: 1rem; &:first-child { margin: 0; } ` : ` &:last-child { margin: 0; } margin-right: 1rem;`} } } `; /** * The form actions component allows grouping multiple form actions. * Usefull to group together a submit and cancel button on a form for example. */ const FormActions = ({ children, orientation = 'left' }) => { return (React__default.createElement(StyledFormActionsWrapper, { orientation: orientation }, children)); }; export { FormActions, StyledFormActionsWrapper };