From e37500c0cf073221f16c4598074e233d4c53f821 Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Wed, 19 Feb 2020 18:57:07 -0500 Subject: [PATCH] Progress --- app/javascript/gabsocial/actions/hashtags.js | 39 +++ app/javascript/gabsocial/actions/lists.js | 18 +- app/javascript/gabsocial/actions/trends.js | 39 --- .../__snapshots__/avatar_overlay-test.js.snap | 24 -- .../__tests__/avatar_overlay-test.js | 28 --- .../gabsocial/components/account/account.js | 20 +- .../gabsocial/components/assets/gab_logo.js | 6 +- .../autosuggest_textbox.js | 6 +- app/javascript/gabsocial/components/avatar.js | 57 +++++ .../gabsocial/components/avatar/avatar.js | 63 ----- .../gabsocial/components/avatar/avatar.scss | 36 --- .../gabsocial/components/avatar/index.js | 1 - .../avatar_overlay/avatar_overlay.js | 31 --- .../avatar_overlay/avatar_overlay.scss | 16 -- .../components/avatar_overlay/index.js | 1 - app/javascript/gabsocial/components/badge.js | 33 +++ app/javascript/gabsocial/components/button.js | 94 ++++++++ .../gabsocial/components/button/button.js | 79 ------ .../gabsocial/components/button/button.scss | 92 ------- .../gabsocial/components/button/index.js | 1 - .../gabsocial/components/column/column.js | 4 +- .../column_back_button/column_back_button.js | 38 --- .../column_back_button.scss | 32 --- .../components/column_back_button/index.js | 1 - .../gabsocial/components/column_header.js | 40 +++- .../column_header_setting_button.js | 38 --- .../column_header_setting_button.scss | 28 --- .../column_header_setting_button/index.js | 1 - .../gabsocial/components/column_indicator.js | 4 +- .../components/column_link/column_link.js | 22 -- .../components/column_link/column_link.scss | 39 --- .../gabsocial/components/column_link/index.js | 1 - .../column_subheading/column_subheading.js | 15 -- .../column_subheading/column_subheading.scss | 9 - .../components/column_subheading/index.js | 1 - .../gabsocial/components/display_name.js | 17 +- .../gabsocial/components/divider.js | 7 + .../gabsocial/components/group_list_item.js | 80 +++++++ .../gabsocial/components/hashtag_item.js | 47 ++++ .../gabsocial/components/heading.js | 55 +++++ .../gabsocial/components/icon/icon.js | 9 + .../components/icon/svgs/add_icon.js | 26 ++ .../components/icon/svgs/angle_right_icon.js | 26 ++ .../components/icon/svgs/back_icon.js | 2 +- .../components/icon/svgs/loading_icon.js | 16 +- .../components/icon/svgs/subtract_icon.js | 26 ++ app/javascript/gabsocial/components/image.js | 41 ++++ app/javascript/gabsocial/components/input.js | 9 + .../components/layouts/default_layout.js | 42 ++-- .../components/layouts/profile_layout.js | 18 +- .../gabsocial/components/link_footer.js | 21 +- .../gabsocial/components/load_more.js | 2 +- .../components/media_gallery/media_gallery.js | 18 +- .../notification_counter.js | 0 .../components/notification_counter/index.js | 1 - .../notification_counter.scss | 21 -- .../components/panel/groups_panel.js | 120 +--------- .../components/panel/hashtags_panel.js | 64 +++++ .../components/panel/list_details_panel.js | 52 ++++ .../components/panel/panel_layout.js | 55 +++-- .../components/panel/sign_up_panel.js | 4 +- .../components/panel/trends_panel.js | 51 ++-- .../gabsocial/components/panel/user_panel.js | 87 +++++++ .../components/panel/who_to_follow_panel.js | 4 +- .../components/permalink/permalink.js | 4 +- .../gabsocial/components/popover/popover.js | 9 + .../gabsocial/components/progress_bar.js | 13 +- .../scrollable_list/scrollable_list.js | 2 +- .../gabsocial/components/search/search.js | 26 +- .../gabsocial/components/sidebar.js | 225 ++++++++++++++++++ .../{header.js => sidebar_header.js} | 46 ++-- .../components/sidebar_section_item.js | 115 +++++++++ .../components/sidebar_section_title.js | 21 ++ .../gabsocial/components/status/status.js | 37 ++- .../status_action_bar/status_action_bar.js | 28 +-- .../status_content/status_content.js | 12 +- .../components/status_list/status_list.js | 2 +- app/javascript/gabsocial/components/text.js | 79 ++++++ .../components/timeline_compose_block.js | 10 +- .../gabsocial/components/trending_item.js | 13 +- .../gabsocial/components/user_panel.js | 154 ------------ .../gabsocial/components/user_stat.js | 44 ++++ .../components/moved_note/moved_note.js | 6 +- .../character_counter/character_counter.js | 4 +- .../components/compose_extra_button.js | 12 +- .../components/compose_form/compose_form.js | 13 +- .../compose/components/upload_button.js | 4 +- .../gabsocial/features/home_timeline/index.js | 62 +++-- .../features/list_adder/list_adder.js | 3 - .../features/list_editor/list_editor.js | 4 - .../features/list_timeline/list_timeline.js | 45 +--- .../gabsocial/features/lists/lists.js | 137 +++++++---- .../features/status/components/card/card.js | 42 ++-- app/javascript/gabsocial/features/ui/ui.js | 14 +- app/javascript/gabsocial/pages/home_page.js | 20 +- app/javascript/gabsocial/pages/list_page.js | 49 ++++ app/javascript/gabsocial/pages/lists_page.js | 46 ++++ .../reducers/{trends.js => hashtags.js} | 16 +- app/javascript/gabsocial/reducers/index.js | 4 +- app/javascript/gabsocial/utils/is_mobile.js | 66 +++-- app/javascript/styles/global.css | 52 +++- config/webpack/rules/css.js | 5 - config/webpack/shared.js | 2 +- package.json | 3 +- yarn.lock | 41 +++- 105 files changed, 1975 insertions(+), 1393 deletions(-) create mode 100644 app/javascript/gabsocial/actions/hashtags.js delete mode 100644 app/javascript/gabsocial/actions/trends.js delete mode 100644 app/javascript/gabsocial/components/__tests__/__snapshots__/avatar_overlay-test.js.snap delete mode 100644 app/javascript/gabsocial/components/__tests__/avatar_overlay-test.js create mode 100644 app/javascript/gabsocial/components/avatar.js delete mode 100644 app/javascript/gabsocial/components/avatar/avatar.js delete mode 100644 app/javascript/gabsocial/components/avatar/avatar.scss delete mode 100644 app/javascript/gabsocial/components/avatar/index.js delete mode 100644 app/javascript/gabsocial/components/avatar_overlay/avatar_overlay.js delete mode 100644 app/javascript/gabsocial/components/avatar_overlay/avatar_overlay.scss delete mode 100644 app/javascript/gabsocial/components/avatar_overlay/index.js create mode 100644 app/javascript/gabsocial/components/badge.js create mode 100644 app/javascript/gabsocial/components/button.js delete mode 100644 app/javascript/gabsocial/components/button/button.js delete mode 100644 app/javascript/gabsocial/components/button/button.scss delete mode 100644 app/javascript/gabsocial/components/button/index.js delete mode 100644 app/javascript/gabsocial/components/column_back_button/column_back_button.js delete mode 100644 app/javascript/gabsocial/components/column_back_button/column_back_button.scss delete mode 100644 app/javascript/gabsocial/components/column_back_button/index.js delete mode 100644 app/javascript/gabsocial/components/column_header_setting_button/column_header_setting_button.js delete mode 100644 app/javascript/gabsocial/components/column_header_setting_button/column_header_setting_button.scss delete mode 100644 app/javascript/gabsocial/components/column_header_setting_button/index.js delete mode 100644 app/javascript/gabsocial/components/column_link/column_link.js delete mode 100644 app/javascript/gabsocial/components/column_link/column_link.scss delete mode 100644 app/javascript/gabsocial/components/column_link/index.js delete mode 100644 app/javascript/gabsocial/components/column_subheading/column_subheading.js delete mode 100644 app/javascript/gabsocial/components/column_subheading/column_subheading.scss delete mode 100644 app/javascript/gabsocial/components/column_subheading/index.js create mode 100644 app/javascript/gabsocial/components/divider.js create mode 100644 app/javascript/gabsocial/components/group_list_item.js create mode 100644 app/javascript/gabsocial/components/hashtag_item.js create mode 100644 app/javascript/gabsocial/components/heading.js create mode 100644 app/javascript/gabsocial/components/icon/svgs/add_icon.js create mode 100644 app/javascript/gabsocial/components/icon/svgs/angle_right_icon.js create mode 100644 app/javascript/gabsocial/components/icon/svgs/subtract_icon.js create mode 100644 app/javascript/gabsocial/components/image.js create mode 100644 app/javascript/gabsocial/components/input.js rename app/javascript/gabsocial/components/{notification_counter => }/notification_counter.js (100%) delete mode 100644 app/javascript/gabsocial/components/notification_counter/index.js delete mode 100644 app/javascript/gabsocial/components/notification_counter/notification_counter.scss create mode 100644 app/javascript/gabsocial/components/panel/hashtags_panel.js create mode 100644 app/javascript/gabsocial/components/panel/list_details_panel.js create mode 100644 app/javascript/gabsocial/components/panel/user_panel.js create mode 100644 app/javascript/gabsocial/components/popover/popover.js create mode 100644 app/javascript/gabsocial/components/sidebar.js rename app/javascript/gabsocial/components/{header.js => sidebar_header.js} (82%) create mode 100644 app/javascript/gabsocial/components/sidebar_section_item.js create mode 100644 app/javascript/gabsocial/components/sidebar_section_title.js create mode 100644 app/javascript/gabsocial/components/text.js delete mode 100644 app/javascript/gabsocial/components/user_panel.js create mode 100644 app/javascript/gabsocial/components/user_stat.js create mode 100644 app/javascript/gabsocial/pages/list_page.js create mode 100644 app/javascript/gabsocial/pages/lists_page.js rename app/javascript/gabsocial/reducers/{trends.js => hashtags.js} (63%) diff --git a/app/javascript/gabsocial/actions/hashtags.js b/app/javascript/gabsocial/actions/hashtags.js new file mode 100644 index 00000000..7f35102f --- /dev/null +++ b/app/javascript/gabsocial/actions/hashtags.js @@ -0,0 +1,39 @@ +import api from '../api'; + +export const HASHTAGS_FETCH_REQUEST = 'HASHTAGS_FETCH_REQUEST'; +export const HASHTAGS_FETCH_SUCCESS = 'HASHTAGS_FETCH_SUCCESS'; +export const HASHTAGS_FETCH_FAIL = 'HASHTAGS_FETCH_FAIL'; + +export function fetchHashtags() { + return (dispatch, getState) => { + dispatch(fetchHashtagsRequest()); + + api(getState).get('/api/v1/trends').then(response => { + dispatch(fetchHashtagsSuccess(response.data)); + }).catch(error => dispatch(fetchHashtagsFail(error))); + }; +}; + +export function fetchHashtagsRequest() { + return { + type: HASHTAGS_FETCH_REQUEST, + skipLoading: true, + }; +}; + +export function fetchHashtagsSuccess(tags) { + return { + tags, + type: HASHTAGS_FETCH_SUCCESS, + skipLoading: true, + }; +}; + +export function fetchHashtagsFail(error) { + return { + error, + type: HASHTAGS_FETCH_FAIL, + skipLoading: true, + skipAlert: true, + }; +}; diff --git a/app/javascript/gabsocial/actions/lists.js b/app/javascript/gabsocial/actions/lists.js index d01fbc2b..0dcaa860 100644 --- a/app/javascript/gabsocial/actions/lists.js +++ b/app/javascript/gabsocial/actions/lists.js @@ -81,13 +81,17 @@ export const fetchListFail = (id, error) => ({ }); export const fetchLists = () => (dispatch, getState) => { - if (!me) return; - - dispatch(fetchListsRequest()); - - api(getState).get('/api/v1/lists') - .then(({ data }) => dispatch(fetchListsSuccess(data))) - .catch(err => dispatch(fetchListsFail(err))); + return new Promise((resolve, reject) => { + dispatch(fetchListsRequest()); + if (!me) return reject() + api(getState).get('/api/v1/lists').then(({ data }) => { + dispatch(fetchListsSuccess(data)) + return resolve() + }).catch((err) => { + dispatch(fetchListsFail(err)) + return reject() + }); + }) }; export const fetchListsRequest = () => ({ diff --git a/app/javascript/gabsocial/actions/trends.js b/app/javascript/gabsocial/actions/trends.js deleted file mode 100644 index b23c1c60..00000000 --- a/app/javascript/gabsocial/actions/trends.js +++ /dev/null @@ -1,39 +0,0 @@ -import api from '../api'; - -export const TRENDS_FETCH_REQUEST = 'TRENDS_FETCH_REQUEST'; -export const TRENDS_FETCH_SUCCESS = 'TRENDS_FETCH_SUCCESS'; -export const TRENDS_FETCH_FAIL = 'TRENDS_FETCH_FAIL'; - -export function fetchTrends() { - return (dispatch, getState) => { - dispatch(fetchTrendsRequest()); - - api(getState).get('/api/v1/trends').then(response => { - dispatch(fetchTrendsSuccess(response.data)); - }).catch(error => dispatch(fetchTrendsFail(error))); - }; -}; - -export function fetchTrendsRequest() { - return { - type: TRENDS_FETCH_REQUEST, - skipLoading: true, - }; -}; - -export function fetchTrendsSuccess(tags) { - return { - type: TRENDS_FETCH_SUCCESS, - tags, - skipLoading: true, - }; -}; - -export function fetchTrendsFail(error) { - return { - type: TRENDS_FETCH_FAIL, - error, - skipLoading: true, - skipAlert: true, - }; -}; diff --git a/app/javascript/gabsocial/components/__tests__/__snapshots__/avatar_overlay-test.js.snap b/app/javascript/gabsocial/components/__tests__/__snapshots__/avatar_overlay-test.js.snap deleted file mode 100644 index d59fee42..00000000 --- a/app/javascript/gabsocial/components/__tests__/__snapshots__/avatar_overlay-test.js.snap +++ /dev/null @@ -1,24 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[` -
-
-
-`; diff --git a/app/javascript/gabsocial/components/__tests__/avatar_overlay-test.js b/app/javascript/gabsocial/components/__tests__/avatar_overlay-test.js deleted file mode 100644 index a5b418c6..00000000 --- a/app/javascript/gabsocial/components/__tests__/avatar_overlay-test.js +++ /dev/null @@ -1,28 +0,0 @@ -import renderer from 'react-test-renderer'; -import { fromJS } from 'immutable'; -import AvatarOverlay from '../avatar_overlay'; - -describe(' { - const account = fromJS({ - username: 'alice', - acct: 'alice', - display_name: 'Alice', - avatar: '/animated/alice.gif', - avatar_static: '/static/alice.jpg', - }); - - const friend = fromJS({ - username: 'eve', - acct: 'eve@blackhat.lair', - display_name: 'Evelyn', - avatar: '/animated/eve.gif', - avatar_static: '/static/eve.jpg', - }); - - it('renders a overlay avatar', () => { - const component = renderer.create(); - const tree = component.toJSON(); - - expect(tree).toMatchSnapshot(); - }); -}); diff --git a/app/javascript/gabsocial/components/account/account.js b/app/javascript/gabsocial/components/account/account.js index 61ae722e..64150237 100644 --- a/app/javascript/gabsocial/components/account/account.js +++ b/app/javascript/gabsocial/components/account/account.js @@ -4,7 +4,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes' import { defineMessages, injectIntl } from 'react-intl' import ImmutablePureComponent from 'react-immutable-pure-component' import { me } from '../../initial_state' -import Avatar from '../avatar/avatar' +import Avatar from '../avatar' import DisplayName from '../display_name' import IconButton from '../icon_button' import Icon from '../icon' @@ -107,33 +107,33 @@ class Account extends ImmutablePureComponent { } return ( -
-
+
+
-
+
-
-
-
diff --git a/app/javascript/gabsocial/components/assets/gab_logo.js b/app/javascript/gabsocial/components/assets/gab_logo.js index f80ab805..8fc21415 100644 --- a/app/javascript/gabsocial/components/assets/gab_logo.js +++ b/app/javascript/gabsocial/components/assets/gab_logo.js @@ -14,14 +14,14 @@ const GabLogo = ({ xmlSpace='preserve' > - - - diff --git a/app/javascript/gabsocial/components/autosuggest_textbox/autosuggest_textbox.js b/app/javascript/gabsocial/components/autosuggest_textbox/autosuggest_textbox.js index 717a5503..f0137ea3 100644 --- a/app/javascript/gabsocial/components/autosuggest_textbox/autosuggest_textbox.js +++ b/app/javascript/gabsocial/components/autosuggest_textbox/autosuggest_textbox.js @@ -199,11 +199,11 @@ export default class AutosuggestTextbox extends ImmutablePureComponent { if (textarea) { return ( -
-
+
+