From 2e565fd95bd55ea04a5020d6098e9d298550949d Mon Sep 17 00:00:00 2001 From: Franco Montenegro Date: Mon, 20 Jun 2022 13:59:56 -0300 Subject: [PATCH 01/10] Fix splash error message when the app can't initialize. (#7615) --- ui/component/splash/view.jsx | 10 +++++++--- ui/scss/component/_splash.scss | 7 +++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ui/component/splash/view.jsx b/ui/component/splash/view.jsx index 6d6c5459c..1dc5a2e6f 100644 --- a/ui/component/splash/view.jsx +++ b/ui/component/splash/view.jsx @@ -241,8 +241,12 @@ export default class SplashScreen extends React.PureComponent { return (
-

LBRY

-
{details}
+ {!error && ( + <> +

LBRY

+
{details}
+ + )} {!animationHidden && !error && ( @@ -290,7 +294,7 @@ export default class SplashScreen extends React.PureComponent { )} {error && ( {__('Error starting up')}} subtitle={

diff --git a/ui/scss/component/_splash.scss b/ui/scss/component/_splash.scss index 56cedbde3..88aaa03f4 100644 --- a/ui/scss/component/_splash.scss +++ b/ui/scss/component/_splash.scss @@ -28,6 +28,13 @@ margin-top: -1rem; } +.splash__error-title { + font-size: 22px; + line-height: 1; + font-weight: var(--font-weight-bold); + color: #fff; +} + .splash__animation-toggle { position: fixed; top: var(--spacing-l); -- 2.45.3 From 6ea7fb08d95104960413b689e33679720e200b92 Mon Sep 17 00:00:00 2001 From: ByronEricPerez Date: Mon, 20 Jun 2022 18:57:50 -0300 Subject: [PATCH 02/10] fix hover style for char count field --- ui/scss/component/_button.scss | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ui/scss/component/_button.scss b/ui/scss/component/_button.scss index a8cfd3b36..c3609fbe3 100644 --- a/ui/scss/component/_button.scss +++ b/ui/scss/component/_button.scss @@ -350,6 +350,8 @@ a.button--alt { background-color: transparent; margin-right: var(--spacing-m); padding: 0 var(--spacing-xxs); + height: initial; + padding: 5px; &.button--file-action-active { .icon { @@ -378,9 +380,6 @@ a.button--alt { } &:hover { - .icon { - stroke: var(--color-link); - } .button__label { color: var(--color-link); } -- 2.45.3 From 72be88d30d72ee149759e923bc9923ad5d3fd09d Mon Sep 17 00:00:00 2001 From: ByronEricPerez Date: Wed, 22 Jun 2022 15:37:28 -0300 Subject: [PATCH 03/10] vertically align character counter and emoji button --- ui/scss/component/_form-field.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/scss/component/_form-field.scss b/ui/scss/component/_form-field.scss index 0f5d9e8dd..d47cedb84 100644 --- a/ui/scss/component/_form-field.scss +++ b/ui/scss/component/_form-field.scss @@ -547,7 +547,7 @@ fieldset-group { text-align: right; span { - display: inline-block; + vertical-align: super; padding-right: 0px; } } -- 2.45.3 From 8c10617259cfd35edc7ddc04e7e3da5a80aa506c Mon Sep 17 00:00:00 2001 From: Franco Montenegro Date: Tue, 28 Jun 2022 12:25:20 -0300 Subject: [PATCH 04/10] Use a retry counter/limit to fetch thumbnails. (#7618) --- ui/component/channelThumbnail/view.jsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ui/component/channelThumbnail/view.jsx b/ui/component/channelThumbnail/view.jsx index cc293a458..b1c8e8e1d 100644 --- a/ui/component/channelThumbnail/view.jsx +++ b/ui/component/channelThumbnail/view.jsx @@ -50,6 +50,7 @@ function ChannelThumbnail(props: Props) { setThumbUploadError, ThumbUploadError, } = props; + const [retries, setRetries] = React.useState(3); const [thumbLoadError, setThumbLoadError] = React.useState(ThumbUploadError); const shouldResolve = !isResolving && claim === undefined; const thumbnail = rawThumbnail && rawThumbnail.trim().replace(/^http:\/\//i, 'https://'); @@ -58,6 +59,15 @@ function ChannelThumbnail(props: Props) { const channelThumbnail = thumbnailPreview || thumbnail || defaultAvatar; const isGif = channelThumbnail && channelThumbnail.endsWith('gif'); const showThumb = (!obscure && !!thumbnail) || thumbnailPreview; + const avatarSrc = React.useMemo(() => { + if (retries <= 0) { + return defaultAvatar; + } + if (!thumbLoadError) { + return channelThumbnail; + } + return defaultAvatar; + }, [retries, thumbLoadError, channelThumbnail, defaultAvatar]); // Generate a random color class based on the first letter of the channel name const { channelName } = parseURI(uri); @@ -100,9 +110,10 @@ function ChannelThumbnail(props: Props) { { + setRetries((retries) => retries - 1); if (setThumbUploadError) { setThumbUploadError(true); } else { -- 2.45.3 From c7ab47f54d65e63791ee33e05e565204afa4a782 Mon Sep 17 00:00:00 2001 From: Byron Eric Perez <89370060+ByronEricPerez@users.noreply.github.com> Date: Tue, 28 Jun 2022 16:49:41 -0300 Subject: [PATCH 05/10] use default path in windows when choosing a file (#7625) * use default path in windows when choosing a file * fix, changed var to let --- ui/component/common/file-selector.jsx | 25 +++++++++++++++++++++++-- ui/component/publishFile/view.jsx | 1 + 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/ui/component/common/file-selector.jsx b/ui/component/common/file-selector.jsx index fda7b11d7..bd1729d31 100644 --- a/ui/component/common/file-selector.jsx +++ b/ui/component/common/file-selector.jsx @@ -47,7 +47,24 @@ class FileSelector extends React.PureComponent { }; handleDirectoryInputSelection = () => { - remote.dialog.showOpenDialog({ properties: ['openDirectory'] }).then((result) => { + let defaultPath; + let properties; + let isWin = process.platform === 'win32'; + let type = this.props.type; + + if (isWin === true) { + defaultPath = process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE; + } + + if (type === 'openFile') { + properties = ['openFile']; + } + + if (type === 'openDirectory') { + properties = ['openDirectory']; + } + + remote.dialog.showOpenDialog({ properties, defaultPath }).then((result) => { const path = result && result.filePaths[0]; if (path) { // $FlowFixMe @@ -82,7 +99,11 @@ class FileSelector extends React.PureComponent { autoFocus={autoFocus} button="primary" disabled={disabled} - onClick={type === 'openDirectory' ? this.handleDirectoryInputSelection : this.fileInputButton} + onClick={ + type === 'openDirectory' || type === 'openFile' + ? this.handleDirectoryInputSelection + : this.fileInputButton + } label={__('Browse')} /> } diff --git a/ui/component/publishFile/view.jsx b/ui/component/publishFile/view.jsx index cc57aca89..b53b7720c 100644 --- a/ui/component/publishFile/view.jsx +++ b/ui/component/publishFile/view.jsx @@ -325,6 +325,7 @@ function PublishFile(props: Props) { {showFileUpload && ( <> Date: Tue, 28 Jun 2022 17:01:19 -0300 Subject: [PATCH 06/10] Added checkbox to enable/disable background (#7630) * Added checkbox to enable/disable background * bug fix in enable disable button * small fix in translation * rename background setting to be disable backgroud; add default value for background setting. --- static/app-strings.json | 2 ++ ui/component/settingAppearance/index.js | 1 + ui/component/settingAppearance/view.jsx | 11 ++++++++++- ui/component/wallpaper/index.js | 20 ++++++++------------ ui/component/wallpaper/view.jsx | 6 ++++-- ui/constants/settings.js | 1 + ui/redux/reducers/settings.js | 1 + 7 files changed, 27 insertions(+), 15 deletions(-) diff --git a/static/app-strings.json b/static/app-strings.json index 6576939b8..61bdbd0bd 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -2312,5 +2312,7 @@ "Free --[legend, unused disk space]--": "Free", "Top content in %language%": "Top content in %language%", "Apply": "Apply", + "24-hour clock": "24-hour clock", + "Disable background": "Disable background", "--end--": "--end--" } diff --git a/ui/component/settingAppearance/index.js b/ui/component/settingAppearance/index.js index 45d1b44e8..7b3f9c2fa 100644 --- a/ui/component/settingAppearance/index.js +++ b/ui/component/settingAppearance/index.js @@ -5,6 +5,7 @@ import { makeSelectClientSetting } from 'redux/selectors/settings'; import SettingAppearance from './view'; const select = (state) => ({ + disableBackground: makeSelectClientSetting(SETTINGS.DISABLE_BACKGROUND)(state), clock24h: makeSelectClientSetting(SETTINGS.CLOCK_24H)(state), searchInLanguage: makeSelectClientSetting(SETTINGS.SEARCH_IN_LANGUAGE)(state), hideBalance: makeSelectClientSetting(SETTINGS.HIDE_BALANCE)(state), diff --git a/ui/component/settingAppearance/view.jsx b/ui/component/settingAppearance/view.jsx index 9425ec436..2065a5c7e 100644 --- a/ui/component/settingAppearance/view.jsx +++ b/ui/component/settingAppearance/view.jsx @@ -12,6 +12,7 @@ import ThemeSelector from 'component/themeSelector'; import homepages from 'homepages'; type Props = { + disableBackground: boolean, clock24h: boolean, searchInLanguage: boolean, hideBalance: boolean, @@ -20,7 +21,7 @@ type Props = { }; export default function SettingAppearance(props: Props) { - const { clock24h, searchInLanguage, hideBalance, setClientSetting, setSearchInLanguage } = props; + const { clock24h, disableBackground, searchInLanguage, hideBalance, setClientSetting, setSearchInLanguage } = props; return ( <> @@ -63,6 +64,14 @@ export default function SettingAppearance(props: Props) { checked={clock24h} /> + + setClientSetting(SETTINGS.DISABLE_BACKGROUND, !disableBackground)} + checked={disableBackground} + /> + { - if (props.uri && (props.uri.indexOf('@') !== -1 || props.uri.indexOf('#') !== -1)) { - return { - cover: makeSelectCoverForUri(props.uri)(state), - avatar: makeSelectAvatarForUri(props.uri)(state), - }; - } else return {}; -}; -*/ +const select = (state) => ({ + disableBackground: makeSelectClientSetting(SETTINGS.DISABLE_BACKGROUND)(state), +}); -export default connect()(Wallpaper); +const perform = {}; + +export default connect(select, perform)(Wallpaper); diff --git a/ui/component/wallpaper/view.jsx b/ui/component/wallpaper/view.jsx index 3b21a735f..8fd610165 100644 --- a/ui/component/wallpaper/view.jsx +++ b/ui/component/wallpaper/view.jsx @@ -8,10 +8,11 @@ type Props = { // cover: ?string, // avatar: ?string, reset: ?boolean, + disableBackground: ?boolean, }; const Wallpaper = (props: Props) => { - // const { cover, avatar } = props; + const { disableBackground } = props; /* if (avatar) { @@ -227,12 +228,13 @@ const Wallpaper = (props: Props) => { }} /> */ + return ( <>

diff --git a/ui/constants/settings.js b/ui/constants/settings.js index a56b28fc3..9121f71bc 100644 --- a/ui/constants/settings.js +++ b/ui/constants/settings.js @@ -14,6 +14,7 @@ export const THEME = 'theme'; export const THEMES = 'themes'; export const AUTOMATIC_DARK_MODE_ENABLED = 'automatic_dark_mode_enabled'; export const CLOCK_24H = 'clock_24h'; +export const DISABLE_BACKGROUND = 'disableBackground'; export const AUTOPLAY_MEDIA = 'autoplay'; export const AUTOPLAY_NEXT = 'autoplay_next'; export const OS_NOTIFICATIONS_ENABLED = 'os_notifications_enabled'; diff --git a/ui/redux/reducers/settings.js b/ui/redux/reducers/settings.js index 36e6250db..f82faf6f6 100644 --- a/ui/redux/reducers/settings.js +++ b/ui/redux/reducers/settings.js @@ -40,6 +40,7 @@ const defaultState = { [SETTINGS.OS_NOTIFICATIONS_ENABLED]: true, [SETTINGS.AUTOMATIC_DARK_MODE_ENABLED]: false, [SETTINGS.CLOCK_24H]: false, + [SETTINGS.DISABLE_BACKGROUND]: false, [SETTINGS.TILE_LAYOUT]: true, [SETTINGS.VIDEO_THEATER_MODE]: false, [SETTINGS.VIDEO_PLAYBACK_RATE]: 1, -- 2.45.3 From 8a163e0f02c99422915756a59f8fc5df07269140 Mon Sep 17 00:00:00 2001 From: ByronEricPerez Date: Thu, 30 Jun 2022 16:54:56 -0300 Subject: [PATCH 07/10] add new comment icon class --- .../common/form-components/form-field.jsx | 2 +- ui/scss/component/_button.scss | 47 ++++++++++++++++++- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/ui/component/common/form-components/form-field.jsx b/ui/component/common/form-components/form-field.jsx index ebcf4e718..438ed23f6 100644 --- a/ui/component/common/form-components/form-field.jsx +++ b/ui/component/common/form-components/form-field.jsx @@ -261,7 +261,7 @@ export class FormField extends React.PureComponent { {!noEmojis && openEmoteMenu && (