mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-05 06:28:51 +00:00
tweak(phone/settings): Enabled copy and paste for number
This commit is contained in:
1 parent
ef30daeb65
commit
d5d483eee8
1 file changed
+11
-11
@@ -29,6 +29,8 @@ import {
|
|||||||
|
|
||||||
import { ListSubheader } from '@material-ui/core';
|
import { ListSubheader } from '@material-ui/core';
|
||||||
import { useSettings } from '../hooks/useSettings';
|
import { useSettings } from '../hooks/useSettings';
|
||||||
|
import { setClipboard } from '../../../os/phone/hooks/useClipboard';
|
||||||
|
import { useSnackbar } from '../../../ui/hooks/useSnackbar';
|
||||||
|
|
||||||
const SubHeaderComp = (props: { text: string }) => (
|
const SubHeaderComp = (props: { text: string }) => (
|
||||||
<ListSubheader color="primary" component="div" disableSticky>
|
<ListSubheader color="primary" component="div" disableSticky>
|
||||||
@@ -42,8 +44,8 @@ export const SettingsApp = () => {
|
|||||||
const simcard = useSimcard();
|
const simcard = useSimcard();
|
||||||
const [settings, setSettings] = useSettings();
|
const [settings, setSettings] = useSettings();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
// TODO: Uncomment when #135 is merged
|
|
||||||
// const { addAlert } = useSnackbar();
|
const { addAlert } = useSnackbar();
|
||||||
|
|
||||||
const handleSettingChange = (key: string | number, value: unknown) => {
|
const handleSettingChange = (key: string | number, value: unknown) => {
|
||||||
setSettings({ ...settings, [key]: value });
|
setSettings({ ...settings, [key]: value });
|
||||||
@@ -85,15 +87,13 @@ export const SettingsApp = () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const handleCopyPhoneNumber = () => {
|
const handleCopyPhoneNumber = () => {
|
||||||
// TODO: Dependent on #132 merge
|
setClipboard(simcard.number);
|
||||||
// setClipboard(simcard.number)
|
addAlert({
|
||||||
// TODO: Dependent on #135 merge
|
message: t('GENERIC_WRITE_TO_CLIPBOARD_MESSAGE', {
|
||||||
// addAlert({
|
content: 'number',
|
||||||
// message: t('GENERIC_WRITE_TO_CLIPBOARD_MESSAGE', {
|
}),
|
||||||
// content: 'number',
|
type: 'success',
|
||||||
// }),
|
});
|
||||||
// type: 'success',
|
|
||||||
// });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const [openMenu, closeMenu, ContextMenu, isMenuOpen] = useContextMenu();
|
const [openMenu, closeMenu, ContextMenu, isMenuOpen] = useContextMenu();
|
||||||
|
|||||||
Reference in new issue
Block a user