Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Register
Sign in
Toggle navigation
Menu
Open sidebar
Tiger Ton
mastodon
Commits
7c12c7b1
Commit
7c12c7b1
authored
6 years ago
by
Frederic Hemberger
Committed by
Eugen Rochko
6 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Add aria-label to floatingActionButton (#8574)
parent
988befb0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/javascript/mastodon/features/ui/components/columns_area.js
+7
-3
...avascript/mastodon/features/ui/components/columns_area.js
with
7 additions
and
3 deletions
+7
-3
app/javascript/mastodon/features/ui/components/columns_area.js
+
7
-
3
View file @
7c12c7b1
import
React
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
{
injectIntl
}
from
'
react-intl
'
;
import
{
defineMessages
,
injectIntl
}
from
'
react-intl
'
;
import
ImmutablePropTypes
from
'
react-immutable-proptypes
'
;
import
ImmutablePureComponent
from
'
react-immutable-pure-component
'
;
...
...
@@ -29,6 +29,10 @@ const componentMap = {
'
LIST
'
:
ListTimeline
,
};
const
messages
=
defineMessages
({
publish
:
{
id
:
'
compose_form.publish
'
,
defaultMessage
:
'
Toot
'
},
});
const
shouldHideFAB
=
path
=>
path
.
match
(
/^
\/
statuses
\/
/
);
@
component
=>
injectIntl
(
component
,
{
withRef
:
true
})
...
...
@@ -149,14 +153,14 @@ export default class ColumnsArea extends ImmutablePureComponent {
}
render
()
{
const
{
columns
,
children
,
singleColumn
,
isModalOpen
}
=
this
.
props
;
const
{
columns
,
children
,
singleColumn
,
isModalOpen
,
intl
}
=
this
.
props
;
const
{
shouldAnimate
}
=
this
.
state
;
const
columnIndex
=
getIndex
(
this
.
context
.
router
.
history
.
location
.
pathname
);
this
.
pendingIndex
=
null
;
if
(
singleColumn
)
{
const
floatingActionButton
=
shouldHideFAB
(
this
.
context
.
router
.
history
.
location
.
pathname
)
?
null
:
<
Link
key
=
'
floating-action-button
'
to
=
'
/statuses/new
'
className
=
'
floating-action-button
'
><
i
className
=
'
fa fa-pencil
'
/><
/Link>
;
const
floatingActionButton
=
shouldHideFAB
(
this
.
context
.
router
.
history
.
location
.
pathname
)
?
null
:
<
Link
key
=
'
floating-action-button
'
to
=
'
/statuses/new
'
className
=
'
floating-action-button
'
aria
-
label
=
{
intl
.
formatMessage
(
messages
.
publish
)}
><
i
className
=
'
fa fa-pencil
'
/><
/Link>
;
return
columnIndex
!==
-
1
?
[
<
ReactSwipeableViews
key
=
'
content
'
index
=
{
columnIndex
}
onChangeIndex
=
{
this
.
handleSwipe
}
onTransitionEnd
=
{
this
.
handleAnimationEnd
}
animateTransitions
=
{
shouldAnimate
}
springConfig
=
{{
duration
:
'
400ms
'
,
delay
:
'
0s
'
,
easeFunction
:
'
ease
'
}}
style
=
{{
height
:
'
100%
'
}}
>
...
...
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
Menu
Explore
Projects
Groups
Snippets