From 03de4c4fea945e03cc9a17476c15d7f7fcfa8af0 Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Wed, 29 Apr 2020 18:32:49 -0400 Subject: [PATCH] Progress --- app/javascript/gabsocial/actions/search.js | 8 +- app/javascript/gabsocial/assets/error_icon.js | 2 +- .../gabsocial/assets/explore_icon.js | 39 ++++ app/javascript/gabsocial/assets/gab_logo.js | 7 +- app/javascript/gabsocial/assets/globe_icon.js | 1 - .../gabsocial/assets/loading_icon.js | 16 +- .../gabsocial/components/account.js | 41 +++-- .../components/autosuggest_textbox.js | 8 +- app/javascript/gabsocial/components/block.js | 2 +- app/javascript/gabsocial/components/button.js | 40 ++-- .../gabsocial/components/column_header.js | 6 +- .../gabsocial/components/comment.js | 4 +- .../gabsocial/components/composer.js | 4 +- .../gabsocial/components/display_name.js | 16 +- .../components/group_collection_item.js | 10 +- .../gabsocial/components/group_list_item.js | 48 ++--- .../gabsocial/components/hashtag_item.js | 6 +- .../gabsocial/components/heading.js | 10 +- app/javascript/gabsocial/components/icon.js | 2 + app/javascript/gabsocial/components/image.js | 2 +- app/javascript/gabsocial/components/input.js | 12 +- app/javascript/gabsocial/components/list.js | 2 +- .../gabsocial/components/list_item.js | 6 +- .../gabsocial/components/media_gallery.js | 4 +- .../gabsocial/components/media_item.js | 4 +- .../gabsocial/components/modal/embed_modal.js | 2 +- .../modal/group_timeline_settings_modal.js | 2 +- .../gabsocial/components/modal/modal_base.js | 2 +- .../components/modal/pro_upgrade_modal.js | 2 +- .../gabsocial/components/navigation_bar.js | 135 +++++++++++--- .../gabsocial/components/notification.js | 4 +- .../components/panel/group_info_panel.js | 2 +- .../components/panel/groups_panel.js | 40 ++-- .../components/panel/list_details_panel.js | 2 +- .../gabsocial/components/panel/lists_panel.js | 11 +- .../components/panel/media_gallery_panel.js | 30 +-- .../components/panel/panel_layout.js | 2 +- .../components/panel/profile_info_panel.js | 2 +- .../components/panel/progress_panel.js | 35 +++- .../components/panel/trends_panel.js | 46 ++--- .../gabsocial/components/panel/user_panel.js | 29 +-- .../gabsocial/components/pill_item.js | 96 ++++++++++ app/javascript/gabsocial/components/pills.js | 34 ++++ app/javascript/gabsocial/components/poll.js | 10 +- .../popover/status_visibility_popover.js | 6 +- .../gabsocial/components/profile_header.js | 174 +++++++++--------- .../gabsocial/components/progress_bar.js | 16 +- .../components/rich_text_editor_bar.js | 6 +- app/javascript/gabsocial/components/search.js | 103 +++++++---- app/javascript/gabsocial/components/select.js | 2 +- .../components/sensitive_media_item.js | 4 +- .../gabsocial/components/sidebar.js | 44 +++-- .../gabsocial/components/sidebar_header.js | 57 ------ .../components/sidebar_section_item.js | 14 +- .../components/sidebar_section_title.js | 2 +- app/javascript/gabsocial/components/status.js | 5 +- .../gabsocial/components/status_action_bar.js | 30 +-- .../components/status_action_bar_item.js | 2 +- .../gabsocial/components/status_card.js | 20 +- .../gabsocial/components/status_content.js | 4 +- .../gabsocial/components/status_header.js | 4 +- .../gabsocial/components/status_prepend.js | 2 +- app/javascript/gabsocial/components/switch.js | 8 +- .../gabsocial/components/tab_bar.js | 1 - .../gabsocial/components/tab_bar_item.js | 28 +-- app/javascript/gabsocial/components/text.js | 10 +- .../gabsocial/components/textarea.js | 9 +- .../components/timeline_compose_block.js | 2 +- .../gabsocial/components/trends_item.js | 68 +++---- .../gabsocial/components/upload_area.js | 4 +- app/javascript/gabsocial/components/video.js | 22 +-- app/javascript/gabsocial/constants.js | 4 + .../gabsocial/containers/status_container.js | 8 +- .../components/compose_extra_button.js | 8 +- .../compose/components/compose_form.js | 4 +- .../features/compose/components/poll_form.js | 2 +- .../gabsocial/features/followers.js | 2 +- .../gabsocial/features/following.js | 2 +- .../gabsocial/features/list_timeline.js | 5 +- .../gabsocial/features/lists_directory.js | 6 +- app/javascript/gabsocial/features/search.js | 117 ++++++++---- app/javascript/gabsocial/features/status.js | 12 ++ app/javascript/gabsocial/features/ui/ui.js | 6 +- .../features/ui/util/async_components.js | 1 + app/javascript/gabsocial/layouts/layout.js | 121 +++++------- .../gabsocial/layouts/profile_layout.js | 54 +++--- .../gabsocial/layouts/settings_layout.js | 4 +- app/javascript/gabsocial/pages/groups_page.js | 4 +- app/javascript/gabsocial/pages/search_page.js | 4 - .../gabsocial/reducers/group_lists.js | 1 + app/javascript/styles/global.css | 113 +++++++----- app/services/search_service.rb | 8 +- 92 files changed, 1132 insertions(+), 787 deletions(-) create mode 100644 app/javascript/gabsocial/assets/explore_icon.js create mode 100644 app/javascript/gabsocial/components/pill_item.js create mode 100644 app/javascript/gabsocial/components/pills.js delete mode 100644 app/javascript/gabsocial/components/sidebar_header.js create mode 100644 app/javascript/gabsocial/features/status.js diff --git a/app/javascript/gabsocial/actions/search.js b/app/javascript/gabsocial/actions/search.js index b670d25c..29e28fd1 100644 --- a/app/javascript/gabsocial/actions/search.js +++ b/app/javascript/gabsocial/actions/search.js @@ -41,14 +41,20 @@ export function submitSearch() { }).then(response => { if (response.data.accounts) { dispatch(importFetchedAccounts(response.data.accounts)); + dispatch(fetchRelationships(response.data.accounts.map(item => item.id))); } if (response.data.statuses) { dispatch(importFetchedStatuses(response.data.statuses)); } + console.log("response.data.", response.data) + + // if (response.data.groups) { + // dispatch(importFetchedStatuses(response.data.statuses)); + // } + dispatch(fetchSearchSuccess(response.data)); - dispatch(fetchRelationships(response.data.accounts.map(item => item.id))); }).catch(error => { dispatch(fetchSearchFail(error)); }); diff --git a/app/javascript/gabsocial/assets/error_icon.js b/app/javascript/gabsocial/assets/error_icon.js index d562fa26..09dfd68c 100644 --- a/app/javascript/gabsocial/assets/error_icon.js +++ b/app/javascript/gabsocial/assets/error_icon.js @@ -1,5 +1,5 @@ const ErrorIcon = ({ - className = _s.fillColorPrimary, + className = _s.fillPrimary, size = '32px', title = 'Error', }) => ( diff --git a/app/javascript/gabsocial/assets/explore_icon.js b/app/javascript/gabsocial/assets/explore_icon.js new file mode 100644 index 00000000..3bd70934 --- /dev/null +++ b/app/javascript/gabsocial/assets/explore_icon.js @@ -0,0 +1,39 @@ +const ExploreIcon = ({ + className = '', + size = '12px', + title = 'Explore', +}) => ( + + + + + + + + + + + + + + + + + + + + +) + +export default ExploreIcon diff --git a/app/javascript/gabsocial/assets/gab_logo.js b/app/javascript/gabsocial/assets/gab_logo.js index db26a01a..b462c141 100644 --- a/app/javascript/gabsocial/assets/gab_logo.js +++ b/app/javascript/gabsocial/assets/gab_logo.js @@ -1,6 +1,5 @@ const GabLogo = ({ - className = _s.fillColorBrand, - size = '50px', + className = _s.fillBrand, }) => ( diff --git a/app/javascript/gabsocial/assets/globe_icon.js b/app/javascript/gabsocial/assets/globe_icon.js index ee5f1d44..f517d46b 100644 --- a/app/javascript/gabsocial/assets/globe_icon.js +++ b/app/javascript/gabsocial/assets/globe_icon.js @@ -1,4 +1,3 @@ -// : todo : fill, stroke colors const GlobeIcon = ({ className = '', size = '12px', diff --git a/app/javascript/gabsocial/assets/loading_icon.js b/app/javascript/gabsocial/assets/loading_icon.js index 5b403151..4a86ed0a 100644 --- a/app/javascript/gabsocial/assets/loading_icon.js +++ b/app/javascript/gabsocial/assets/loading_icon.js @@ -13,7 +13,7 @@ const LoadingIcon = ({ > - + @@ -21,7 +21,7 @@ const LoadingIcon = ({ - + @@ -29,7 +29,7 @@ const LoadingIcon = ({ - + @@ -37,7 +37,7 @@ const LoadingIcon = ({ - + @@ -45,7 +45,7 @@ const LoadingIcon = ({ - + @@ -53,7 +53,7 @@ const LoadingIcon = ({ - + @@ -61,7 +61,7 @@ const LoadingIcon = ({ - + @@ -69,7 +69,7 @@ const LoadingIcon = ({ - + diff --git a/app/javascript/gabsocial/components/account.js b/app/javascript/gabsocial/components/account.js index 707d07a8..b0bec958 100644 --- a/app/javascript/gabsocial/components/account.js +++ b/app/javascript/gabsocial/components/account.js @@ -115,6 +115,7 @@ class Account extends ImmutablePureComponent { expanded, dismissAction, showDismiss, + withBio, } = this.props if (!account) return null @@ -148,13 +149,15 @@ class Account extends ImmutablePureComponent { onClick={dismissAction} icon='close' iconSize='8px' - iconClassName={_s.fillColorSecondary} + iconClassName={_s.fillSecondary} /> ) + const content = { __html: account.get('note_emojified') } + return ( -
-
+
+
- - - {!compact && actionButton} - +
+
+ + + {!compact && actionButton} + -
- {dismissBtn} - {compact && actionButton} +
+ {dismissBtn} + {compact && actionButton} +
+
+ + { + withBio && +
+ }
-
) diff --git a/app/javascript/gabsocial/components/autosuggest_textbox.js b/app/javascript/gabsocial/components/autosuggest_textbox.js index 26285d0e..04ed5dd9 100644 --- a/app/javascript/gabsocial/components/autosuggest_textbox.js +++ b/app/javascript/gabsocial/components/autosuggest_textbox.js @@ -233,12 +233,12 @@ export default class AutosuggestTextbox extends ImmutablePureComponent { text: 1, displayBlock: 1, outlineNone: 1, - backgroundColorPrimary: !small, - backgroundColorSubtle: small, + bgPrimary: !small, + bgSubtle: small, py15: !small, py10: small, - fontSize16PX: !small, - fontSize14PX: small, + fs16PX: !small, + fs14PX: small, mr5: small, }) diff --git a/app/javascript/gabsocial/components/block.js b/app/javascript/gabsocial/components/block.js index 72e695f6..b95f2891 100644 --- a/app/javascript/gabsocial/components/block.js +++ b/app/javascript/gabsocial/components/block.js @@ -11,7 +11,7 @@ export default class Block extends PureComponent { const { children } = this.props return ( -
+
{children}
) diff --git a/app/javascript/gabsocial/components/button.js b/app/javascript/gabsocial/components/button.js index 10a56c83..0a87cf79 100644 --- a/app/javascript/gabsocial/components/button.js +++ b/app/javascript/gabsocial/components/button.js @@ -37,6 +37,8 @@ const COLORS = { * @param {func} [props.onMouseEnter] - function to call on button mouse enter * @param {func} [props.onMouseLeave] - function to call on button mouse leave * @param {bool} [props.radiusSmall] - if the button has small radius + * @param {bool} [props.rel] - rel for the button + * @param {bool} [props.target] - target for the button * @param {bool} [props.text] - if the button is just text (i.e. link) * @param {bool} [props.title] - `title` attribute for button * @param {bool} [props.to] - `to` to send to on click @@ -68,6 +70,8 @@ export default class Button extends PureComponent { onMouseLeave: PropTypes.func, isOutline: PropTypes.bool, radiusSmall: PropTypes.bool, + rel: PropTypes.string, + target: PropTypes.string, title: PropTypes.string, to: PropTypes.string, type: PropTypes.string, @@ -118,6 +122,8 @@ export default class Button extends PureComponent { onMouseEnter, onMouseLeave, radiusSmall, + rel, + target, title, to, type, @@ -136,13 +142,13 @@ export default class Button extends PureComponent { cursorNotAllowed: isDisabled, opacity05: isDisabled, - backgroundColorPrimary: backgroundColor === COLORS.white, - backgroundColorBlack: backgroundColor === COLORS.black, - backgroundColorBrand: backgroundColor === COLORS.brand, - backgroundTransparent: backgroundColor === COLORS.none, - backgroundColorSubtle2: backgroundColor === COLORS.tertiary, - backgroundColorSubtle: backgroundColor === COLORS.secondary, - backgroundColorDanger: backgroundColor === COLORS.danger, + bgPrimary: backgroundColor === COLORS.white, + bgBlack: backgroundColor === COLORS.black, + bgBrand: backgroundColor === COLORS.brand, + bgTransparent: backgroundColor === COLORS.none, + bgSecondary: backgroundColor === COLORS.tertiary, + bgSubtle: backgroundColor === COLORS.secondary, + bgDanger: backgroundColor === COLORS.danger, colorPrimary: !!children && color === COLORS.primary, colorSecondary: !!children && color === COLORS.secondary, @@ -164,18 +170,18 @@ export default class Button extends PureComponent { underline_onHover: underlineOnHover, - backgroundColorSubtle2Dark_onHover: backgroundColor === COLORS.tertiary || backgroundColor === COLORS.secondary && !isDisabled, - backgroundColorBlackOpaque_onHover: backgroundColor === COLORS.black && !isDisabled, - backgroundColorBrandDark_onHover: backgroundColor === COLORS.brand && !isDisabled, - backgroundColorDangerDark_onHover: backgroundColor === COLORS.danger && !isDisabled, + bgSecondaryDark_onHover: backgroundColor === COLORS.tertiary || backgroundColor === COLORS.secondary && !isDisabled, + bgBlackOpaque_onHover: backgroundColor === COLORS.black && !isDisabled, + bgBrandDark_onHover: backgroundColor === COLORS.brand && !isDisabled, + bgDangerDark_onHover: backgroundColor === COLORS.danger && !isDisabled, - backgroundColorBrand_onHover: color === COLORS.brand && isOutline && !isDisabled, + bgBrand_onHover: color === COLORS.brand && isOutline && !isDisabled, colorWhite_onHover: !!children && color === COLORS.brand && isOutline && !isDisabled, - fillColorSecondary: !!icon && color === COLORS.secondary, - fillColorWhite: !!icon && color === COLORS.white, - fillColorBrand: !!icon && color === COLORS.brand, - fillColorWhite_onHover: !!icon && color === COLORS.brand && isOutline, + fillSecondary: !!icon && color === COLORS.secondary, + fillWhite: !!icon && color === COLORS.white, + fillBrand: !!icon && color === COLORS.brand, + fillWhite_onHover: !!icon && color === COLORS.brand && isOutline, }) const tagName = !!href ? 'a' : !!to ? 'NavLink' : 'button' @@ -216,6 +222,8 @@ export default class Button extends PureComponent { } const options = { + rel, + target, title, type, disabled: isDisabled, diff --git a/app/javascript/gabsocial/components/column_header.js b/app/javascript/gabsocial/components/column_header.js index 2c3c4607..ebe884d4 100644 --- a/app/javascript/gabsocial/components/column_header.js +++ b/app/javascript/gabsocial/components/column_header.js @@ -45,14 +45,14 @@ export default class ColumnHeader extends PureComponent { className={[_s.alignItemsCenter, _s.pl0, _s.justifyContentCenter].join(' ')} icon='back' iconSize='20px' - iconClassName={[_s.mr5, _s.fillColorPrimary].join(' ')} + iconClassName={[_s.mr5, _s.fillPrimary].join(' ')} onClick={this.handleBackClick} /> }
- {title} +
@@ -63,7 +63,7 @@ export default class ColumnHeader extends PureComponent { { !!actions && -
+
{ actions.map((action, i) => ( diff --git a/app/javascript/gabsocial/components/media_gallery.js b/app/javascript/gabsocial/components/media_gallery.js index ab49fd67..6bdae388 100644 --- a/app/javascript/gabsocial/components/media_gallery.js +++ b/app/javascript/gabsocial/components/media_gallery.js @@ -216,7 +216,7 @@ class Item extends ImmutablePureComponent { playsInline /> -
+
GIF
@@ -574,7 +574,7 @@ class MediaGallery extends PureComponent { title={intl.formatMessage(messages.toggle_visible)} icon='hidden' backgroundColor='none' - className={[_s.px10, _s.backgroundColorBlackOpaque_onHover].join(' ')} + className={[_s.px10, _s.bgBlackOpaque_onHover].join(' ')} onClick={this.handleOpen} />
diff --git a/app/javascript/gabsocial/components/media_item.js b/app/javascript/gabsocial/components/media_item.js index d70023e1..e4cb4d13 100644 --- a/app/javascript/gabsocial/components/media_item.js +++ b/app/javascript/gabsocial/components/media_item.js @@ -137,13 +137,13 @@ export default class MediaItem extends ImmutablePureComponent { } { !!badge && -
+
{badge} diff --git a/app/javascript/gabsocial/components/modal/embed_modal.js b/app/javascript/gabsocial/components/modal/embed_modal.js index d6571a00..da71eaa6 100644 --- a/app/javascript/gabsocial/components/modal/embed_modal.js +++ b/app/javascript/gabsocial/components/modal/embed_modal.js @@ -89,7 +89,7 @@ class EmbedModal extends ImmutablePureComponent { {intl.formatMessage(messages.preview)} -
+