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)

44 lines (38 loc) 1.23 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var React = require('react'); var React__default = _interopDefault(React); var styled = require('styled-components'); var styled__default = _interopDefault(styled); /** * @file index.tsx * * @fileoverview A wrapper to include multiple form actions inside. */ const StyledFormActionsWrapper = styled__default.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)); }; exports.FormActions = FormActions; exports.StyledFormActionsWrapper = StyledFormActionsWrapper;