-
-
Notifications
You must be signed in to change notification settings - Fork 267
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
Migrate Drawer, ErrorDisplay, and FeaturedJobItem components to typescript #1804
Merged
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f60c8ae
migrated all Drawer component files to .tsx and updated snapshot
recondesigns 0f97bbf
migrated ErrorDisplay component files to .tsx and updated snapshot
recondesigns 539341d
migrated all FeaturedJobItem components to .tsx and updated snapshot
recondesigns ed3f460
merging in main
recondesigns 71b4fab
removed commented code
recondesigns 43b47c7
mergin in main
recondesigns 60a4540
merging in main
recondesigns e3608db
made suggested changes and removed commented code
recondesigns cc8587d
updated Drawer snapshot
recondesigns File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import classNames from 'classnames'; | ||
|
||
export type DrawerPropsType = { | ||
/** | ||
* Content to be rendered in the Drawer. | ||
*/ | ||
children: React.ReactNode; | ||
/** | ||
* Applies class names to the container element. | ||
*/ | ||
className?: string; | ||
/** | ||
* Sets if the content is visible. | ||
* @default false | ||
*/ | ||
isVisible?: boolean; | ||
}; | ||
|
||
function Drawer({ children, className, isVisible = false }: DrawerPropsType) { | ||
return ( | ||
<div | ||
className={classNames( | ||
className, | ||
'hidden lg:block transition-all ease-in-out duration-1000 fixed top-0 bottom-0 overflow-hidden width-full z-[2]', | ||
{ | ||
'-left-0': isVisible, | ||
'-left-[100%]': !isVisible, | ||
recondesigns marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
)} | ||
> | ||
<div className="w-full h-full">{children}</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default Drawer; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
import Drawer from '../Drawer'; | ||
|
||
type DrawerStorytype = StoryObj<typeof Drawer>; | ||
|
||
const meta: Meta<typeof Drawer> = { | ||
title: 'Drawer', | ||
component: Drawer, | ||
parameters: { | ||
viewport: { | ||
defaultViewport: 'tablet', | ||
}, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
|
||
/** | ||
* Default Drawer supplied with only required args. | ||
*/ | ||
export const Default: DrawerStorytype = { | ||
render: args => <Drawer {...args} />, | ||
args: { | ||
children: 'Drawer content will only display on display size of Tablet or smaller', | ||
isVisible: true, | ||
}, | ||
}; | ||
|
||
// export default { | ||
// component: Drawer, | ||
// title: 'Drawer', | ||
// parameters: { | ||
// viewport: { | ||
// defaultViewport: 'tablet', | ||
// }, | ||
// }, | ||
// }; | ||
|
||
// const Template = arguments_ => <Drawer {...arguments_} />; | ||
|
||
// // Default Drawer supplied with only required args | ||
// export const Default = Template.bind({}); | ||
// Default.args = { | ||
// children: 'Drawer content will only display on display size of Tablet or smaller', | ||
// isVisible: true, | ||
// }; | ||
recondesigns marked this conversation as resolved.
Show resolved
Hide resolved
|
File renamed without changes.
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 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
66 changes: 46 additions & 20 deletions
66
...onents/FeaturedJobItem/FeaturedJobItem.js → ...nents/FeaturedJobItem/FeaturedJobItem.tsx
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
18 changes: 0 additions & 18 deletions
18
components/FeaturedJobItem/__stories__/FeaturedJobItem.stories.js
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
components/FeaturedJobItem/__stories__/FeaturedJobItem.stories.tsx
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,25 @@ | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
import { descriptions } from 'common/constants/descriptions'; | ||
import FeaturedJobItem from '../FeaturedJobItem'; | ||
|
||
type FeaturedJobItemStoryType = StoryObj<typeof FeaturedJobItem>; | ||
|
||
const meta: Meta<typeof FeaturedJobItem> = { | ||
title: 'FeaturedJobItem', | ||
component: FeaturedJobItem, | ||
}; | ||
|
||
export default meta; | ||
|
||
/** | ||
* Default FeaturedJobItem supplied with only required args. | ||
*/ | ||
export const Default: FeaturedJobItemStoryType = { | ||
render: args => <FeaturedJobItem {...args} />, | ||
args: { | ||
title: 'Job Title', | ||
source: 'Company Name', | ||
sourceUrl: '#', | ||
description: descriptions.long, | ||
}, | ||
}; |
File renamed without changes.
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There doesn't appear to be a change in the suggestion. Am I missing a tiny detail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are 2 spaces between
bottom-0
andoverflow-hidden
. Perhaps you need to lower the contrast on your monitor?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhhh... I actually did see it, but didn't know what it was. This is merged, should I make that change in one of the other branches I am working?