1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00

Use material symbols in session icons

This commit is contained in:
Matt Jankowski 2024-08-09 13:36:11 -04:00
parent 4153d3adbd
commit c2a83e56d0
6 changed files with 20 additions and 5 deletions

View file

@ -26,11 +26,11 @@ module SettingsHelper
device = session.detection.device
if device.mobile?
'mobile'
'smartphone'
elsif device.tablet?
'tablet'
else
'desktop'
'desktop_mac'
end
end

View file

@ -0,0 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"
fill="#5f6368">
<path
d="M320-120v-40l80-80H160q-33 0-56.5-23.5T80-320v-440q0-33 23.5-56.5T160-840h640q33 0 56.5 23.5T880-760v440q0 33-23.5 56.5T800-240H560l80 80v40H320ZM160-440h640v-320H160v320Zm0 0v-320 320Z" />
</svg>

After

Width:  |  Height:  |  Size: 329 B

View file

@ -0,0 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"
fill="#5f6368">
<path
d="M280-40q-33 0-56.5-23.5T200-120v-720q0-33 23.5-56.5T280-920h400q33 0 56.5 23.5T760-840v720q0 33-23.5 56.5T680-40H280Zm0-120v40h400v-40H280Zm0-80h400v-480H280v480Zm0-560h400v-40H280v40Zm0 0v-40 40Zm0 640v40-40Z" />
</svg>

After

Width:  |  Height:  |  Size: 353 B

View file

@ -0,0 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"
fill="#5f6368">
<path
d="M120-160q-33 0-56.5-23.5T40-240v-480q0-33 23.5-56.5T120-800h720q33 0 56.5 23.5T920-720v480q0 33-23.5 56.5T840-160H120Zm40-560h-40v480h40v-480Zm80 480h480v-480H240v480Zm560-480v480h40v-480h-40Zm0 0h40-40Zm-640 0h-40 40Z" />
</svg>

After

Width:  |  Height:  |  Size: 362 B

View file

@ -1,7 +1,7 @@
%tr
%td
%span{ title: session.user_agent }<
= fa_icon "#{session_device_icon(session)} fw", 'aria-label': session_device_icon(session)
= material_symbol session_device_icon(session), 'aria-label': session_device_icon(session)
&nbsp;
= t 'sessions.description',
browser: t("sessions.browsers.#{session.browser}", default: session.browser.to_s),

View file

@ -10,7 +10,7 @@ describe SettingsHelper do
it 'detects the device and returns a descriptive string' do
result = helper.session_device_icon(session)
expect(result).to eq('mobile')
expect(result).to eq('smartphone')
end
end
@ -30,7 +30,7 @@ describe SettingsHelper do
it 'detects the device and returns a descriptive string' do
result = helper.session_device_icon(session)
expect(result).to eq('desktop')
expect(result).to eq('desktop_mac')
end
end
end