Skip to content

Commit

Permalink
🐛 fix container style
Browse files Browse the repository at this point in the history
  • Loading branch information
a-tokyo committed Feb 24, 2024
1 parent 1bf00c8 commit ef87bd7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ coverage/
# Storybook
storybook-static/
storybook.requires.js

# Editors
.vscode
6 changes: 4 additions & 2 deletions src/components/Layout/Col/Col.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { View, ViewProps } from 'react-native';
import { View } from 'react-native';

import { getConfig } from '../../../utils/grid';
import {
Expand All @@ -10,7 +10,7 @@ import {
/** Default gutter x size */
const DEFAULT_GX = 4;

export declare interface ColProps extends ViewProps {
export declare interface ColProps extends React.ComponentProps<typeof View> {
/** xs size */
xs?: number | string;
/** sm size */
Expand Down Expand Up @@ -47,6 +47,8 @@ export declare interface ColProps extends ViewProps {
dir?: 'ltr' | 'rtl';
/** Element to render - defaults to View */
Element?: React.ElementType;
/** style */
style: React.ComponentProps<typeof View>['style'];
}

/** converts decimal to percent string */
Expand Down
8 changes: 5 additions & 3 deletions src/components/Layout/Container/Container.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
import React from 'react';
import { StyleSheet, View, ViewProps,useWindowDimensions } from 'react-native';
import { StyleSheet, View, useWindowDimensions } from 'react-native';

import { getConfig } from '../../../utils/grid';
import { getGridBreakpoint } from '../../../utils/responsive';

export declare interface ContainerProps extends ViewProps {
export declare interface ContainerProps extends React.ComponentProps<typeof View> {
/** Fluid Container */
fluid?: boolean;
/** No Padding */
noPadding?: boolean;
/** Element to render - defaults to View */
Element?: React.ElementType;
/** style */
style: React.ComponentProps<typeof View>['style'];
}

const styles = StyleSheet.create({
container: {
width: '100%',
justifySelf: 'center',
// flex: 1,
},
fluid: {
maxWidth: '100%',
Expand Down Expand Up @@ -61,6 +62,7 @@ const Container = ({
? (SCREEN_WIDTH - maxWidth) / 2
: undefined,
},
style,
]}
{...rest}
/>
Expand Down
6 changes: 4 additions & 2 deletions src/components/Layout/Row/Row.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import React from 'react';
import { StyleSheet, View, ViewProps } from 'react-native';
import { StyleSheet, View } from 'react-native';

import { getConfig } from '../../../utils/grid';

export declare interface RowProps extends ViewProps {
export declare interface RowProps extends React.ComponentProps<typeof View> {
/** Gutter size -- [Bootstrap Gutters](https://getbootstrap.com/docs/5.0/layout/gutters/) */
gx?: 0 | 1 | 2 | 3 | 4 | 5;
/** Direction */
dir?: 'ltr' | 'rtl';
/** Element to render - defaults to View */
Element?: React.ElementType;
/** style */
style: React.ComponentProps<typeof View>['style'];
}

const styles = StyleSheet.create({
Expand Down

0 comments on commit ef87bd7

Please sign in to comment.