mirror of
https://github.com/mue/mue.git
synced 2026-07-14 04:24:01 +02:00
fix: link modal button size & email share
Co-authored-by: David Ralph <me@davidcralph.co.uk>
This commit is contained in:
@@ -4,6 +4,7 @@ import { useState, memo } from 'react';
|
||||
import { TextareaAutosize } from '@mui/material';
|
||||
import { MdAddLink, MdClose } from 'react-icons/md';
|
||||
import { Tooltip } from 'components/Elements';
|
||||
import { Button } from 'components/Elements';
|
||||
|
||||
function AddModal({ urlError, iconError, addLink, closeModal, edit, editData, editLink }) {
|
||||
const [name, setName] = useState(edit ? editData.name : '');
|
||||
@@ -51,26 +52,9 @@ function AddModal({ urlError, iconError, addLink, closeModal, edit, editData, ed
|
||||
{iconError} {urlError}
|
||||
</span>
|
||||
{edit ? (
|
||||
<button
|
||||
style={{
|
||||
height: '16px',
|
||||
fontSize: '15px',
|
||||
}}
|
||||
onClick={() => editLink(editData, name, url, icon)}
|
||||
>
|
||||
<MdAddLink /> {variables.getMessage('modals.main.settings.sections.quicklinks.edit')}
|
||||
</button>
|
||||
<Button type="settings" onClick={() => editLink(editData, name, url, icon)} icon={<MdAddLink />} label={variables.getMessage('modals.main.settings.sections.quicklinks.edit')} />
|
||||
) : (
|
||||
<button
|
||||
style={{
|
||||
height: '16px',
|
||||
fontSize: '15px',
|
||||
}}
|
||||
className="btn-settings"
|
||||
onClick={() => addLink(name, url, icon)}
|
||||
>
|
||||
<MdAddLink /> {variables.getMessage('widgets.quicklinks.add')}
|
||||
</button>
|
||||
<Button type="settings" onClick={() => addLink(name, url, icon)} icon={<MdAddLink />} label={variables.getMessage('widgets.quicklinks.add')} />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -31,7 +31,7 @@ function ShareModal({ modalClose, data }) {
|
||||
|
||||
const copyLink = () => {
|
||||
navigator.clipboard.writeText(data.url);
|
||||
toast(variables.getMessage('modals.share.copy_link'));
|
||||
toast(data.startsWith('"') ? variables.getMessage('toasts.quote') : variables.getMessage('toasts.link_copied'));
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -73,9 +73,9 @@ function ShareModal({ modalClose, data }) {
|
||||
window
|
||||
.open(
|
||||
'mailto:email@example.com?subject=Check%20out%20this%20%on%20%Mue!&body=' +
|
||||
data.data.name +
|
||||
data.name +
|
||||
'on Mue: ' +
|
||||
data,
|
||||
data.url,
|
||||
'_blank',
|
||||
)
|
||||
.focus()
|
||||
|
||||
Reference in New Issue
Block a user