mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-23 22:14:42 +01:00
28 lines
612 B
React
28 lines
612 B
React
|
import openCompose from '../utils/open-compose';
|
||
|
import states from '../utils/states';
|
||
|
|
||
|
import Icon from './icon';
|
||
|
|
||
|
export default function ComposeButton() {
|
||
|
return (
|
||
|
<button
|
||
|
type="button"
|
||
|
id="compose-button"
|
||
|
onClick={(e) => {
|
||
|
if (e.shiftKey) {
|
||
|
const newWin = openCompose();
|
||
|
|
||
|
if (!newWin) {
|
||
|
alert('Looks like your browser is blocking popups.');
|
||
|
states.showCompose = true;
|
||
|
}
|
||
|
} else {
|
||
|
states.showCompose = true;
|
||
|
}
|
||
|
}}
|
||
|
>
|
||
|
<Icon icon="quill" size="xl" alt="Compose" />
|
||
|
</button>
|
||
|
);
|
||
|
}
|