Skip to content

Commit 8480d99

Browse files
committed
app: user info
1 parent 802c5b1 commit 8480d99

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/components/CommandPalette.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,23 @@ const CommandPalette = ({ isOpen, setIsOpen, openGenericModal, toggleDigitalRain
141141
case 'stopwatch':
142142
openGenericModal('Stopwatch', <Stopwatch />);
143143
break;
144+
case 'showOSInfo': {
145+
const osInfo = (
146+
<div>
147+
<p><strong>User Agent:</strong> {navigator.userAgent}</p>
148+
<br />
149+
<p><strong>Platform:</strong> {navigator.platform}</p>
150+
<br />
151+
<p><strong>App Version:</strong> {navigator.appVersion}</p>
152+
<br />
153+
<p><strong>Language:</strong> {navigator.language}</p>
154+
<br />
155+
<p><strong>Online:</strong> {navigator.onLine ? 'Yes' : 'No'}</p>
156+
</div>
157+
);
158+
openGenericModal('User/Browser Information', osInfo);
159+
break;
160+
}
144161
default:
145162
break;
146163
}

src/hooks/useSearchableData.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ const useSearchableData = () => {
8080
{ title: 'Generate Art', type: 'command', commandId: 'generateArt' },
8181
{ title: 'Leet Speak Transformer', type: 'command', commandId: 'leetTransformer' },
8282
{ title: 'Show Quick Stopwatch', type: 'command', commandId: 'stopwatch' },
83+
{ title: 'Show User/Browser Information', type: 'command', commandId: 'showOSInfo' },
8384
{ title: 'Her Daim', type: 'command', commandId: 'herDaim' },
8485
];
8586

0 commit comments

Comments
 (0)