-
+
@@ -226,13 +228,23 @@ class Sidebar extends ImmutablePureComponent {
}
-
+
+
+
+
+
+
+
diff --git a/app/javascript/gabsocial/components/status/status.js b/app/javascript/gabsocial/components/status/status.js
index 53bb2300..99fe0308 100644
--- a/app/javascript/gabsocial/components/status/status.js
+++ b/app/javascript/gabsocial/components/status/status.js
@@ -387,6 +387,7 @@ class Status extends ImmutablePureComponent {
const containerClasses = cx({
default: 1,
+ radiusSmall: !borderless && !isChild,
mb15: !borderless && !isChild,
backgroundColorPrimary: 1,
pb15: featured,
diff --git a/app/javascript/gabsocial/components/tab_bar_item.js b/app/javascript/gabsocial/components/tab_bar_item.js
index 80ae9678..a650b639 100644
--- a/app/javascript/gabsocial/components/tab_bar_item.js
+++ b/app/javascript/gabsocial/components/tab_bar_item.js
@@ -57,6 +57,7 @@ class TabBarItem extends PureComponent {
justifyContentCenter: 1,
borderBottom2PX: 1,
py5: 1,
+ outlineNone: 1,
cursorPointer: 1,
backgroundTransparent: 1,
borderColorTransparent: !isActive,
diff --git a/app/javascript/gabsocial/features/notifications/components/notification/notification-alt.js b/app/javascript/gabsocial/features/notifications/components/notification.js
similarity index 96%
rename from app/javascript/gabsocial/features/notifications/components/notification/notification-alt.js
rename to app/javascript/gabsocial/features/notifications/components/notification.js
index 256e2035..ed2434bb 100644
--- a/app/javascript/gabsocial/features/notifications/components/notification/notification-alt.js
+++ b/app/javascript/gabsocial/features/notifications/components/notification.js
@@ -3,12 +3,12 @@ import { injectIntl, defineMessages } from 'react-intl'
import ImmutablePureComponent from 'react-immutable-pure-component'
import { HotKeys } from 'react-hotkeys'
import ImmutablePropTypes from 'react-immutable-proptypes'
-import StatusContainer from '../../../../containers/status_container'
-import AccountContainer from '../../../../containers/account_container'
-import Avatar from '../../../../components/avatar'
-import Icon from '../../../../components/icon'
-import Text from '../../../../components/text'
-import DisplayName from '../../../../components/display_name'
+import StatusContainer from '../../../containers/status_container'
+import AccountContainer from '../../../containers/account_container'
+import Avatar from '../../../components/avatar'
+import Icon from '../../../components/icon'
+import Text from '../../../components/text'
+import DisplayName from '../../../components/display_name'
const messages = defineMessages({
poll: { id: 'notification.poll', defaultMessage: 'A poll you have voted in has ended' },
diff --git a/app/javascript/gabsocial/features/notifications/components/notification/index.js b/app/javascript/gabsocial/features/notifications/components/notification/index.js
deleted file mode 100644
index e207d02f..00000000
--- a/app/javascript/gabsocial/features/notifications/components/notification/index.js
+++ /dev/null
@@ -1 +0,0 @@
-export { default } from './notification'
\ No newline at end of file
diff --git a/app/javascript/gabsocial/features/notifications/components/notification/notification.js b/app/javascript/gabsocial/features/notifications/components/notification/notification.js
deleted file mode 100644
index 5ca67b0c..00000000
--- a/app/javascript/gabsocial/features/notifications/components/notification/notification.js
+++ /dev/null
@@ -1,274 +0,0 @@
-import { injectIntl, FormattedMessage } from 'react-intl';
-import ImmutablePureComponent from 'react-immutable-pure-component';
-import { HotKeys } from 'react-hotkeys';
-import ImmutablePropTypes from 'react-immutable-proptypes';
-import StatusContainer from '../../../../containers/status_container';
-import AccountContainer from '../../../../containers/account_container';
-import Button from '../../../../components/button'
-import Icon from '../../../../components/icon';
-
-const notificationForScreenReader = (intl, message, timestamp) => {
- const output = [message];
-
- output.push(intl.formatDate(timestamp, { hour: '2-digit', minute: '2-digit', month: 'short', day: 'numeric' }));
-
- return output.join(', ');
-};
-
-export default
-@injectIntl
-class Notification extends ImmutablePureComponent {
-
- static contextTypes = {
- router: PropTypes.object,
- };
-
- static propTypes = {
- notification: ImmutablePropTypes.map.isRequired,
- hidden: PropTypes.bool,
- onMoveUp: PropTypes.func.isRequired,
- onMoveDown: PropTypes.func.isRequired,
- onMention: PropTypes.func.isRequired,
- onFavorite: PropTypes.func.isRequired,
- onRepost: PropTypes.func.isRequired,
- onToggleHidden: PropTypes.func.isRequired,
- status: ImmutablePropTypes.map,
- intl: PropTypes.object.isRequired,
- getScrollPosition: PropTypes.func,
- updateScrollBottom: PropTypes.func,
- cacheMediaWidth: PropTypes.func,
- cachedMediaWidth: PropTypes.number,
- };
-
- handleMoveUp = () => {
- const { notification, onMoveUp } = this.props;
- onMoveUp(notification.get('id'));
- }
-
- handleMoveDown = () => {
- const { notification, onMoveDown } = this.props;
- onMoveDown(notification.get('id'));
- }
-
- handleOpen = () => {
- const { notification } = this.props;
-
- if (notification.get('status')) {
- this.context.router.history.push(`/${notification.getIn(['account', 'acct'])}/posts/${notification.get('status')}`);
- } else {
- this.handleOpenProfile();
- }
- }
-
- handleOpenProfile = () => {
- const { notification } = this.props;
- this.context.router.history.push(`/${notification.getIn(['account', 'acct'])}`);
- }
-
- handleMention = e => {
- e.preventDefault();
-
- const { notification, onMention } = this.props;
- onMention(notification.get('account'), this.context.router.history);
- }
-
- handleHotkeyFavorite = () => {
- const { status } = this.props;
- if (status) this.props.onFavorite(status);
- }
-
- handleHotkeyBoost = e => {
- const { status } = this.props;
- if (status) this.props.onRepost(status, e);
- }
-
- handleHotkeyToggleHidden = () => {
- const { status } = this.props;
- if (status) this.props.onToggleHidden(status);
- }
-
- getHandlers() {
- return {
- reply: this.handleMention,
- favorite: this.handleHotkeyFavorite,
- boost: this.handleHotkeyBoost,
- mention: this.handleMention,
- open: this.handleOpen,
- openProfile: this.handleOpenProfile,
- moveUp: this.handleMoveUp,
- moveDown: this.handleMoveDown,
- toggleHidden: this.handleHotkeyToggleHidden,
- };
- }
-
- renderFollow(notification, account, link) {
- const { intl } = this.props;
-
- return (
-
-
-
- );
- }
-
- renderMention(notification) {
- return (
-
- );
- }
-
- renderFavorite(notification, link) {
- const { intl } = this.props;
-
- return (
-
-
-
- );
- }
-
- renderRepost(notification, link) {
- const { intl } = this.props;
-
- return (
-
-
-
- );
- }
-
- renderPoll(notification) {
- const { intl } = this.props;
-
- return (
-
-
-
- );
- }
-
- render() {
- const { notification } = this.props;
- const account = notification.get('account');
- const displayNameHtml = { __html: account.get('display_name_html') };
- const link = (
-
-
-
- );
-
- // console.log("notification:", notification)
-
- switch (notification.get('type')) {
- // case 'follow':
- // return this.renderFollow(notification, account, link);
- // case 'mention':
- // return this.renderMention(notification);
- case 'favourite':
- return this.renderFavorite(notification, link);
- // case 'reblog':
- // return this.renderRepost(notification, link);
- // case 'poll':
- // return this.renderPoll(notification);
- }
-
- return null;
- }
-
-}
diff --git a/app/javascript/gabsocial/features/notifications/containers/column_settings_container.js b/app/javascript/gabsocial/features/notifications/containers/column_settings_container.js
deleted file mode 100644
index cea03a77..00000000
--- a/app/javascript/gabsocial/features/notifications/containers/column_settings_container.js
+++ /dev/null
@@ -1,43 +0,0 @@
-import { defineMessages, injectIntl } from 'react-intl';
-import ColumnSettings from '../components/column_settings';
-import { changeSetting } from '../../../actions/settings';
-import { setFilter } from '../../../actions/notifications';
-import { clearNotifications } from '../../../actions/notifications';
-import { changeAlerts as changePushNotifications } from '../../../actions/push_notifications';
-import { openModal } from '../../../actions/modal';
-
-const messages = defineMessages({
- clearMessage: { id: 'notifications.clear_confirmation', defaultMessage: 'Are you sure you want to permanently clear all your notifications?' },
- clearConfirm: { id: 'notifications.clear', defaultMessage: 'Clear notifications' },
-});
-
-const mapStateToProps = state => ({
- settings: state.getIn(['settings', 'notifications']),
- pushSettings: state.get('push_notifications'),
-});
-
-// : todo : put all notification settings actually IN settings
-const mapDispatchToProps = (dispatch, { intl }) => ({
-
- onChange (path, checked) {
- if (path[0] === 'push') {
- dispatch(changePushNotifications(path.slice(1), checked));
- } else if (path[0] === 'quickFilter') {
- dispatch(changeSetting(['notifications', ...path], checked));
- dispatch(setFilter('all'));
- } else {
- dispatch(changeSetting(['notifications', ...path], checked));
- }
- },
-
- onClear () {
- dispatch(openModal('CONFIRM', {
- message: intl.formatMessage(messages.clearMessage),
- confirm: intl.formatMessage(messages.clearConfirm),
- onConfirm: () => dispatch(clearNotifications()),
- }));
- },
-
-});
-
-export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(ColumnSettings));
diff --git a/app/javascript/gabsocial/features/notifications/containers/notification_container.js b/app/javascript/gabsocial/features/notifications/containers/notification_container.js
index 14ee8665..dc2fec89 100644
--- a/app/javascript/gabsocial/features/notifications/containers/notification_container.js
+++ b/app/javascript/gabsocial/features/notifications/containers/notification_container.js
@@ -13,7 +13,7 @@ import {
} from '../../../actions/statuses'
import { boostModal } from '../../../initial_state'
import { makeGetNotification } from '../../../selectors'
-import Notification from '../components/notification/notification-alt'
+import Notification from '../components/notification'
const getAccountFromState = (state, accountId) => {
return state.getIn(['accounts', accountId])
diff --git a/app/javascript/gabsocial/features/notifications/notifications.js b/app/javascript/gabsocial/features/notifications/notifications.js
index b8c99ed2..a7a28b49 100644
--- a/app/javascript/gabsocial/features/notifications/notifications.js
+++ b/app/javascript/gabsocial/features/notifications/notifications.js
@@ -17,12 +17,11 @@ import TimelineQueueButtonHeader from '../../components/timeline_queue_button_h
import Block from '../../components/block'
const getNotifications = createSelector([
- state => state.getIn(['settings', 'notifications', 'quickFilter', 'show']),
- state => state.getIn(['settings', 'notifications', 'quickFilter', 'active']),
+ state => state.getIn(['notifications', 'filter', 'active']),
state => ImmutableList(state.getIn(['settings', 'notifications', 'shows']).filter(item => !item).keys()),
state => state.getIn(['notifications', 'items']),
-], (showFilterBar, allowedType, excludedTypes, notifications) => {
- if (!showFilterBar || allowedType === 'all') {
+], (allowedType, excludedTypes, notifications) => {
+ if (allowedType === 'all') {
// used if user changed the notification settings after loading the notifications from the server
// otherwise a list of notifications will come pre-filtered from the backend
// we need to turn it off for FilterBar in order not to block ourselves from seeing a specific category
@@ -32,7 +31,6 @@ const getNotifications = createSelector([
})
const mapStateToProps = state => ({
- showFilterBar: state.getIn(['settings', 'notifications', 'quickFilter', 'show']),
notifications: getNotifications(state),
isLoading: state.getIn(['notifications', 'isLoading'], true),
isUnread: state.getIn(['notifications', 'unread']) > 0,
@@ -47,7 +45,6 @@ class Notifications extends ImmutablePureComponent {
static propTypes = {
notifications: ImmutablePropTypes.list.isRequired,
- showFilterBar: PropTypes.bool.isRequired,
dispatch: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
isLoading: PropTypes.bool,
@@ -125,7 +122,6 @@ class Notifications extends ImmutablePureComponent {
isLoading,
isUnread,
hasMore,
- showFilterBar,
totalQueuedNotificationsCount
} = this.props
diff --git a/app/javascript/gabsocial/features/ui/util/responsive_component.js b/app/javascript/gabsocial/features/ui/util/responsive_component.js
index c407e0df..673c3fcb 100644
--- a/app/javascript/gabsocial/features/ui/util/responsive_component.js
+++ b/app/javascript/gabsocial/features/ui/util/responsive_component.js
@@ -41,8 +41,6 @@ export default class Responsive extends PureComponent {
const shouldRender = this.shouldRender(min, max, width)
- console.log("shouldRender:", min, max, width, shouldRender)
-
return shouldRender ? children : null
}
}
\ No newline at end of file
diff --git a/app/javascript/gabsocial/pages/notifications_page.js b/app/javascript/gabsocial/pages/notifications_page.js
index b06923cd..3ec8ade5 100644
--- a/app/javascript/gabsocial/pages/notifications_page.js
+++ b/app/javascript/gabsocial/pages/notifications_page.js
@@ -18,13 +18,12 @@ const messages = defineMessages({
});
const makeMapStateToProps = state => ({
- selectedFilter: state.getIn(['settings', 'notifications', 'quickFilter', 'active']),
+ selectedFilter: state.getIn(['notifications', 'filter', 'active']),
});
const mapDispatchToProps = (dispatch) => ({
- selectFilter(newActiveFilter) {
- console.log("newActiveFilter:", newActiveFilter)
- dispatch(setFilter(newActiveFilter))
+ selectFilter(value) {
+ dispatch(setFilter('active', value))
},
});
@@ -33,6 +32,10 @@ export default
@connect(makeMapStateToProps, mapDispatchToProps)
class NotificationsPage extends PureComponent {
+ static contextTypes = {
+ router: PropTypes.object.isRequired,
+ }
+
static propTypes = {
selectFilter: PropTypes.func.isRequired,
selectedFilter: PropTypes.string.isRequired,
@@ -43,8 +46,16 @@ class NotificationsPage extends PureComponent {
document.title = 'Notifications - Gab'
}
+ // : todo : on pop change filter active type
+
onClick(notificationType) {
- this.props.selectFilter(notificationType);
+ this.props.selectFilter(notificationType)
+
+ if (notificationType === 'all') {
+ this.context.router.history.push('/notifications')
+ } else {
+ this.context.router.history.push(`/notifications?only=${notificationType}`)
+ }
}
render() {
diff --git a/app/javascript/gabsocial/reducers/notifications.js b/app/javascript/gabsocial/reducers/notifications.js
index 65ea0586..b3f7fe1e 100644
--- a/app/javascript/gabsocial/reducers/notifications.js
+++ b/app/javascript/gabsocial/reducers/notifications.js
@@ -30,6 +30,11 @@ const initialState = ImmutableMap({
queuedNotifications: ImmutableList(), //max = MAX_QUEUED_NOTIFICATIONS
totalQueuedNotificationsCount: 0, //used for queuedItems overflow for MAX_QUEUED_NOTIFICATIONS+
lastRead: -1,
+ filter: ImmutableMap({
+ active: 'all',
+ onlyVerified: false,
+ onlyFollowing: false,
+ }),
});
const notificationToMap = notification => ImmutableMap({
@@ -64,7 +69,7 @@ const expandNormalizedNotifications = (state, notifications, next) => {
let items = ImmutableList()
- console.log("notifications:", notificationss)
+ console.log("notifications:", notifications)
notifications.forEach((n) => {
const notification = notificationToMap(n)
@@ -211,7 +216,10 @@ export default function notifications(state = initialState, action) {
case NOTIFICATIONS_EXPAND_FAIL:
return state.set('isLoading', false);
case NOTIFICATIONS_FILTER_SET:
- return state.set('items', ImmutableList()).set('hasMore', true);
+ return state.withMutations(mutable => {
+ mutable.set('items', ImmutableList()).set('hasMore', true)
+ mutable.setIn(['filter', action.path], action.value)
+ })
case NOTIFICATIONS_SCROLL_TOP:
return updateTop(state, action.top);
case NOTIFICATIONS_UPDATE:
diff --git a/app/javascript/gabsocial/reducers/settings.js b/app/javascript/gabsocial/reducers/settings.js
index f238e998..2f5928a2 100644
--- a/app/javascript/gabsocial/reducers/settings.js
+++ b/app/javascript/gabsocial/reducers/settings.js
@@ -1,5 +1,4 @@
import { SETTING_CHANGE, SETTING_SAVE } from '../actions/settings';
-import { NOTIFICATIONS_FILTER_SET } from '../actions/notifications';
import { STORE_HYDRATE } from '../actions/store';
import { EMOJI_USE } from '../actions/emojis';
import { LIST_DELETE_SUCCESS, LIST_FETCH_FAIL } from '../actions/lists';
@@ -43,15 +42,6 @@ const initialState = ImmutableMap({
}),
}),
- notifications: ImmutableMap({
- // : todo : put all notification settings actually IN settings
- quickFilter: ImmutableMap({
- active: 'all',
- onlyVerifed: false,
- onlyFollowing: false,
- }),
- }),
-
community: ImmutableMap({
shows: ImmutableMap({
inSidebar: false,
@@ -76,7 +66,6 @@ export default function settings(state = initialState, action) {
switch(action.type) {
case STORE_HYDRATE:
return hydrate(state, action.state.get('settings'));
- case NOTIFICATIONS_FILTER_SET:
case SETTING_CHANGE:
return state
.setIn(action.path, action.value)
diff --git a/app/javascript/gabsocial/utils/is_mobile.js b/app/javascript/gabsocial/utils/is_mobile.js
index 893debd0..26e25664 100644
--- a/app/javascript/gabsocial/utils/is_mobile.js
+++ b/app/javascript/gabsocial/utils/is_mobile.js
@@ -19,15 +19,15 @@ export function breakpointExtraLarge(width) {
}
export function breakpointLarge(width) {
- return width > BREAKPOINT_MEDIUM && width < BREAKPOINT_LARGE
+ return width < BREAKPOINT_LARGE
}
export function breakpointMedium(width) {
- return width > BREAKPOINT_SMALL && width < BREAKPOINT_MEDIUM
+ return width < BREAKPOINT_MEDIUM
}
export function breakpointSmall(width) {
- return width > BREAKPOINT_EXTRA_SMALL && width < BREAKPOINT_SMALL
+ return width < BREAKPOINT_SMALL
}
export function breakpointExtraSmall(width) {
diff --git a/app/javascript/styles/global.css b/app/javascript/styles/global.css
index 6e99308d..b476b456 100644
--- a/app/javascript/styles/global.css
+++ b/app/javascript/styles/global.css
@@ -55,7 +55,7 @@ body {
flex-direction: column;
align-items: stretch;
flex-shrink: 0;
- border: 0 solid black;
+ border: 0 solid #2d3436;
z-index: 0;
margin: 0;
padding: 0;
@@ -313,7 +313,7 @@ body {
}
.backgroundColorBlack {
- background-color: #3B3B3B;
+ background-color: #2d3436;
}
.backgroundColorBlackOpaque_onHover:hover {
@@ -353,7 +353,7 @@ body {
}
.colorPrimary {
- color: #000;
+ color: #2d3436;
}
.colorWhite {
@@ -381,7 +381,7 @@ body {
}
.fillColorBlack {
- fill: #000;
+ fill: #2d3436;
}
.fillColorWhite {