forked from glitch-soc/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Lots from mathtex being coded in a shitty olde javascript style - Fix one use of "favourite" that is still in upstream - Revert changes to add exclusive to lists migrations - rails 7 wants us to do it in a different way, but upstream is still using 6.1, so undo those changes and use the masto migration helpers instead to match upstream behavior - fix repeated tests in exclusive lists spec
- Loading branch information
1 parent
4ed02ee
commit 9c2f74f
Showing
33 changed files
with
222 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 0 additions & 71 deletions
71
app/javascript/flavours/glitch/components/status_expand_button.js
This file was deleted.
Oops, something went wrong.
73 changes: 73 additions & 0 deletions
73
app/javascript/flavours/glitch/components/status_expand_button.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import PropTypes from 'prop-types'; | ||
import React, { useState, useEffect } from 'react'; | ||
|
||
import { FormattedMessage } from 'react-intl'; | ||
|
||
import { Icon } from './icon'; | ||
|
||
const makeToggleText = (hidden, mediaIcons) => { | ||
let newText; | ||
if (hidden) { | ||
newText = [ | ||
<FormattedMessage | ||
id='status.show_more' | ||
defaultMessage='Show more' | ||
key='0' | ||
/>, | ||
]; | ||
if (mediaIcons) { | ||
mediaIcons.forEach((mediaIcon, idx) => { | ||
newText.push( | ||
<Icon | ||
fixedWidth | ||
className='status__content__spoiler-icon' | ||
id={mediaIcon} | ||
aria-hidden='true' | ||
key={`icon-${idx}`} | ||
/>, | ||
); | ||
}); | ||
} | ||
} else { | ||
newText = ( | ||
<FormattedMessage | ||
id='status.show_less' | ||
defaultMessage='Show less' | ||
key='0' | ||
/> | ||
); | ||
} | ||
return(newText); | ||
}; | ||
|
||
const StatusExpandButton=( | ||
{ | ||
hidden, | ||
handleSpoilerClick, | ||
mediaIcons, | ||
}, | ||
)=>{ | ||
|
||
|
||
// const [hidden, setHidden] = useState(false); | ||
const [toggleText, setToggleText] = useState(makeToggleText()); | ||
|
||
// Change the text when the hidden state changes | ||
useEffect(() => { | ||
setToggleText(makeToggleText(hidden, mediaIcons)); | ||
}, [hidden, mediaIcons]); | ||
|
||
return( | ||
<button type='button' className='status__content__spoiler-link' onClick={handleSpoilerClick} aria-expanded={!hidden}> | ||
{toggleText} | ||
</button> | ||
); | ||
}; | ||
|
||
StatusExpandButton.propTypes = { | ||
hidden: PropTypes.bool, | ||
handleSpoilerClick: PropTypes.func, | ||
mediaIcons: PropTypes.arrayOf(PropTypes.string), | ||
}; | ||
|
||
export default StatusExpandButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
app/javascript/flavours/glitch/features/compose/containers/latex_dropdown_container.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.