Skip to content
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

Media files collection block mobile #26721

Merged
merged 34 commits into from
Nov 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d6f2950
updated initial example html content file with story block
mzorz Sep 4, 2020
277bc2c
adding method requestStoryCreatorLoad() to the bridge
mzorz Sep 10, 2020
fffdf0f
added new interface OnStoryCreatorRequestListener
mzorz Sep 10, 2020
2c40df2
passing mediaFiles and blockId over the bridge in requestStoryCreator…
mzorz Sep 11, 2020
f2019a6
Merge branch 'master' into try/jetpack-stories-block-mobile
mzorz Sep 15, 2020
ad41130
fixed merge conflict
mzorz Oct 1, 2020
696fe16
prettier fix
mzorz Oct 1, 2020
5a7c8d9
added gray-700 color, missing if not after retiring and changes made …
mzorz Oct 1, 2020
bdc9f38
Merge branch 'master' into try/jetpack-stories-block-mobile
mzorz Oct 8, 2020
71e5d6d
removed jetpack stories example block from initial demo load
mzorz Oct 9, 2020
66c15e3
Mobile Stories block (part2: on done) (#25771)
mzorz Oct 14, 2020
888ff95
Update packages/block-editor/src/components/block-media-update-progre…
mzorz Oct 14, 2020
0afbbb8
updated with master and fixed merge conflicts
mzorz Oct 14, 2020
6445611
Merge branch 'try/jetpack-stories-block-mobile' of https://github.com…
mzorz Oct 14, 2020
ca9392d
using array.some() to find element in array
mzorz Oct 15, 2020
bc0c442
prettified function call
mzorz Oct 15, 2020
0283500
removed commented code
mzorz Oct 15, 2020
62bc5a5
Merge branch 'master' into try/jetpack-stories-block-mobile
mzorz Oct 16, 2020
3f0c632
Merge branch 'master' into try/jetpack-stories-block-mobile
mzorz Oct 16, 2020
d10e5d0
Media Files Collection (part4: error handling) (#26008)
mzorz Oct 22, 2020
26165d1
[RNMobile] added jetpack node_modules folder to cleanup step in JSbun…
mzorz Oct 23, 2020
0d847d7
Mobile Stories block - unit tests for BlockMediaUpdateProgress (#26423)
mzorz Oct 28, 2020
5ea6a7e
Mobile stories block: hide behind feature flag (#26522)
mzorz Oct 30, 2020
8c69756
Merge branch 'master' into try/jetpack-stories-block-mobile
mzorz Nov 2, 2020
08e77ba
added Jdoc descriptions
mzorz Nov 4, 2020
094cf0b
Merge branch 'master' into try/jetpack-stories-block-mobile
mzorz Nov 4, 2020
6b651f2
Merge branch 'master' into try/jetpack-stories-block-mobile
mzorz Nov 4, 2020
7b14d3a
Merge branch 'master' into try/media-files-collection-block-mobile
mzorz Nov 5, 2020
b7a9918
[RNMobile] iOS side of bridge for media collection blocks (#26704)
etoledom Nov 6, 2020
04ff0d1
Merge remote-tracking branch 'origin/master' into try/media-files-col…
etoledom Nov 6, 2020
6caae6e
Merge branch 'master' into try/media-files-collection-block-mobile
mzorz Nov 6, 2020
c1c614e
Merge branch 'master' into try/media-files-collection-block-mobile
mzorz Nov 6, 2020
bb5c840
Merge branch 'master' into try/media-files-collection-block-mobile
mzorz Nov 6, 2020
6208db2
Merge branch 'master' into try/media-files-collection-block-mobile
mzorz Nov 9, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/base-styles/_colors.native.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ $gray: #87a6bc;
$gray-light: lighten($gray, 33%); //#f3f6f8
$gray-dark: darken($gray, 38%); //#2e4453
$gray-900: #1a1a1a;
$gray-700: #757575;

// $gray-text: ideal for standard, non placeholder text
// $gray-text-min: minimum contrast needed for WCAG 2.0 AA on white background
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
BlockMediaUpdateProgress
===================

`BlockMediaUpdateProgress` shows a progress bar while the media files associated with a media-containing block are being saved first and uploaded later

## Usage

Usage example

```jsx
import { ImageBackground, Text, View } from 'react-native';
import {
BlockMediaUpdateProgress,
} from '@wordpress/block-editor';

function BlockUpdatingProgress( { url, id } ) {
return (
<BlockMediaUpdateProgress
mediaId={ id }
renderContent={ ( { isSaveFailed, retryMessage } ) => {
return (
<ImageBackground
resizeMethod="scale"
source={ { uri: url } }
>
{ isSaveFailed &&
<View>
<Text>{ retryMessage }</Text>
</View>
}
</ImageBackground>
);
} }
/>
);
}
```

## Props

### mediaFiles

A collection of media ID that identifies the current collection of files represented in this media container block.

- Type: `Array`
- Required: Yes
- Platform: Mobile

### renderContent

Content to be rendered along with the progress bar, usually the thumbnail of the media being uploaded.

- Type: `React components`
- Required: Yes
- Platform: Mobile

It passes an object containing the following properties:

`{ isUploadInProgress, isUploadFailed, isSaveInProgress, isSaveFailed, retryMessage }`

### onUpdateMediaProgress

Callback called when the progress of the upload is updated.

- Type: `Function`
- Required: No
- Platform: Mobile

The argument of the callback is an object containing the following properties:

`{ mediaId, mediaUrl, progress, state }`

### onFinishMediaUploadWithSuccess

Callback called when the media file has been uploaded successfully.

- Type: `Function`
- Required: No
- Platform: Mobile

The argument of the callback is an object containing the following properties:

`{ mediaId, mediaServerId, mediaUrl, progress, state }`

### onFinishMediaUploadWithFailure

Callback called when the media file couldn't be uploaded.

- Type: `Function`
- Required: No
- Platform: Mobile

The argument of the callback is an object containing the following properties:

`{ mediaId, progress, state }`


### onMediaUploadStateReset

Callback called when the media upload is reset

- Type: `Function`
- Required: No
- Platform: Mobile
Loading