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
83b21e90
Commit
83b21e90
authored
3 years ago
by
Yamagishi Kazutoshi
Committed by
GitHub
2 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Bump React from 16.14.0 to 18.1.0
parent
f804c009
Changes
226
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
app/javascript/mastodon/components/load_gap.js
+2
-2
app/javascript/mastodon/components/load_gap.js
app/javascript/mastodon/components/load_more.js
+2
-2
app/javascript/mastodon/components/load_more.js
app/javascript/mastodon/components/load_pending.js
+2
-2
app/javascript/mastodon/components/load_pending.js
app/javascript/mastodon/components/loading_indicator.js
+0
-1
app/javascript/mastodon/components/loading_indicator.js
app/javascript/mastodon/components/logo.js
+0
-2
app/javascript/mastodon/components/logo.js
app/javascript/mastodon/components/media_attachments.js
+0
-1
app/javascript/mastodon/components/media_attachments.js
app/javascript/mastodon/components/media_gallery.js
+4
-4
app/javascript/mastodon/components/media_gallery.js
app/javascript/mastodon/components/missing_indicator.js
+0
-1
app/javascript/mastodon/components/missing_indicator.js
app/javascript/mastodon/components/modal_root.js
+3
-3
app/javascript/mastodon/components/modal_root.js
app/javascript/mastodon/components/permalink.js
+2
-2
app/javascript/mastodon/components/permalink.js
app/javascript/mastodon/components/picture_in_picture_placeholder.js
+2
-2
...ipt/mastodon/components/picture_in_picture_placeholder.js
app/javascript/mastodon/components/poll.js
+0
-1
app/javascript/mastodon/components/poll.js
app/javascript/mastodon/components/radio_button.js
+2
-2
app/javascript/mastodon/components/radio_button.js
app/javascript/mastodon/components/regeneration_indicator.js
+0
-1
app/javascript/mastodon/components/regeneration_indicator.js
app/javascript/mastodon/components/relative_timestamp.js
+4
-4
app/javascript/mastodon/components/relative_timestamp.js
app/javascript/mastodon/components/scrollable_list.js
+6
-6
app/javascript/mastodon/components/scrollable_list.js
app/javascript/mastodon/components/setting_text.js
+2
-2
app/javascript/mastodon/components/setting_text.js
app/javascript/mastodon/components/short_number.js
+2
-2
app/javascript/mastodon/components/short_number.js
app/javascript/mastodon/components/skeleton.js
+0
-1
app/javascript/mastodon/components/skeleton.js
app/javascript/mastodon/components/status.js
+0
-1
app/javascript/mastodon/components/status.js
with
33 additions
and
42 deletions
+33
-42
app/javascript/mastodon/components/load_gap.js
+
2
-
2
View file @
83b21e90
import
React
from
'
react
'
;
import
{
PureComponent
}
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
{
injectIntl
,
defineMessages
}
from
'
react-intl
'
;
import
Icon
from
'
mastodon/components/icon
'
;
...
...
@@ -8,7 +8,7 @@ const messages = defineMessages({
});
export
default
@
injectIntl
class
LoadGap
extends
React
.
PureComponent
{
class
LoadGap
extends
PureComponent
{
static
propTypes
=
{
disabled
:
PropTypes
.
bool
,
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/load_more.js
+
2
-
2
View file @
83b21e90
import
React
from
'
react
'
;
import
{
PureComponent
}
from
'
react
'
;
import
{
FormattedMessage
}
from
'
react-intl
'
;
import
PropTypes
from
'
prop-types
'
;
export
default
class
LoadMore
extends
React
.
PureComponent
{
export
default
class
LoadMore
extends
PureComponent
{
static
propTypes
=
{
onClick
:
PropTypes
.
func
,
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/load_pending.js
+
2
-
2
View file @
83b21e90
import
React
from
'
react
'
;
import
{
PureComponent
}
from
'
react
'
;
import
{
FormattedMessage
}
from
'
react-intl
'
;
import
PropTypes
from
'
prop-types
'
;
export
default
class
LoadPending
extends
React
.
PureComponent
{
export
default
class
LoadPending
extends
PureComponent
{
static
propTypes
=
{
onClick
:
PropTypes
.
func
,
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/loading_indicator.js
+
0
-
1
View file @
83b21e90
import
React
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
export
const
CircularProgress
=
({
size
,
strokeWidth
})
=>
{
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/logo.js
+
0
-
2
View file @
83b21e90
import
React
from
'
react
'
;
const
Logo
=
()
=>
(
<
svg
viewBox
=
'
0 0 216.4144 232.00976
'
className
=
'
logo
'
>
<
use
xlinkHref
=
'
#mastodon-svg-logo
'
/>
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/media_attachments.js
+
0
-
1
View file @
83b21e90
import
React
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
ImmutablePropTypes
from
'
react-immutable-proptypes
'
;
import
ImmutablePureComponent
from
'
react-immutable-pure-component
'
;
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/media_gallery.js
+
4
-
4
View file @
83b21e90
import
React
from
'
react
'
;
import
{
PureComponent
}
from
'
react
'
;
import
ImmutablePropTypes
from
'
react-immutable-proptypes
'
;
import
PropTypes
from
'
prop-types
'
;
import
{
is
}
from
'
immutable
'
;
...
...
@@ -14,7 +14,7 @@ const messages = defineMessages({
toggle_visible
:
{
id
:
'
media_gallery.toggle_visible
'
,
defaultMessage
:
'
{number, plural, one {Hide image} other {Hide images}}
'
},
});
class
Item
extends
React
.
PureComponent
{
class
Item
extends
PureComponent
{
static
propTypes
=
{
attachment
:
ImmutablePropTypes
.
map
.
isRequired
,
...
...
@@ -221,7 +221,7 @@ class Item extends React.PureComponent {
}
export
default
@
injectIntl
class
MediaGallery
extends
React
.
PureComponent
{
class
MediaGallery
extends
PureComponent
{
static
propTypes
=
{
sensitive
:
PropTypes
.
bool
,
...
...
@@ -255,7 +255,7 @@ class MediaGallery extends React.PureComponent {
window
.
removeEventListener
(
'
resize
'
,
this
.
handleResize
);
}
componentWillReceiveProps
(
nextProps
)
{
UNSAFE_
componentWillReceiveProps
(
nextProps
)
{
if
(
!
is
(
nextProps
.
media
,
this
.
props
.
media
)
&&
nextProps
.
visible
===
undefined
)
{
this
.
setState
({
visible
:
displayMedia
!==
'
hide_all
'
&&
!
nextProps
.
sensitive
||
displayMedia
===
'
show_all
'
});
}
else
if
(
!
is
(
nextProps
.
visible
,
this
.
props
.
visible
)
&&
nextProps
.
visible
!==
undefined
)
{
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/missing_indicator.js
+
0
-
1
View file @
83b21e90
import
React
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
{
FormattedMessage
}
from
'
react-intl
'
;
import
illustration
from
'
mastodon/../images/elephant_ui_disappointed.svg
'
;
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/modal_root.js
+
3
-
3
View file @
83b21e90
import
React
from
'
react
'
;
import
{
PureComponent
}
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
'
wicg-inert
'
;
import
{
createBrowserHistory
}
from
'
history
'
;
import
{
multiply
}
from
'
color-blend
'
;
export
default
class
ModalRoot
extends
React
.
PureComponent
{
export
default
class
ModalRoot
extends
PureComponent
{
static
contextTypes
=
{
router
:
PropTypes
.
object
,
...
...
@@ -57,7 +57,7 @@ export default class ModalRoot extends React.PureComponent {
this
.
history
=
this
.
context
.
router
?
this
.
context
.
router
.
history
:
createBrowserHistory
();
}
componentWillReceiveProps
(
nextProps
)
{
UNSAFE_
componentWillReceiveProps
(
nextProps
)
{
if
(
!!
nextProps
.
children
&&
!
this
.
props
.
children
)
{
this
.
activeElement
=
document
.
activeElement
;
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/permalink.js
+
2
-
2
View file @
83b21e90
import
React
from
'
react
'
;
import
{
PureComponent
}
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
export
default
class
Permalink
extends
React
.
PureComponent
{
export
default
class
Permalink
extends
PureComponent
{
static
contextTypes
=
{
router
:
PropTypes
.
object
,
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/picture_in_picture_placeholder.js
+
2
-
2
View file @
83b21e90
import
React
from
'
react
'
;
import
{
PureComponent
}
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
Icon
from
'
mastodon/components/icon
'
;
import
{
removePictureInPicture
}
from
'
mastodon/actions/picture_in_picture
'
;
...
...
@@ -7,7 +7,7 @@ import { debounce } from 'lodash';
import
{
FormattedMessage
}
from
'
react-intl
'
;
export
default
@
connect
()
class
PictureInPicturePlaceholder
extends
React
.
PureComponent
{
class
PictureInPicturePlaceholder
extends
PureComponent
{
static
propTypes
=
{
width
:
PropTypes
.
number
,
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/poll.js
+
0
-
1
View file @
83b21e90
import
React
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
ImmutablePropTypes
from
'
react-immutable-proptypes
'
;
import
ImmutablePureComponent
from
'
react-immutable-pure-component
'
;
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/radio_button.js
+
2
-
2
View file @
83b21e90
import
React
from
'
react
'
;
import
{
PureComponent
}
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
classNames
from
'
classnames
'
;
export
default
class
RadioButton
extends
React
.
PureComponent
{
export
default
class
RadioButton
extends
PureComponent
{
static
propTypes
=
{
value
:
PropTypes
.
string
.
isRequired
,
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/regeneration_indicator.js
+
0
-
1
View file @
83b21e90
import
React
from
'
react
'
;
import
{
FormattedMessage
}
from
'
react-intl
'
;
import
illustration
from
'
mastodon/../images/elephant_ui_working.svg
'
;
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/relative_timestamp.js
+
4
-
4
View file @
83b21e90
import
React
from
'
react
'
;
import
{
Component
}
from
'
react
'
;
import
{
injectIntl
,
defineMessages
}
from
'
react-intl
'
;
import
PropTypes
from
'
prop-types
'
;
...
...
@@ -122,7 +122,7 @@ const timeRemainingString = (intl, date, now, timeGiven = true) => {
};
export
default
@
injectIntl
class
RelativeTimestamp
extends
React
.
Component
{
class
RelativeTimestamp
extends
Component
{
static
propTypes
=
{
intl
:
PropTypes
.
object
.
isRequired
,
...
...
@@ -149,7 +149,7 @@ class RelativeTimestamp extends React.Component {
this
.
state
.
now
!==
nextState
.
now
;
}
componentWillReceiveProps
(
nextProps
)
{
UNSAFE_
componentWillReceiveProps
(
nextProps
)
{
if
(
this
.
props
.
timestamp
!==
nextProps
.
timestamp
)
{
this
.
setState
({
now
:
this
.
props
.
intl
.
now
()
});
}
...
...
@@ -159,7 +159,7 @@ class RelativeTimestamp extends React.Component {
this
.
_scheduleNextUpdate
(
this
.
props
,
this
.
state
);
}
componentWillUpdate
(
nextProps
,
nextState
)
{
UNSAFE_
componentWillUpdate
(
nextProps
,
nextState
)
{
this
.
_scheduleNextUpdate
(
nextProps
,
nextState
);
}
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/scrollable_list.js
+
6
-
6
View file @
83b21e90
import
React
,
{
PureCompon
ent
}
from
'
react
'
;
import
{
Children
,
PureComponent
,
cloneElem
ent
}
from
'
react
'
;
import
ScrollContainer
from
'
mastodon/containers/scroll_container
'
;
import
PropTypes
from
'
prop-types
'
;
import
IntersectionObserverArticleContainer
from
'
../containers/intersection_observer_article_container
'
;
...
...
@@ -182,8 +182,8 @@ class ScrollableList extends PureComponent {
}
getSnapshotBeforeUpdate
(
prevProps
)
{
const
someItemInserted
=
React
.
Children
.
count
(
prevProps
.
children
)
>
0
&&
React
.
Children
.
count
(
prevProps
.
children
)
<
React
.
Children
.
count
(
this
.
props
.
children
)
&&
const
someItemInserted
=
Children
.
count
(
prevProps
.
children
)
>
0
&&
Children
.
count
(
prevProps
.
children
)
<
Children
.
count
(
this
.
props
.
children
)
&&
this
.
getFirstChildKey
(
prevProps
)
!==
this
.
getFirstChildKey
(
this
.
props
);
const
pendingChanged
=
(
prevProps
.
numPending
>
0
)
!==
(
this
.
props
.
numPending
>
0
);
...
...
@@ -291,7 +291,7 @@ class ScrollableList extends PureComponent {
render
()
{
const
{
children
,
scrollKey
,
trackScroll
,
showLoading
,
isLoading
,
hasMore
,
numPending
,
prepend
,
alwaysPrepend
,
append
,
emptyMessage
,
onLoadMore
}
=
this
.
props
;
const
{
fullscreen
}
=
this
.
state
;
const
childrenCount
=
React
.
Children
.
count
(
children
);
const
childrenCount
=
Children
.
count
(
children
);
const
loadMore
=
(
hasMore
&&
onLoadMore
)
?
<
LoadMore
visible
=
{
!
isLoading
}
onClick
=
{
this
.
handleLoadMore
}
/> : null
;
const
loadPending
=
(
numPending
>
0
)
?
<
LoadPending
count
=
{
numPending
}
onClick
=
{
this
.
handleLoadPending
}
/> : null
;
...
...
@@ -317,7 +317,7 @@ class ScrollableList extends PureComponent {
{
loadPending
}
{
React
.
Children
.
map
(
this
.
props
.
children
,
(
child
,
index
)
=>
(
{
Children
.
map
(
this
.
props
.
children
,
(
child
,
index
)
=>
(
<
IntersectionObserverArticleContainer
key
=
{
child
.
key
}
id
=
{
child
.
key
}
...
...
@@ -326,7 +326,7 @@ class ScrollableList extends PureComponent {
intersectionObserverWrapper
=
{
this
.
intersectionObserverWrapper
}
saveHeightKey
=
{
trackScroll
?
`
${
this
.
context
.
router
.
route
.
location
.
key
}
:
${
scrollKey
}
`
:
null
}
>
{
React
.
cloneElement
(
child
,
{
{
cloneElement
(
child
,
{
getScrollPosition
:
this
.
getScrollPosition
,
updateScrollBottom
:
this
.
updateScrollBottom
,
cachedMediaWidth
:
this
.
state
.
cachedMediaWidth
,
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/setting_text.js
+
2
-
2
View file @
83b21e90
import
React
from
'
react
'
;
import
{
PureComponent
}
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
ImmutablePropTypes
from
'
react-immutable-proptypes
'
;
export
default
class
SettingText
extends
React
.
PureComponent
{
export
default
class
SettingText
extends
PureComponent
{
static
propTypes
=
{
settings
:
ImmutablePropTypes
.
map
.
isRequired
,
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/short_number.js
+
2
-
2
View file @
83b21e90
import
React
from
'
react
'
;
import
{
memo
}
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
{
toShortNumber
,
pluralReady
,
DECIMAL_UNITS
}
from
'
../utils/numbers
'
;
import
{
FormattedMessage
,
FormattedNumber
}
from
'
react-intl
'
;
...
...
@@ -114,4 +114,4 @@ ShortNumberCounter.propTypes = {
value
:
PropTypes
.
arrayOf
(
PropTypes
.
number
),
};
export
default
React
.
memo
(
ShortNumber
);
export
default
memo
(
ShortNumber
);
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/skeleton.js
+
0
-
1
View file @
83b21e90
import
React
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
const
Skeleton
=
({
width
,
height
})
=>
<
span
className
=
'
skeleton
'
style
=
{{
width
,
height
}}
>&
zwnj
;
<
/span>
;
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/status.js
+
0
-
1
View file @
83b21e90
import
React
from
'
react
'
;
import
ImmutablePropTypes
from
'
react-immutable-proptypes
'
;
import
PropTypes
from
'
prop-types
'
;
import
Avatar
from
'
./avatar
'
;
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
3
4
5
6
7
…
12
Next
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