Skip to content

Fixed exports #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion __tests__/Button.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { shallow } from 'enzyme';
import React from 'react';
import Button from '@/components/Button';
import { Button } from '@/components/Button';
import { Variant } from '@/components';

describe('Button test', () => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/Page.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { shallow } from 'enzyme';
import React from 'react';
import Page from '@/components/Page';
import { Page } from '@/components/Page';

describe('Page test', () => {
it('should render page', () => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/Panel.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { shallow } from 'enzyme';
import React from 'react';
import Panel from '@/components/Panel';
import { Panel } from '@/components/Panel';

describe('Page test', () => {
it('should render panel', () => {
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions src/components/Button/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as Button } from './Button';
2 changes: 1 addition & 1 deletion src/components/Page/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import Panel from '@/components/Panel';
import { Panel } from '@/components/Panel';
import clsx from 'clsx';

export interface PageHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions src/components/Page/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { default as Page } from './Page';
export { default as PageHeader } from './Header';
export { default as PageContent } from './Content';
File renamed without changes.
1 change: 1 addition & 0 deletions src/components/Panel/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as Panel } from './Panel';
4 changes: 2 additions & 2 deletions src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './utils';
export { default as Page } from './Page';
export { default as Panel } from './Panel';
export * from './Page';
export * from './Panel';
4 changes: 1 addition & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
export { default as Button } from './components/Button'
export { default as Page } from './components/Page';
export { default as Panel } from './components/Panel';
export * from './components'
27 changes: 26 additions & 1 deletion www/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,32 @@
import * as React from 'react';
import * as ReactDom from 'react-dom';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faArrowAltCircleDown, faEye, faEyeSlash } from '@fortawesome/free-regular-svg-icons';

import '../../src/style/index.scss';
import { Page, Variant } from '../../src/components';
import Button from '@/components/Button';

ReactDom.render(
null,
<Page>
<Page.Header title="Dashboard" />
<Page.Content>
<Button
as="a"
small
variant={Variant.DANGER_GHOST}
>
<FontAwesomeIcon icon={faArrowAltCircleDown} />
</Button>
<Button
variant={Variant.SECONDARY}
iconLeft={<FontAwesomeIcon icon={faEye} />}
iconRight={<FontAwesomeIcon icon={faEyeSlash} />}
block
>
Secondary button
</Button>
</Page.Content>
</Page>,
document.getElementById('root')
);
2 changes: 1 addition & 1 deletion www/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const setEnvVars = () => {

module.exports = {
entry: {
main: './www/src/index.tsx'
main: './www/src/Page.tsx'
},
module: {
rules: [
Expand Down