Files
growstuff/app/javascript/components/MenuIcon.jsx
T
Brenda Wallace a0b24381ac Refactor activities to jobs across the application
- Renamed all instances of 'Activity' to 'Job' in views, controllers, and models.
- Updated routes to reflect the change from activities to jobs.
- Modified database schema to rename the activities table to jobs and adjusted related columns.
- Updated locale files to change activity-related translations to jobs.
- Adjusted tests to ensure they reference jobs instead of activities.
- Removed the category field from jobs as they are now a plain list.
- Updated seed data and sample data generation to create jobs instead of activities.
2026-10-22 17:16:25 +13:00

20 lines
760 B
React

import React from 'react';
import ICONS from '../menuIcons.json';
// An action's `key` is not always the icon's name.
const ALIASES = {photo: 'add_photo', plan: 'job', deactivate: 'archive', activate: 'planting'};
// The green line icon of an actions menu item. The drawings are shared with the
// server-rendered menus (see MENU_ICONS in app/helpers/icons_helper.rb).
export default function MenuIcon({name}) {
const paths = ICONS[ALIASES[name] || name];
if (!paths) return null;
return (
<svg className="menu-icon" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor"
strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"
dangerouslySetInnerHTML={{__html: paths}} />
);
}