new MediaAttachment video style :playable for mp4 to make videojs work with multiple files, hiding albums, hiding bookmark collections. may need tweaks on mediaattachment for mov and other formats : todo :
This commit is contained in:
mgabdev
2020-12-22 12:11:22 -05:00
parent 6fbea0a59e
commit 34f6a1ab5b
28 changed files with 259 additions and 138 deletions

View File

@@ -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 (
<Block>
@@ -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`,
// },
]}/>
</div>
@@ -82,10 +84,10 @@ class AccountAlbums extends ImmutablePureComponent {
{
hasAlbums &&
albums.map((albums, i) => (
albumIds.map((albumId, i) => (
<Album
key={album.get('id')}
album={album}
key={albumId}
albumId={albumId}
account={account}
/>
))
@@ -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,

View File

@@ -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 (
<Block>
@@ -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`,
// },
]}/>
</div>

View File

@@ -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 (
<Form>
<Input
title='Title'
placeholder='Album title'
value={value}
onChange={this.onChange}
value={titleValue}
onChange={this.onChangeTitle}
/>
<Divider isInvisible />
<Textarea
title='Description'
placeholder='Album description'
value={descriptionValue}
onChange={this.onChangeDescription}
/>
<Divider isInvisible />
<Button
isDisabled={isDisabled}
onClick={this.handleOnSubmit}
@@ -53,9 +78,9 @@ class AlbumCreate extends React.PureComponent {
}
const mapDispatchToProps = (dispatch, { isModal }) => ({
onSubmit(title) {
onSubmit(title, description, isPrivate) {
if (isModal) dispatch(closeModal())
dispatch(createBookmarkCollection(title))
dispatch(createAlbum(title, description, isPrivate))
},
})

View File

@@ -28,7 +28,7 @@ class ChatMessagesComposeForm extends React.PureComponent {
handleOnSendChatMessage = () => {
this.props.onSendChatMessage(this.state.value, this.props.chatConversationId)
// document.querySelector('#gabsocial').focus()
// this.onBlur()
this.onFocus()
this.setState({ value: '' })
}

View File

@@ -53,6 +53,7 @@ import DeckPage from '../../pages/deck_page'
import {
About,
AccountAlbums,
AccountAlbumGallery,
AccountPhotoGallery,
AccountVideoGallery,
AccountTimeline,
@@ -279,18 +280,18 @@ class SwitchingArea extends React.PureComponent {
<WrappedRoute path='/:username/following' page={ProfilePage} component={Following} content={children} />
<WrappedRoute path='/:username/photos' exact page={ProfilePage} component={AccountPhotoGallery} content={children} componentParams={{ noSidebar: true }} />
{ /* <WrappedRoute path='/:username/albums/:albumId' page={ProfilePage} component={AccountGallery} content={children} componentParams={{ noSidebar: true }} /> */ }
{ /* <WrappedRoute path='/:username/albums/:albumId' page={ProfilePage} component={AccountAlbumGallery} content={children} componentParams={{ noSidebar: true }} /> */ }
<WrappedRoute path='/:username/videos' exact page={ProfilePage} component={AccountVideoGallery} content={children} componentParams={{ noSidebar: true }} />
<WrappedRoute path='/:username/albums' exact page={ProfilePage} component={AccountAlbums} content={children} componentParams={{ noSidebar: true }} />
{ /* <WrappedRoute path='/:username/albums' exact page={ProfilePage} component={AccountAlbums} content={children} componentParams={{ noSidebar: true }} /> */ }
{ /* <WrappedRoute path='/:username/albums/create' exact page={ModalPage} component={AlbumCreate} content={children} componentParams={{ title: 'Create Album', page: 'create-album' }} /> */ }
{ /* <WrappedRoute path='/:username/albums/:albumId/edit' page={ModalPage} component={AlbumCreate} content={children} componentParams={{ title: 'Edit Album', page: 'edit-album' }} /> */ }
<WrappedRoute path='/:username/likes' page={ProfilePage} component={LikedStatuses} content={children} />
<WrappedRoute path='/:username/bookmark_collections/create' page={ModalPage} component={BookmarkCollectionCreate} content={children} componentParams={{ title: 'Create Bookmark Collection', page: 'create-bookmark-collection' }} />
<WrappedRoute path='/:username/bookmarks' page={ProfilePage} component={BookmarkedStatuses} content={children} />
{/*<WrappedRoute path='/:username/bookmark_collections/create' page={ModalPage} component={BookmarkCollectionCreate} content={children} componentParams={{ title: 'Create Bookmark Collection', page: 'create-bookmark-collection' }} />
<WrappedRoute path='/:username/bookmark_collections/:bookmarkCollectionId' page={ProfilePage} component={BookmarkedStatuses} content={children} />
<WrappedRoute path='/:username/bookmark_collections/:bookmarkCollectionId/edit' page={ModalPage} component={BookmarkCollectionCreate} content={children} componentParams={{ title: 'Edit Bookmark Collection', page: 'edit-bookmark-collection' }} />
<WrappedRoute path='/:username/bookmark_collections' page={ProfilePage} component={BookmarkCollections} content={children} />
<WrappedRoute path='/:username/bookmark_collections' page={ProfilePage} component={BookmarkCollections} content={children} />*/}
<WrappedRoute path='/:username/posts/:statusId' publicRoute exact page={BasicPage} component={StatusFeature} content={children} componentParams={{ title: 'Status', page: 'status' }} />