Redesign add bookmark popup and improve icon picker
Updated the add bookmark popup with a more modern Material card style, clearer field labels, and improved layout. The icon picker now fetches the full list of Material Icons asynchronously from Google Fonts, with a fallback to a minimal static set for immediate use. Enhanced the icon grid UI and selection logic for better usability.
This commit is contained in:
+20
-142
@@ -1,143 +1,21 @@
|
||||
export const icons = [
|
||||
'home',
|
||||
'star',
|
||||
'bookmark',
|
||||
'favorite',
|
||||
'public',
|
||||
'search',
|
||||
'settings',
|
||||
'3d_rotation',
|
||||
'ac_unit',
|
||||
'access_alarm',
|
||||
'access_alarms',
|
||||
'access_time',
|
||||
'accessibility',
|
||||
'accessibility_new',
|
||||
'accessible',
|
||||
'accessible_forward',
|
||||
'account_balance',
|
||||
'account_balance_wallet',
|
||||
'account_box',
|
||||
'account_circle',
|
||||
'adb',
|
||||
'add',
|
||||
'add_a_photo',
|
||||
'add_alarm',
|
||||
'add_alert',
|
||||
'add_box',
|
||||
'add_business',
|
||||
'add_call',
|
||||
'add_circle',
|
||||
'add_circle_outline',
|
||||
'add_comment',
|
||||
'add_home',
|
||||
'add_ic_call',
|
||||
'add_link',
|
||||
'add_location',
|
||||
'add_photo_alternate',
|
||||
'add_road',
|
||||
'add_shopping_cart',
|
||||
'add_task',
|
||||
'add_to_drive',
|
||||
'add_to_home_screen',
|
||||
'add_to_photos',
|
||||
'add_to_queue',
|
||||
'adjust',
|
||||
'admin_panel_settings',
|
||||
'agriculture',
|
||||
'airline_seat_flat',
|
||||
'airline_seat_flat_angled',
|
||||
'airline_seat_individual_suite',
|
||||
'airline_seat_legroom_extra',
|
||||
'airline_seat_legroom_normal',
|
||||
'airline_seat_legroom_reduced',
|
||||
'airline_seat_recline_extra',
|
||||
'airline_seat_recline_normal',
|
||||
'airplanemode_active',
|
||||
'airplanemode_inactive',
|
||||
'airplay',
|
||||
'airport_shuttle',
|
||||
'alarm',
|
||||
'alarm_add',
|
||||
'alarm_off',
|
||||
'alarm_on',
|
||||
'album',
|
||||
'align_horizontal_center',
|
||||
'align_horizontal_left',
|
||||
'align_horizontal_right',
|
||||
'align_vertical_bottom',
|
||||
'align_vertical_center',
|
||||
'align_vertical_top',
|
||||
'all_inbox',
|
||||
'all_inclusive',
|
||||
'all_out',
|
||||
'alt_route',
|
||||
'analytics',
|
||||
'anchor',
|
||||
'android',
|
||||
'animation',
|
||||
'announcement',
|
||||
'apartment',
|
||||
'api',
|
||||
'app_blocking',
|
||||
'app_registration',
|
||||
'app_settings_alt',
|
||||
'approval',
|
||||
'apps',
|
||||
'archive',
|
||||
'area_chart',
|
||||
'arrow_back',
|
||||
'arrow_back_ios',
|
||||
'arrow_circle_down',
|
||||
'arrow_circle_up',
|
||||
'arrow_downward',
|
||||
'arrow_drop_down',
|
||||
'arrow_drop_down_circle',
|
||||
'arrow_drop_up',
|
||||
'arrow_forward',
|
||||
'arrow_forward_ios',
|
||||
'arrow_left',
|
||||
'arrow_right',
|
||||
'arrow_right_alt',
|
||||
'arrow_upward',
|
||||
'art_track',
|
||||
'article',
|
||||
'aspect_ratio',
|
||||
'assessment',
|
||||
'assignment',
|
||||
'assignment_ind',
|
||||
'assignment_late',
|
||||
'assignment_return',
|
||||
'assignment_returned',
|
||||
'assignment_turned_in',
|
||||
'assistant',
|
||||
'assistant_photo',
|
||||
'atm',
|
||||
'attach_email',
|
||||
'attach_file',
|
||||
'attach_money',
|
||||
'attachment',
|
||||
'attractions',
|
||||
'attribution',
|
||||
'audiotrack',
|
||||
'auto_awesome',
|
||||
'auto_awesome_mosaic',
|
||||
'auto_delete',
|
||||
'auto_fix_high',
|
||||
'auto_fix_normal',
|
||||
'auto_fix_off',
|
||||
'auto_graph',
|
||||
'auto_stories',
|
||||
'autorenew',
|
||||
'av_timer',
|
||||
'baby_changing_station',
|
||||
'backpack',
|
||||
'backspace',
|
||||
'backup',
|
||||
'badge',
|
||||
'zoom_in',
|
||||
'zoom_out',
|
||||
'zoom_out_map'
|
||||
];
|
||||
// This file is automatically generated from Google's Material Icons.
|
||||
/**
|
||||
* Fetches the full list of Material Icon names from Google Fonts.
|
||||
* Returns an array of strings like ["3d_rotation","access_alarm",…]
|
||||
*/
|
||||
export async function fetchAllIcons() {
|
||||
const res = await fetch("https://fonts.google.com/metadata/icons");
|
||||
let txt = await res.text();
|
||||
// strip the weird prefix )]}'\n
|
||||
txt = txt.replace(/^\)\]\}'\s*/, "");
|
||||
const json = JSON.parse(txt);
|
||||
return json.icons.map(icon => icon.name);
|
||||
}
|
||||
|
||||
//Icons from fonts.google.com/icons
|
||||
// Fallback static array for immediate use (e.g. the "+" button and bookmark icons)
|
||||
export const icons = [
|
||||
'add',
|
||||
'bookmark',
|
||||
'star',
|
||||
// …add any other icons your components expect synchronously…
|
||||
];
|
||||
Reference in New Issue
Block a user