Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Register
Sign in
Toggle navigation
Menu
Open sidebar
Tiger Ton
mastodon
Commits
5ea643b2
Unverified
Commit
5ea643b2
authored
6 years ago
by
Eugen Rochko
Committed by
GitHub
6 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Save onlyMedia prop when pinning column (#7575)
parent
40ef46db
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/javascript/mastodon/features/community_timeline/index.js
+9
-4
app/javascript/mastodon/features/community_timeline/index.js
app/javascript/mastodon/features/public_timeline/index.js
+9
-4
app/javascript/mastodon/features/public_timeline/index.js
app/javascript/mastodon/features/ui/components/columns_area.js
+2
-1
...avascript/mastodon/features/ui/components/columns_area.js
with
20 additions
and
9 deletions
+20
-9
app/javascript/mastodon/features/community_timeline/index.js
+
9
-
4
View file @
5ea643b2
import
React
from
'
react
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
defineMessages
,
injectIntl
,
FormattedMessage
}
from
'
react-intl
'
;
import
{
NavLink
}
from
'
react-router-dom
'
;
import
{
NavLink
,
Link
}
from
'
react-router-dom
'
;
import
PropTypes
from
'
prop-types
'
;
import
StatusListContainer
from
'
../ui/containers/status_list_container
'
;
import
Column
from
'
../../components/column
'
;
...
...
@@ -37,12 +37,12 @@ export default class CommunityTimeline extends React.PureComponent {
};
handlePin
=
()
=>
{
const
{
columnId
,
dispatch
}
=
this
.
props
;
const
{
columnId
,
dispatch
,
onlyMedia
}
=
this
.
props
;
if
(
columnId
)
{
dispatch
(
removeColumn
(
columnId
));
}
else
{
dispatch
(
addColumn
(
'
COMMUNITY
'
,
{}));
dispatch
(
addColumn
(
'
COMMUNITY
'
,
{
other
:
{
onlyMedia
}
}));
}
}
...
...
@@ -83,7 +83,12 @@ export default class CommunityTimeline extends React.PureComponent {
const
{
intl
,
hasUnread
,
columnId
,
multiColumn
,
onlyMedia
}
=
this
.
props
;
const
pinned
=
!!
columnId
;
const
headline
=
(
const
headline
=
pinned
?
(
<
div
className
=
'
community-timeline__section-headline
'
>
<
Link
to
=
'
/timelines/public/local
'
replace
className
=
{
!
onlyMedia
?
'
active
'
:
undefined
}
><
FormattedMessage
id
=
'
timeline.posts
'
defaultMessage
=
'
Toots
'
/><
/Link
>
<
Link
to
=
'
/timelines/public/local/media
'
replace
className
=
{
onlyMedia
?
'
active
'
:
undefined
}
><
FormattedMessage
id
=
'
timeline.media
'
defaultMessage
=
'
Media
'
/><
/Link
>
<
/div
>
)
:
(
<
div
className
=
'
community-timeline__section-headline
'
>
<
NavLink
exact
to
=
'
/timelines/public/local
'
replace
><
FormattedMessage
id
=
'
timeline.posts
'
defaultMessage
=
'
Toots
'
/><
/NavLink
>
<
NavLink
exact
to
=
'
/timelines/public/local/media
'
replace
><
FormattedMessage
id
=
'
timeline.media
'
defaultMessage
=
'
Media
'
/><
/NavLink
>
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/features/public_timeline/index.js
+
9
-
4
View file @
5ea643b2
import
React
from
'
react
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
defineMessages
,
injectIntl
,
FormattedMessage
}
from
'
react-intl
'
;
import
{
NavLink
}
from
'
react-router-dom
'
;
import
{
NavLink
,
Link
}
from
'
react-router-dom
'
;
import
PropTypes
from
'
prop-types
'
;
import
StatusListContainer
from
'
../ui/containers/status_list_container
'
;
import
Column
from
'
../../components/column
'
;
...
...
@@ -37,12 +37,12 @@ export default class PublicTimeline extends React.PureComponent {
};
handlePin
=
()
=>
{
const
{
columnId
,
dispatch
}
=
this
.
props
;
const
{
columnId
,
dispatch
,
onlyMedia
}
=
this
.
props
;
if
(
columnId
)
{
dispatch
(
removeColumn
(
columnId
));
}
else
{
dispatch
(
addColumn
(
'
PUBLIC
'
,
{}));
dispatch
(
addColumn
(
'
PUBLIC
'
,
{
other
:
{
onlyMedia
}
}));
}
}
...
...
@@ -83,7 +83,12 @@ export default class PublicTimeline extends React.PureComponent {
const
{
intl
,
columnId
,
hasUnread
,
multiColumn
,
onlyMedia
}
=
this
.
props
;
const
pinned
=
!!
columnId
;
const
headline
=
(
const
headline
=
pinned
?
(
<
div
className
=
'
public-timeline__section-headline
'
>
<
Link
to
=
'
/timelines/public
'
replace
className
=
{
!
onlyMedia
?
'
active
'
:
undefined
}
><
FormattedMessage
id
=
'
timeline.posts
'
defaultMessage
=
'
Toots
'
/><
/Link
>
<
Link
to
=
'
/timelines/public/media
'
replace
className
=
{
onlyMedia
?
'
active
'
:
undefined
}
><
FormattedMessage
id
=
'
timeline.media
'
defaultMessage
=
'
Media
'
/><
/Link
>
<
/div
>
)
:
(
<
div
className
=
'
public-timeline__section-headline
'
>
<
NavLink
exact
to
=
'
/timelines/public
'
replace
><
FormattedMessage
id
=
'
timeline.posts
'
defaultMessage
=
'
Toots
'
/><
/NavLink
>
<
NavLink
exact
to
=
'
/timelines/public/media
'
replace
><
FormattedMessage
id
=
'
timeline.media
'
defaultMessage
=
'
Media
'
/><
/NavLink
>
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/features/ui/components/columns_area.js
+
2
-
1
View file @
5ea643b2
...
...
@@ -175,10 +175,11 @@ export default class ColumnsArea extends ImmutablePureComponent {
<
div
className
=
{
`columns-area
${
isModalOpen
?
'
unscrollable
'
:
''
}
`
}
ref
=
{
this
.
setRef
}
>
{
columns
.
map
(
column
=>
{
const
params
=
column
.
get
(
'
params
'
,
null
)
===
null
?
null
:
column
.
get
(
'
params
'
).
toJS
();
const
other
=
params
&&
params
.
other
?
params
.
other
:
{};
return
(
<
BundleContainer
key
=
{
column
.
get
(
'
uuid
'
)}
fetchComponent
=
{
componentMap
[
column
.
get
(
'
id
'
)]}
loading
=
{
this
.
renderLoading
(
column
.
get
(
'
id
'
))}
error
=
{
this
.
renderError
}
>
{
SpecificComponent
=>
<
SpecificComponent
columnId
=
{
column
.
get
(
'
uuid
'
)}
params
=
{
params
}
multiColumn
/>
}
{
SpecificComponent
=>
<
SpecificComponent
columnId
=
{
column
.
get
(
'
uuid
'
)}
params
=
{
params
}
multiColumn
{...
other
}
/>
}
<
/BundleContainer
>
);
})}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment