-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(storage-browser): integrate browser navigation
- Loading branch information
1 parent
1169805
commit 7df9f79
Showing
109 changed files
with
1,002 additions
and
1,896 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
27 changes: 27 additions & 0 deletions
27
packages/react-storage/src/components/StorageBrowser/ComponentsProvider.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,27 @@ | ||
import React from 'react'; | ||
|
||
import { ElementsProvider } from '@aws-amplify/ui-react-core/elements'; | ||
|
||
import { ComposablesProvider } from './composables/context'; | ||
import { ComposableTypes as Composables } from './composables/types'; | ||
import { StorageBrowserElements } from './context/elements'; | ||
|
||
export interface ComponentsProviderProps { | ||
children?: React.ReactNode; | ||
// temp disablng of linting rule to note where `components`/"slots" context is provided | ||
// eslint-disable-next-line react/no-unused-prop-types | ||
components?: Composables; | ||
elements?: Partial<StorageBrowserElements>; | ||
} | ||
|
||
export function ComponentsProvider( | ||
props: ComponentsProviderProps | ||
): React.JSX.Element { | ||
const { children, elements } = props; | ||
|
||
return ( | ||
<ElementsProvider elements={elements}> | ||
<ComposablesProvider>{children}</ComposablesProvider> | ||
</ElementsProvider> | ||
); | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...ages/react-storage/src/components/StorageBrowser/__tests__/StorageBrowserDefault.spec.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
2 changes: 1 addition & 1 deletion
2
packages/react-storage/src/components/StorageBrowser/__tests__/createStorageBrowser.spec.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
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
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
10 changes: 1 addition & 9 deletions
10
packages/react-storage/src/components/StorageBrowser/actions/handlers/listLocations.ts
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
15 changes: 15 additions & 0 deletions
15
packages/react-storage/src/components/StorageBrowser/actions/handlers/types.ts
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 @@ | ||
import { ListLocations, Permission } from '../../storage-internal'; | ||
|
||
export type LocationAccess = Awaited< | ||
ReturnType<ListLocations> | ||
>['locations'][number]; | ||
|
||
export type LocationType = 'OBJECT' | 'PREFIX' | 'BUCKET'; | ||
|
||
export interface LocationData { | ||
bucket: string; | ||
id: string; | ||
permission: Permission; | ||
prefix: string; | ||
type: LocationType; | ||
} |
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.