@@ -58,14 +71,19 @@ class Album extends React.PureComponent {
}
Album.propTypes = {
+ account: ImmutablePropTypes.map,
album: ImmutablePropTypes.map,
isAddable: PropTypes.bool,
}
+const mapStateToProps = (state, { albumId }) => ({
+ album: state.getIn(['albums', albumId]),
+})
+
const mapDispatchToProps = (dispatch) => ({
openAlbumCreate() {
dispatch(openModal(MODAL_ALBUM_CREATE))
}
})
-export default connect(null, mapDispatchToProps)(Album)
\ No newline at end of file
+export default connect(mapStateToProps, mapDispatchToProps)(Album)
\ No newline at end of file
diff --git a/app/javascript/gabsocial/components/navigation_bar/profile_navigation_bar.js b/app/javascript/gabsocial/components/navigation_bar/profile_navigation_bar.js
index 5c744774..f53f2f07 100644
--- a/app/javascript/gabsocial/components/navigation_bar/profile_navigation_bar.js
+++ b/app/javascript/gabsocial/components/navigation_bar/profile_navigation_bar.js
@@ -23,9 +23,6 @@ class ProfileNavigationBar extends React.PureComponent {
render() {
const { titleHTML } = this.props
-
- // : todo :
- // fix padding on mobile device
return (
diff --git a/app/javascript/gabsocial/components/panel/media_gallery_panel.js b/app/javascript/gabsocial/components/panel/media_gallery_panel.js
index 70382eca..ed587d37 100644
--- a/app/javascript/gabsocial/components/panel/media_gallery_panel.js
+++ b/app/javascript/gabsocial/components/panel/media_gallery_panel.js
@@ -55,7 +55,7 @@ class MediaGalleryPanel extends ImmutablePureComponent {
noPadding
title={intl.formatMessage(messages.title)}
headerButtonTitle={!!account ? intl.formatMessage(messages.show_all) : undefined}
- headerButtonTo={!!account ? `/${account.get('acct')}/albums` : undefined}
+ headerButtonTo={!!account ? `/${account.get('acct')}/photos` : undefined}
>
{
diff --git a/app/javascript/gabsocial/components/popover/status_options_popover.js b/app/javascript/gabsocial/components/popover/status_options_popover.js
index 45c95a32..e766e1f5 100644
--- a/app/javascript/gabsocial/components/popover/status_options_popover.js
+++ b/app/javascript/gabsocial/components/popover/status_options_popover.js
@@ -19,7 +19,7 @@ import {
import {
muteAccount,
unmuteAccount,
-} from '../../actions/interactions';
+} from '../../actions/accounts';
import {
deleteStatus,
editStatus,
@@ -197,11 +197,12 @@ class StatusOptionsPopover extends ImmutablePureComponent {
})
if (status.get('bookmarked')) {
- menu.push({
- icon: 'bookmark',
- title: 'Update bookmark collection',
- onClick: this.handleBookmarkChangeClick,
- })
+ // : todo :
+ // menu.push({
+ // icon: 'bookmark',
+ // title: 'Update bookmark collection',
+ // onClick: this.handleBookmarkChangeClick,
+ // })
}
if (status.getIn(['account', 'id']) === me) {
diff --git a/app/javascript/gabsocial/components/profile_header.js b/app/javascript/gabsocial/components/profile_header.js
index c7b3561b..b5f2c8ed 100644
--- a/app/javascript/gabsocial/components/profile_header.js
+++ b/app/javascript/gabsocial/components/profile_header.js
@@ -121,7 +121,7 @@ class ProfileHeader extends ImmutablePureComponent {
title: intl.formatMessage(messages.comments),
},
{
- to: `/${account.get('acct')}/albums`,
+ to: `/${account.get('acct')}/photos`,
title: intl.formatMessage(messages.photos),
},
{
@@ -137,7 +137,7 @@ class ProfileHeader extends ImmutablePureComponent {
title: 'Likes',
})
tabs.push({
- to: `/${account.get('acct')}/bookmark_collections`,
+ to: `/${account.get('acct')}/bookmarks`,
title: intl.formatMessage(messages.bookmarks),
})
}
diff --git a/app/javascript/gabsocial/components/status_check_box.js b/app/javascript/gabsocial/components/status_check_box.js
index b38e13f8..11e9576e 100644
--- a/app/javascript/gabsocial/components/status_check_box.js
+++ b/app/javascript/gabsocial/components/status_check_box.js
@@ -32,6 +32,7 @@ class StatusCheckBox extends ImmutablePureComponent {
preview={video.get('preview_url')}
blurhash={video.get('blurhash')}
src={video.get('url')}
+ sourceMp4={video.get('source_mp4')}
alt={video.get('description')}
aspectRatio={video.getIn(['meta', 'small', 'aspect'])}
fileContentType={video.get('file_content_type')}
diff --git a/app/javascript/gabsocial/components/status_media.js b/app/javascript/gabsocial/components/status_media.js
index 1626f40c..1a0356f1 100644
--- a/app/javascript/gabsocial/components/status_media.js
+++ b/app/javascript/gabsocial/components/status_media.js
@@ -65,6 +65,7 @@ class StatusMedia extends ImmutablePureComponent {
preview={video.get('preview_url')}
blurhash={video.get('blurhash')}
src={video.get('url')}
+ sourceMp4={video.get('source_mp4')}
alt={video.get('description')}
aspectRatio={video.getIn(['meta', 'small', 'aspect'])}
fileContentType={video.get('file_content_type')}
diff --git a/app/javascript/gabsocial/components/video.js b/app/javascript/gabsocial/components/video.js
index 1687eabb..72b5ce0a 100644
--- a/app/javascript/gabsocial/components/video.js
+++ b/app/javascript/gabsocial/components/video.js
@@ -31,10 +31,16 @@ class Video extends ImmutablePureComponent {
}
componentDidMount() {
- videoJsOptions.sources = [{
- src: this.props.src,
- type: this.props.fileContentType,
- }]
+ videoJsOptions.sources = [
+ {
+ src: this.props.src,
+ type: this.props.fileContentType,
+ },
+ {
+ src: this.props.sourceMp4,
+ type: 'video/mp4',
+ },
+ ]
this.videoPlayer = videojs(this.video, videoJsOptions)
}
@@ -182,6 +188,7 @@ const messages = defineMessages({
Video.propTypes = {
preview: PropTypes.string,
src: PropTypes.string.isRequired,
+ sourceMp4: PropTypes.string,
alt: PropTypes.string,
width: PropTypes.number,
height: PropTypes.number,
diff --git a/app/javascript/gabsocial/features/account_albums.js b/app/javascript/gabsocial/features/account_albums.js
index c6b20346..4ff43fa8 100644
--- a/app/javascript/gabsocial/features/account_albums.js
+++ b/app/javascript/gabsocial/features/account_albums.js
@@ -5,8 +5,8 @@ import ImmutablePropTypes from 'react-immutable-proptypes'
import ImmutablePureComponent from 'react-immutable-pure-component'
import { me } from '../initial_state'
import {
- fetchAccountAlbums,
- expandAccountAlbums,
+ fetchAlbums,
+ expandAlbums,
} from '../actions/albums'
import ColumnIndicator from '../components/column_indicator'
import Heading from '../components/heading'
@@ -48,7 +48,7 @@ class AccountAlbums extends ImmutablePureComponent {
render() {
const {
isMe,
- albums,
+ albumIds,
account,
accountId,
hasMore,
@@ -56,7 +56,9 @@ class AccountAlbums extends ImmutablePureComponent {
} = this.props
if (!account) return null
- const hasAlbums = !!albums ? albums.size > 0 : false
+ const hasAlbums = !!albumIds ? albumIds.size > 0 : false
+
+ console.log("albumIds:", albumIds)
return (
@@ -69,11 +71,11 @@ class AccountAlbums extends ImmutablePureComponent {
title: 'All Photos',
to: `/${account.get('username')}/photos`,
},
- {
- title: 'Albums',
- isActive: true,
- to: `/${account.get('username')}/albums`,
- },
+ // {
+ // title: 'Albums',
+ // isActive: true,
+ // to: `/${account.get('username')}/albums`,
+ // },
]}/>
@@ -82,10 +84,10 @@ class AccountAlbums extends ImmutablePureComponent {
{
hasAlbums &&
- albums.map((albums, i) => (
+ albumIds.map((albumId, i) => (
))
@@ -119,7 +121,7 @@ const mapStateToProps = (state, { account, mediaType }) => {
return {
accountId,
- albums: state.getIn(['album_lists', accountId, 'items']),
+ albumIds: state.getIn(['album_lists', accountId, 'items']),
isLoading: state.getIn(['album_lists', accountId, 'isLoading'], false),
hasMore: state.getIn(['album_lists', accountId, 'hasMore'], false),
}
@@ -127,17 +129,17 @@ const mapStateToProps = (state, { account, mediaType }) => {
const mapDispatchToProps = (dispatch) => ({
onFetchAccountAlbums(accountId) {
-
+ dispatch(fetchAlbums(accountId))
},
onExpandAccountAlbums(accountId) {
-
+ dispatch(expandAlbums(accountId))
},
})
AccountAlbums.propTypes = {
account: ImmutablePropTypes.map,
accountId: PropTypes.string,
- albums: ImmutablePropTypes.list,
+ albumIds: ImmutablePropTypes.list,
isLoading: PropTypes.bool,
hasMore: PropTypes.bool,
intl: PropTypes.object.isRequired,
diff --git a/app/javascript/gabsocial/features/account_photo_gallery.js b/app/javascript/gabsocial/features/account_photo_gallery.js
index 71962f14..953616cb 100644
--- a/app/javascript/gabsocial/features/account_photo_gallery.js
+++ b/app/javascript/gabsocial/features/account_photo_gallery.js
@@ -74,7 +74,6 @@ class AccountPhotoGallery extends ImmutablePureComponent {
if (!account) return null
const hasAttachments = !!attachments ? attachments.size > 0 : false
- console.log("account, isLoading, attachments:", account, isLoading, attachments, hasAttachments)
return (
@@ -87,11 +86,11 @@ class AccountPhotoGallery extends ImmutablePureComponent {
title: 'All Photos',
to: `/${account.get('username')}/photos`,
},
- {
- title: 'Albums',
- isActive: true,
- to: `/${account.get('username')}/albums`,
- },
+ // {
+ // title: 'Albums',
+ // isActive: true,
+ // to: `/${account.get('username')}/albums`,
+ // },
]}/>
diff --git a/app/javascript/gabsocial/features/album_create.js b/app/javascript/gabsocial/features/album_create.js
index 387cbe3f..4cbcd162 100644
--- a/app/javascript/gabsocial/features/album_create.js
+++ b/app/javascript/gabsocial/features/album_create.js
@@ -8,35 +8,60 @@ import Button from '../components/button'
import Input from '../components/input'
import Form from '../components/form'
import Text from '../components/text'
+import Divider from '../components/divider'
+import Textarea from '../components/textarea'
class AlbumCreate extends React.PureComponent {
state = {
- value: '',
+ titleValue: '',
+ descriptionValue: '',
+ checked: false,
}
- onChange = (value) => {
- this.setState({ value })
+ onChangeTitle = (titleValue) => {
+ this.setState({ titleValue })
+ }
+
+ onChangeDescription = (descriptionValue) => {
+ this.setState({ descriptionValue })
}
handleOnSubmit = () => {
- this.props.onSubmit(this.state.value)
+ const { titleValue, descriptionValue, checked } = this.state
+ this.props.onSubmit(titleValue, descriptionValue, checked)
+ }
+
+ onTogglePrivacy = (checked) => {
+ this.setState({ checked })
}
render() {
- const { value } = this.state
+ const {
+ titleValue,
+ descriptionValue,
+ } = this.state
- const isDisabled = !value
+ const isDisabled = !titleValue
+
+ console.log("HELLO")
return (