mirror of
https://github.com/SomboChea/ui
synced 2024-11-24 06:54:27 +07:00
chore(build): add missing export (#417)
Co-authored-by: Juan Picado @jotadeveloper <juanpicado19@gmail.com>
This commit is contained in:
parent
1eca1f4079
commit
d4f2720994
@ -1,13 +1,10 @@
|
||||
import React, { forwardRef } from 'react';
|
||||
import { default as MaterialUITypography, TypographyProps } from '@material-ui/core/Typography';
|
||||
import { default as MaterialUITypography } from '@material-ui/core/Typography';
|
||||
|
||||
import { TextProps } from './TextConfig';
|
||||
|
||||
type TextType = 'subtitle1' | 'subtitle2' | 'body1' | 'body2';
|
||||
type TextRef = HTMLElementTagNameMap[keyof HTMLElementTagNameMap];
|
||||
|
||||
export interface TextProps extends Omit<TypographyProps, 'variant'> {
|
||||
variant?: TextType;
|
||||
}
|
||||
|
||||
// The reference is already from type of the Component, so the any below is not a problem
|
||||
const Text = forwardRef<TextRef, TextProps>(function Text(props, ref) {
|
||||
return <MaterialUITypography {...props} ref={ref} />;
|
||||
|
7
src/muiComponents/Text/TextConfig.ts
Normal file
7
src/muiComponents/Text/TextConfig.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import { TypographyProps } from '@material-ui/core/Typography';
|
||||
|
||||
type TextType = 'subtitle1' | 'subtitle2' | 'body1' | 'body2';
|
||||
|
||||
export interface TextProps extends Omit<TypographyProps, 'variant'> {
|
||||
variant?: TextType;
|
||||
}
|
@ -1 +1,2 @@
|
||||
export { default, TextProps } from './Text';
|
||||
export { default } from './Text';
|
||||
export { TextProps } from './TextConfig';
|
||||
|
@ -1,24 +1,6 @@
|
||||
import { createContext, Consumer, Provider } from 'react';
|
||||
|
||||
import { PackageMetaInterface } from '../../../types/packageMeta';
|
||||
export interface DetailContextProps {
|
||||
packageMeta: PackageMetaInterface;
|
||||
packageVersion?: string;
|
||||
readMe: string;
|
||||
packageName: string;
|
||||
enableLoading: () => void;
|
||||
isLoading: boolean;
|
||||
hasNotBeenFound: boolean;
|
||||
}
|
||||
|
||||
export interface VersionPageConsumerProps {
|
||||
packageMeta: PackageMetaInterface;
|
||||
readMe: string;
|
||||
packageName: string;
|
||||
packageVersion?: string;
|
||||
// FIXME: looking for the appropiated type here
|
||||
enableLoading: any;
|
||||
}
|
||||
import { DetailContextProps, VersionPageConsumerProps } from './version-config';
|
||||
|
||||
export const DetailContext = createContext<Partial<DetailContextProps>>({});
|
||||
|
||||
|
@ -1,8 +1,4 @@
|
||||
export {
|
||||
DetailContext,
|
||||
DetailContextConsumer,
|
||||
DetailContextProvider,
|
||||
DetailContextProps,
|
||||
VersionPageConsumerProps,
|
||||
} from './context';
|
||||
export { DetailContext, DetailContextConsumer, DetailContextProvider } from './context';
|
||||
export { VersionPageConsumerProps, DetailContextProps } from './version-config';
|
||||
|
||||
export { default } from './Version';
|
||||
|
19
src/pages/Version/version-config.ts
Normal file
19
src/pages/Version/version-config.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import { PackageMetaInterface } from '../../../types/packageMeta';
|
||||
|
||||
export interface DetailContextProps {
|
||||
enableLoading: () => void;
|
||||
hasNotBeenFound: boolean;
|
||||
isLoading: boolean;
|
||||
packageMeta: PackageMetaInterface;
|
||||
packageName: string;
|
||||
packageVersion?: string;
|
||||
readMe: string;
|
||||
}
|
||||
|
||||
export interface VersionPageConsumerProps {
|
||||
enableLoading: () => void;
|
||||
packageMeta: PackageMetaInterface;
|
||||
packageName: string;
|
||||
packageVersion?: string;
|
||||
readMe: string;
|
||||
}
|
Loading…
Reference in New Issue
Block a user