Skip to content

Commit

Permalink
Basic layout/issue #12 (#24)
Browse files Browse the repository at this point in the history
* Initial structure. List and Detail pages + utils hooks. #3

* Container components + services + models. #3

* Adding List Page. #4

* Json component. #3

* Adding transformer and viewModels. #3

* Adding comments. #3

* Changing projectShortName to projectTitle. #3

* LinkTable component + list transformer. #4

* Fix. #4

* Adding vscode folder to gitignore #3

* generating static html

* adding prettier

* Config eslint

* Adding husky pre-commit. #8

* husky fixes. #8

* setting correct folder

* Build all detail pages. #9

* downgrading react and adding react-table. #10

* Adding react-table. #10

* React table type definition. #10

* Changing LinkTable to React-Table. #10

* Creating layout structure. #12

* Adding storybook. #12
  • Loading branch information
BruceRodrigues authored May 13, 2022
1 parent 1d8edac commit ae5e596
Show file tree
Hide file tree
Showing 18 changed files with 29,389 additions and 2,643 deletions.
1 change: 1 addition & 0 deletions explorer/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"plugin:@typescript-eslint/recommended",
"prettier",
"plugin:prettier/recommended",
"plugin:storybook/recommended",
"next"
]
}
12 changes: 12 additions & 0 deletions explorer/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
"stories": [
"../app/**/*.stories.mdx",
"../app/**/*.stories.@(js|jsx|ts|tsx)"
],
"addons": [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions"
],
"framework": "@storybook/react"
}
9 changes: 9 additions & 0 deletions explorer/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
}
9 changes: 9 additions & 0 deletions explorer/app/components/Body/Body.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from "react";

interface BodyProps {
children: React.ReactNode | React.ReactNode[];
}

export const Body = ({ children }: BodyProps) => {
return <div>{children}</div>;
};
1 change: 1 addition & 0 deletions explorer/app/components/Body/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Body } from "./Body";
9 changes: 9 additions & 0 deletions explorer/app/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from "react";

interface FooterProps {
children: React.ReactNode | React.ReactNode[];
}

export const Footer = ({ children }: FooterProps) => {
return <footer>{children}</footer>;
};
1 change: 1 addition & 0 deletions explorer/app/components/Footer/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Footer } from "./Footer";
19 changes: 19 additions & 0 deletions explorer/app/components/Header/Header.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from "react";
import { ComponentStory, ComponentMeta } from "@storybook/react";

import { Header } from "./Header";

export default {
title: "Components/Header",
component: Header,
argTypes: {
children: { control: "object" },
},
} as ComponentMeta<typeof Header>;

const Template: ComponentStory<typeof Header> = (args) => <Header {...args} />;

export const Primary = Template.bind({});
Primary.args = {
children: "Header",
};
9 changes: 9 additions & 0 deletions explorer/app/components/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from "react";

interface HeaderProps {
children: React.ReactNode | React.ReactNode[];
}

export const Header = ({ children }: HeaderProps) => {
return <header>{children}</header>;
};
1 change: 1 addition & 0 deletions explorer/app/components/Header/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Header } from "./Header";
25 changes: 25 additions & 0 deletions explorer/app/components/Page/Page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Page component will hold page's structure, header, content and footer.
* Header and Footer will be configurable through props.
*/

import React from "react";
import { Body } from "../Body";
import { Footer } from "../Footer";
import { Header } from "../Header";

interface PageProps {
children: React.ReactNode | React.ReactNode[];
}

export const Page = ({ children }: PageProps) => {
return (
//FIXME: Styling will change when we decide about the approach we want to
// follow for this project
<div style={{ display: "flex", flexDirection: "column" }}>
<Header>Header</Header>
<Body>{children}</Body>
<Footer>Footer</Footer>
</div>
);
};
1 change: 1 addition & 0 deletions explorer/app/components/Page/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Page } from "./Page";
4 changes: 4 additions & 0 deletions explorer/app/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
export * from "./PrettyJSON";
export * from "./LinkTable";
export * from "./Table";
export * from "./Body";
export * from "./Footer";
export * from "./Header";
export * from "./Page";
2 changes: 1 addition & 1 deletion explorer/app/models/responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface PaginatedResponse {
count: number;
total: number;
size: number;
next: string;
next?: string;
previous?: string;
pages: number;
sort: string;
Expand Down
Loading

0 comments on commit ae5e596

Please sign in to comment.