boxons/components/shared/Spacers.tsx

21 lines
595 B
TypeScript
Raw Permalink Normal View History

2024-10-13 11:29:36 +00:00
import React from 'react';
import styled from '@emotion/native';
import { View, ViewProps } from 'react-native';
const Spacer = (props: Omit<ViewProps, 'pointerEvents'>) => (
<View pointerEvents="none" {...props} />
);
export const VerticalSpacer = styled(Spacer)<{ heightUnits: number }>(({ theme, heightUnits }) => ({
height: theme.layout.gridUnit * heightUnits,
}));
export const HorizontalSpacer = styled(Spacer)<{ widthUnits: number }>(({ theme, widthUnits }) => ({
width: theme.layout.gridUnit * widthUnits,
}));
export const ElasticSpacer = styled(Spacer)({
flexGrow: 1,
});