forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2477 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes up to 2e6bf60
- Loading branch information
Showing
101 changed files
with
828 additions
and
497 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
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 was deleted.
Oops, something went wrong.
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,45 @@ | ||
import { useCallback } from 'react'; | ||
|
||
import { FormattedMessage } from 'react-intl'; | ||
|
||
import { ReactComponent as ArrowBackIcon } from '@material-symbols/svg-600/outlined/arrow_back.svg'; | ||
|
||
import { Icon } from 'mastodon/components/icon'; | ||
import { ButtonInTabsBar } from 'mastodon/features/ui/util/columns_context'; | ||
|
||
import { useAppHistory } from './router'; | ||
|
||
type OnClickCallback = () => void; | ||
|
||
function useHandleClick(onClick?: OnClickCallback) { | ||
const history = useAppHistory(); | ||
|
||
return useCallback(() => { | ||
if (onClick) { | ||
onClick(); | ||
} else if (history.location.state?.fromMastodon) { | ||
history.goBack(); | ||
} else { | ||
history.push('/'); | ||
} | ||
}, [history, onClick]); | ||
} | ||
|
||
export const ColumnBackButton: React.FC<{ onClick: OnClickCallback }> = ({ | ||
onClick, | ||
}) => { | ||
const handleClick = useHandleClick(onClick); | ||
|
||
const component = ( | ||
<button onClick={handleClick} className='column-back-button'> | ||
<Icon | ||
id='chevron-left' | ||
icon={ArrowBackIcon} | ||
className='column-back-button__icon' | ||
/> | ||
<FormattedMessage id='column_back_button.label' defaultMessage='Back' /> | ||
</button> | ||
); | ||
|
||
return <ButtonInTabsBar>{component}</ButtonInTabsBar>; | ||
}; |
20 changes: 0 additions & 20 deletions
20
app/javascript/mastodon/components/column_back_button_slim.jsx
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.