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)

35 lines (32 loc) 892 B
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 ` display: flex; button { ${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 };