Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
doums committed Jan 17, 2025
1 parent d30b44d commit a29ef74
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
17 changes: 12 additions & 5 deletions nym-vpn-app/src/hooks/useClipboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,20 @@ function useClipboard() {
const { t } = useTranslation('notifications');

// Writes text to the clipboard
const copy = async (text: string, ntfyPosition: 'top' | 'bottom' = 'top') => {
const copy = async (
text: string,
notify = true,
ntfyPosition: 'top' | 'bottom' = 'top',
) => {
try {
await writeText(text);
push({
text: t('copied-to-clipboard'),
position: ntfyPosition,
});
if (notify) {
push({
text: t('copied-to-clipboard'),
position: ntfyPosition,
clickAway: true,
});
}
} catch (e) {
console.error('failed to copy to clipboard', e);
}
Expand Down
2 changes: 1 addition & 1 deletion nym-vpn-app/src/screens/settings/dev/Dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function Dev() {
};

return (
<PageAnim className="h-full flex flex-col py-6 gap-6">
<PageAnim className="h-full flex flex-col py-6 gap-6 select-none cursor-default">
<SettingsMenuCard
title={'CREDENTIALS_MODE'}
onClick={() => credentialsModeChanged(!credentialsMode)}
Expand Down
1 change: 0 additions & 1 deletion nym-vpn-app/src/screens/settings/dev/NetworkEnvSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ function NetworkEnvSelect({ current }: Props) {
onChange={(e) => {
handleOnSelect(e.target.value as NetworkEnv);
}}
autoFocus
>
{options.map(({ value, label }) => (
<option key={value} value={value}>
Expand Down
2 changes: 1 addition & 1 deletion nym-vpn-app/src/screens/settings/info-data/InfoData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function InfoData() {
<div className={clsx('flex flex-row flex-nowrap gap-1')}>
<p className="text-nowrap">{t('info.client-version')}</p>
<ButtonText
onClick={() => copy(version || '')}
onClick={() => copy(version || '', S_STATE.devMode && false)}
onDoubleClick={() => S_STATE.devMode && navigate(routes.dev)}
truncate
>
Expand Down

0 comments on commit a29ef74

Please sign in to comment.