-
-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Add types to useRepositoriesList hook (#277)
* Initial commit of updating useRepositories hook types. * Added interface for RepoList api response. Need someone to critique this. * Moving repo type definitions to a new file called additional.d.ts so that the entire app has access to these types. * Corrected type errors from the change to RepoList type change. * Updated types and humanizing item count based on code review. Also renamed selectabletable file to repository table. Will reach out to TED for help with remaining code review updates. * Made some changes based on code review and pairing session with 0-vortex. * Added updates around simple error handling based on code review. * Making some changes based on code review feedback. * Removed duplicate type from types definition file. * Updated dashboard and repositories based on code review.
- Loading branch information
1 parent
06b1720
commit 4f1a771
Showing
10 changed files
with
126 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// User defined type definitions. Please add type definitions for global types here | ||
|
||
interface DBRepo { | ||
readonly size: number, | ||
readonly stars: number, | ||
readonly name: string | ||
} | ||
|
||
interface Meta { | ||
readonly itemCount: number, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import React from "react"; | ||
import { ComponentStory, ComponentMeta } from "@storybook/react"; | ||
import RepositoryTable from "../../components/molecules/RepositoryTable/repository-table"; | ||
|
||
const storyConfig = { | ||
title: "Design System/Molecules/Repository Table", | ||
component: "RepositoryTable" | ||
}; | ||
|
||
export default storyConfig; | ||
|
||
const testRows = [ | ||
{ | ||
name: "freecodecamp", | ||
stars: 100, | ||
size: 30984 | ||
}, | ||
{ | ||
name: "free-programming-books", | ||
stars: 60, | ||
size: 30984 | ||
}, | ||
{ | ||
name: "material-ui", | ||
stars: 20, | ||
size: 30984 | ||
}, | ||
{ | ||
name: "react", | ||
stars: 100, | ||
size: 30984 | ||
}, | ||
{ | ||
name: "java-design-patterns", | ||
stars: 20, | ||
size: 30984 | ||
} | ||
]; | ||
|
||
// SelectableTable Template | ||
const RepositoryTableTemplate: ComponentStory<typeof RepositoryTable> = (args) => <RepositoryTable {...args} />; | ||
|
||
// SelectableTable Default | ||
export const Default = RepositoryTableTemplate.bind({}); | ||
Default.args = {title: "Test Title", tableType: "participants", rows: testRows }; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters