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

feat: Update Image block failed upload visuals #56937

Merged
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
62191f5
refactor: Rename `useIsConnected` to `useNetworkConnectivity`
dcalhoun Dec 14, 2023
1af5f0e
test: Add `useNetworkConnectivity` Hook tests
dcalhoun Dec 14, 2023
25d141a
docs: Document `useNetworkConnectivity` Hook
dcalhoun Dec 14, 2023
ddc08b8
refactor: Rename `withIsConnected` to `withNetworkConnectivity`
dcalhoun Dec 14, 2023
f7bccf5
fix: Optimistically presume network connectivity
dcalhoun Dec 14, 2023
59995b3
test: Create realistic default `requestConnectionStatus` mock
dcalhoun Dec 14, 2023
30bf2a0
fix: Prevent duplicative offline status indicators
dcalhoun Dec 16, 2023
cb7e168
Add subscribeConnectionStatus to MediaUploadProgress component
derekblank Dec 11, 2023
1ce863f
Update MediaUploadProgress to use withIsConnected HOC
derekblank Dec 12, 2023
c223aa8
refactor: Fix HoC name reference
dcalhoun Dec 20, 2023
22e5851
refactor: Enable Fast Refresh for Image component
dcalhoun Dec 21, 2023
cdae407
feat: Update the image offline message
dcalhoun Dec 21, 2023
dd4e5db
refactor: Avoid unnecessary inconsistency in switch case logic
dcalhoun Dec 21, 2023
070979a
refactor: Enable Fast Refresh for Image component
dcalhoun Dec 21, 2023
533a348
feat: Revert logic intended to display progress bar when offline
dcalhoun Dec 21, 2023
4e92330
refactor: Remove sizing from offline SVG
dcalhoun Dec 21, 2023
ec9f1a0
feat: Update Image block media upload visuals
dcalhoun Dec 21, 2023
4938a1e
feat: Add paused media upload state
dcalhoun Dec 22, 2023
a5d533d
Merge branch 'trunk' into rnmobile/media-upload-progress-connection-s…
derekblank Dec 28, 2023
a66e3ae
feat: Scope the paused upload state to the Image block
dcalhoun Jan 2, 2024
4927d9f
feat: Enable paused media uploads for Media and Text block types
dcalhoun Jan 2, 2024
210b43f
perf: Avoid unnecessary state updates and callback invocations
dcalhoun Jan 2, 2024
21aa5a5
Add MEDIA_UPLOAD_STATE_PAUSED to Android DeferredEvent emitter
derekblank Jan 3, 2024
9db9142
feat: Add Android paused media upload bridge methods
dcalhoun Jan 3, 2024
8c441f8
Merge branch 'trunk' of github.com:WordPress/gutenberg into rnmobile/…
dcalhoun Jan 4, 2024
96b7c0c
docs: Add change log entry
dcalhoun Jan 4, 2024
6b6600f
feat: Add image upload failure dark mode styles
dcalhoun Jan 4, 2024
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
Prev Previous commit
Next Next commit
refactor: Avoid unnecessary inconsistency in switch case logic
Replace early return with logic mirroring the rest of the switch case
statements. While I suppose it could be considered subjective, it is
odd and confusing that one of the three cases was structured
differently.
  • Loading branch information
dcalhoun committed Dec 21, 2023
commit dd4e5db8b1588e2172c321642440c9ce4860900c
14 changes: 7 additions & 7 deletions packages/components/src/mobile/image/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import FastImage from 'react-native-fast-image';
*/
import { __ } from '@wordpress/i18n';
import { Icon } from '@wordpress/components';
import { image as icon } from '@wordpress/icons';
import { image } from '@wordpress/icons';
import { usePreferredColorSchemeStyle } from '@wordpress/compose';
import { useEffect, useState, Platform } from '@wordpress/element';

Expand Down Expand Up @@ -99,19 +99,19 @@ const ImageComponent = ( {
};

const getIcon = ( iconType ) => {
let icon;
let iconStyle;
switch ( iconType ) {
case ICON_TYPE.RETRY:
return (
<Icon
icon={ retryIcon || SvgIconRetry }
{ ...styles.iconRetry }
/>
);
icon = retryIcon || SvgIconRetry;
iconStyle = styles.iconRetry;
break;
case ICON_TYPE.PLACEHOLDER:
icon = image;
iconStyle = iconPlaceholderStyles;
break;
case ICON_TYPE.UPLOAD:
icon = image;
iconStyle = iconUploadStyles;
break;
}
Expand Down