-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚧 back: wip auto-create subdirectories as required when creating Driv…
…eFile (#714)
- Loading branch information
1 parent
4c05cf9
commit a9e68a3
Showing
7 changed files
with
287 additions
and
13 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
93 changes: 93 additions & 0 deletions
93
...app/components/file-uploads/pending-file-components/pending-upload-jobs-popup.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,93 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
import React from 'react'; | ||
import { ComponentStory } from '@storybook/react'; | ||
// import { PendingUploadJobsPopup } from './pending-upload-jobs-popup'; | ||
|
||
|
||
// Job | ||
|
||
|
||
|
||
import CloseIcon from '@material-ui/icons/CloseOutlined'; | ||
|
||
export const PendingUploadJobsPopupHeader = (props: { | ||
isListingFiles?: boolean, | ||
failuresListing?: string[], | ||
}) => { | ||
return <div className=' | ||
w-full | ||
flex | ||
flex-col | ||
items-center | ||
'> | ||
<div className='whitespace-nowrap font-extrabold text-xl'>Uploads</div> | ||
<div className='whitespace-nowrap'>Currently scanning or something</div> | ||
</div> | ||
}; | ||
|
||
export const PendingUploadJobRow = () => { | ||
return <div className=' | ||
w-full | ||
flex | ||
flex-row | ||
items-center | ||
'> | ||
<div className='whitespace-nowrap flex-shrink' style={{border: '1px solid green'}}> | ||
I'm the header ! | ||
<br /> | ||
Line 2 | ||
</div> | ||
<div style={{border: '1px solid blue'}}> | ||
<CloseIcon className="h-2 w-2" /> | ||
</div> | ||
<div style={{border: '1px solid yellow'}}> | ||
{/* <CloseIcon className="m-icon" /> */} | ||
<CloseIcon />yo | ||
</div> | ||
</div> | ||
}; | ||
|
||
export const PendingUploadJobsPopup = () => { | ||
return <> | ||
<div className=' | ||
bg-slate-200 text-black dark:bg-slate-800 dark:text-white | ||
border-blue-500 border-2 border-b-0 border-solid | ||
max-w-lg absolute z-50 right-10 bottom-0 w-32 | ||
rounded-t-lg | ||
flex | ||
flex-col | ||
'> | ||
<PendingUploadJobsPopupHeader /> | ||
<div className=' | ||
overflow-y-scroll | ||
max-h-14 | ||
flex-col | ||
'> | ||
<PendingUploadJobRow /> | ||
<PendingUploadJobRow /> | ||
<PendingUploadJobRow /> | ||
<PendingUploadJobRow /> | ||
<PendingUploadJobRow /> | ||
</div> | ||
</div> | ||
</>; | ||
}; | ||
|
||
|
||
|
||
|
||
|
||
export default { | ||
//title: '@atoms/pending-upload-jobs-popup', //TODO NONONO | ||
component: PendingUploadJobsPopup, | ||
}; | ||
|
||
|
||
const Template: ComponentStory<typeof PendingUploadJobsPopup> = PendingUploadJobsPopup; | ||
|
||
export const Base = Template.bind({}); | ||
// Base.play = () => { | ||
// // setTimeout(() => window.alert("hi"), 1000) | ||
// } | ||
Base.args = { | ||
}; |
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
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,15 @@ | ||
/** | ||
* Sort the provided `array` by using the `getter` on each item to return a value, which | ||
* is compared in a way that humans find natural (case and diacritic insensitive, ordinal | ||
* for numeric segments) | ||
*/ | ||
export function sortNaturally(array: string[]): string[]; | ||
export function sortNaturally<TElement>(array: TElement[], getter: (x: TElement) => string): TElement[]; | ||
export function sortNaturally<TElement>(array: TElement[], getter?: (x: TElement) => string): TElement[] { | ||
const get = getter ?? ((x) => x as string); | ||
array.sort((a, b) => get(a).localeCompare(get(b), undefined, { | ||
numeric: true, | ||
sensitivity: 'base' | ||
})); | ||
return array; | ||
} |